1.准备工作

yum -y install gcc gcc-c++ automake libtool zlib-devel glib2-devel bzip2-devel libuuid-devel spice-protocol spice-server-devel usbredir-devel libaio-devel

2.下载Qemu 2.4.1

wget http://wiki.qemu-project.org/download/qemu-2.4.1.tar.bz2

qemu-2.4.1.tar.bz2
qemu-3.1.0.tar.bz2
qemu-2.8.0-rc0.tar.bz2

3.解压

tar -jxvf qemu-2.4.1.tar.bz2

4.安装

./configure
# ./configure --enable-usb-redir --enable-libusb --enable-spice --enable-uuid --enable-kvm --enable-bzip2 --prefix=/usr/local/qemu --enable-linux-aio --enable-system
make
make install
# 觉得make 慢的可以使用下面命令
make -j4 #让make最多允许4个编译进程同时执行
make install

编译完成之后 做链接

默认安装在/usr/local/bin/

ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-kvm
ln -s /usr/local/bin/qemu-system-x86_64 /usr/libexec/qemu-kvm
ln -s /usr/local/bin/qemu-img /usr/bin/qemu-img

# ln -s /usr/local/qemu/bin/qemu-system-x86_64 /usr/bin/qemu-kvm
# ln -s /usr/local/qemu/bin/qemu-system-x86_64 /usr/libexec/qemu-kvm
# ln -s /usr/local/qemu/bin/qemu-img /usr/bin/qemu-img

查看当前qemu版本

qemu-img --version
qemu-kvm –version

参考资料

https://blog.csdn.net/sinat_40356718/article/details/78734216