Attempt of qemu-kvm-0.14 patching via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” on F14

Following bellow is attempt to test mentioned patch to resolve problem with loading KVM with “-vga qxl” by /usr/bin/qemu-kvm (v. 0.14) on Fedora 14 ( Libvirt Preview Environment ) . View : http://patchwork.ozlabs.org/patch/84704/. Test was successful for SL6,F14,W2K3,W7 KVMs (without QXL driver installed) and failed on Ubuntu 10.10 KVM no matter of presence or absence of QXL driver.
Download corresponding SRC RPM :-
# wget http://repos.fedorapeople.org/repos/jforbes/virt-preview/fedora-14/SRPMS/qemu-0.14.0-2.fc14.src.rpm
Install it :-
# rpm -iv qemu-0.14.0-2.fc14.src.rpm
# cd
#cd rpmbuild/SPECS

Patch ../SOURCES/qemu-kvm-0.14.0.tar.gz via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” .Then build

[root@fedora14 SPECS]# rpmbuild –with x86only -bb ./qemu.spec

*****************************
Remove old RPMS :-
*****************************
[root@fedora14 x86_64]# cat remove.sh
yum remove qemu-0.14.0-2.fc14.x86_64 \
qemu-common-0.14.0-2.fc14.x86_64 \
qemu-debuginfo-0.14.0-2.fc14.x86_64 \
qemu-img-0.14.0-2.fc14.x86_64 \
qemu-kvm-0.14.0-2.fc14.x86_64 \
qemu-kvm-tools-0.14.0-2.fc14.x86_64 \
qemu-system-x86-0.14.0-2.fc14.x86_64 \
qemu-user-0.14.0-2.fc14.x86_64
[root@fedora14 x86_64]# ./remove.sh
Removing:
qemu x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 0.0
qemu-common x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 767 k
qemu-img x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 686 k
qemu-kvm x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 0.0
qemu-system-x86 x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 10 M
qemu-user x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 33 M
Removing for dependencies:
libvirt x86_64 0.8.8-2.fc14 @fedora-virt-preview 2.8 M
qemu-system-arm x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 3.2 M
qemu-system-cris x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 1.6 M
qemu-system-m68k x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 2.1 M
qemu-system-mips x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 13 M
qemu-system-ppc x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 12 M
qemu-system-sh4 x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 4.1 M
qemu-system-sparc x86_64 2:0.14.0-2.fc14 @fedora-virt-preview 1.8 M

[root@fedora14 x86_64]# cat inst.sh
yum install qemu-0.14.0-2.fc14.x86_64.rpm \
qemu-common-0.14.0-2.fc14.x86_64.rpm \
qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm \
qemu-img-0.14.0-2.fc14.x86_64.rpm \
qemu-kvm-0.14.0-2.fc14.x86_64.rpm \
qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm \
qemu-system-x86-0.14.0-2.fc14.x86_64.rpm \
qemu-user-0.14.0-2.fc14.x86_64.rpm
********************************************************************
Install patched ones , just built via rpmbuild procedure :-
********************************************************************
[root@fedora14 x86_64]# ./inst.sh
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Examining qemu-0.14.0-2.fc14.x86_64.rpm: 2:qemu-0.14.0-2.fc14.x86_64
Marking qemu-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-common-0.14.0-2.fc14.x86_64.rpm: 2:qemu-common-0.14.0-2.fc14.x86_64
Marking qemu-common-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm: 2:qemu-debuginfo-0.14.0-2.fc14.x86_64
Marking qemu-debuginfo-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-img-0.14.0-2.fc14.x86_64.rpm: 2:qemu-img-0.14.0-2.fc14.x86_64
Marking qemu-img-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-kvm-0.14.0-2.fc14.x86_64.rpm: 2:qemu-kvm-0.14.0-2.fc14.x86_64
Marking qemu-kvm-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm: 2:qemu-kvm-tools-0.14.0-2.fc14.x86_64
Marking qemu-kvm-tools-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-system-x86-0.14.0-2.fc14.x86_64.rpm: 2:qemu-system-x86-0.14.0-2.fc14.x86_64
Marking qemu-system-x86-0.14.0-2.fc14.x86_64.rpm to be installed
Examining qemu-user-0.14.0-2.fc14.x86_64.rpm: 2:qemu-user-0.14.0-2.fc14.x86_64
Marking qemu-user-0.14.0-2.fc14.x86_64.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package qemu.x86_64 2:0.14.0-2.fc14 set to be installed
–> Processing Dependency: qemu-system-sparc = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-arm = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-cris = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-sh4 = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-m68k = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-mips = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
–> Processing Dependency: qemu-system-ppc = 2:0.14.0-2.fc14 for package: 2:qemu-0.14.0-2.fc14.x86_64
—> Package qemu-common.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-debuginfo.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-img.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-kvm.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-kvm-tools.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-x86.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-user.x86_64 2:0.14.0-2.fc14 set to be installed
–> Running transaction check
—> Package qemu-system-arm.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-cris.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-m68k.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-mips.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-ppc.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-sh4.x86_64 2:0.14.0-2.fc14 set to be installed
—> Package qemu-system-sparc.x86_64 2:0.14.0-2.fc14 set to be installed
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
qemu x86_64 2:0.14.0-2.fc14 /qemu-0.14.0-2.fc14.x86_64 0.0
qemu-common x86_64 2:0.14.0-2.fc14 /qemu-common-0.14.0-2.fc14.x86_64 775 k
qemu-debuginfo x86_64 2:0.14.0-2.fc14 /qemu-debuginfo-0.14.0-2.fc14.x86_64 322 M
qemu-img x86_64 2:0.14.0-2.fc14 /qemu-img-0.14.0-2.fc14.x86_64 701 k
qemu-kvm x86_64 2:0.14.0-2.fc14 /qemu-kvm-0.14.0-2.fc14.x86_64 0.0
qemu-kvm-tools x86_64 2:0.14.0-2.fc14 /qemu-kvm-tools-0.14.0-2.fc14.x86_64 12 k
qemu-system-x86 x86_64 2:0.14.0-2.fc14 /qemu-system-x86-0.14.0-2.fc14.x86_64 10 M
qemu-user x86_64 2:0.14.0-2.fc14 /qemu-user-0.14.0-2.fc14.x86_64 3.9 M
Installing for dependencies:
qemu-system-arm x86_64 2:0.14.0-2.fc14 fedora-virt-preview 1.0 M
qemu-system-cris x86_64 2:0.14.0-2.fc14 fedora-virt-preview 593 k
qemu-system-m68k x86_64 2:0.14.0-2.fc14 fedora-virt-preview 705 k
qemu-system-mips x86_64 2:0.14.0-2.fc14 fedora-virt-preview 3.4 M
qemu-system-ppc x86_64 2:0.14.0-2.fc14 fedora-virt-preview 2.9 M
qemu-system-sh4 x86_64 2:0.14.0-2.fc14 fedora-virt-preview 1.4 M
qemu-system-sparc x86_64 2:0.14.0-2.fc14 fedora-virt-preview 641 k

Transaction Summary
===================================================================================================================
Install 15 Package(s)

Total size: 348 M
Total download size: 11 M
Installed size: 375 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 11 M
(1/7): qemu-system-arm-0.14.0-2.fc14.x86_64.rpm | 1.0 MB 00:02
(2/7): qemu-system-cris-0.14.0-2.fc14.x86_64.rpm | 593 kB 00:01
(3/7): qemu-system-m68k-0.14.0-2.fc14.x86_64.rpm | 705 kB 00:01
(4/7): qemu-system-mips-0.14.0-2.fc14.x86_64.rpm | 3.4 MB 00:05
(5/7): qemu-system-ppc-0.14.0-2.fc14.x86_64.rpm | 2.9 MB 00:03
(6/7): qemu-system-sh4-0.14.0-2.fc14.x86_64.rpm | 1.4 MB 00:02
(7/7): qemu-system-sparc-0.14.0-2.fc14.x86_64.rpm | 641 kB 00:01
——————————————————————————————————————-
Total 534 kB/s | 11 MB 00:20
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2:qemu-common-0.14.0-2.fc14.x86_64 1/15
Installing : 2:qemu-system-x86-0.14.0-2.fc14.x86_64 2/15
Installing : 2:qemu-system-ppc-0.14.0-2.fc14.x86_64 3/15
Installing : 2:qemu-system-mips-0.14.0-2.fc14.x86_64 4/15
Installing : 2:qemu-system-sparc-0.14.0-2.fc14.x86_64 5/15
Installing : 2:qemu-user-0.14.0-2.fc14.x86_64 6/15
Installing : 2:qemu-system-arm-0.14.0-2.fc14.x86_64 7/15
Installing : 2:qemu-system-sh4-0.14.0-2.fc14.x86_64 8/15
Installing : 2:qemu-system-m68k-0.14.0-2.fc14.x86_64 9/15
Installing : 2:qemu-system-cris-0.14.0-2.fc14.x86_64 10/15
Installing : 2:qemu-img-0.14.0-2.fc14.x86_64 11/15
Installing : 2:qemu-0.14.0-2.fc14.x86_64 12/15
Installing : 2:qemu-kvm-0.14.0-2.fc14.x86_64 13/15
Installing : 2:qemu-kvm-tools-0.14.0-2.fc14.x86_64 14/15
Installing : 2:qemu-debuginfo-0.14.0-2.fc14.x86_64 15/15

Installed:
qemu.x86_64 2:0.14.0-2.fc14 qemu-common.x86_64 2:0.14.0-2.fc14 qemu-debuginfo.x86_64 2:0.14.0-2.fc14
qemu-img.x86_64 2:0.14.0-2.fc14 qemu-kvm.x86_64 2:0.14.0-2.fc14 qemu-kvm-tools.x86_64 2:0.14.0-2.fc14
qemu-system-x86.x86_64 2:0.14.0-2.fc14 qemu-user.x86_64 2:0.14.0-2.fc14

Dependency Installed:
qemu-system-arm.x86_64 2:0.14.0-2.fc14 qemu-system-cris.x86_64 2:0.14.0-2.fc14
qemu-system-m68k.x86_64 2:0.14.0-2.fc14 qemu-system-mips.x86_64 2:0.14.0-2.fc14
qemu-system-ppc.x86_64 2:0.14.0-2.fc14 qemu-system-sh4.x86_64 2:0.14.0-2.fc14
qemu-system-sparc.x86_64 2:0.14.0-2.fc14

Complete!
[root@fedora14 x86_64]#

Install F14 KVM as usual as VFS14.
# virsh dumpxml VFS14 > VF14.xml
Update VF14.xml :
1. Set name to VFSP14
2.Remove uuid section
3.Replace emulator with /usr/local/bin/qemu-spice
4.Remove video section ( pci slot 0x02)
# virsh define VF14.xml
will create KVM VFSP14 to run in spice session

Runtime VFSP14 profile :-

<domain type='kvm' id='7'>
<name>VFSP14</name>
<uuid>96172c80-c4df-4bbb-469e-a9e999289915</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc-0.14'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/local/bin/qemu-spice</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/vg_kvms/vm01'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<controller type='ide' index='0'>
<alias name='ide0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:f6:88:9a'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
<sound model='ac97'>
<alias name='sound0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>

Emulator

#cat /usr/local/bin/qemu-spice
#!/bin/bash
exec /usr/bin/qemu-kvm $* \
-vga qxl \
-spice port=5930,disable-ticketing
[root@fedora14 ~]#






File /var/log/libvirt/qemu/VFSP14.log
*****************
Before patching
*****************
2011-03-13 13:04:55.858: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/local/bin/qemu-spice -S -M pc-0.14 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name VFSP14 -uuid 96172c80-c4df-4bbb-469e-a9e999289915 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VFSP14.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/dev/vg_kvms/vm01,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=21,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f6:88:9a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.0
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
handle_dev_input: start
qemu-kvm: /builddir/build/BUILD/qemu-kvm-0.14.0/qemu-kvm.c:1724: kvm_mutex_unlock: Assertion `!cpu_single_env’ failed.
2011-03-13 13:05:31.775: shutting down
*****************
After patching
*****************
2011-03-13 13:45:19.141: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/local/bin/qemu-spice -S -M pc-0.14 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name VFSP14 -uuid 96172c80-c4df-4bbb-469e-a9e999289915 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/VFSP14.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/dev/vg_kvms/vm01,if=none,id=drive-virtio-disk0,boot=on,format=raw -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=21,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:f6:88:9a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
char device redirected to /dev/pts/1
do_spice_init: starting 0.8.0
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
handle_dev_input: start
handle_dev_destroy_surfaces:
handle_dev_destroy_surfaces:
reds_handle_main_link:
reds_show_new_channel: channel 1:0, connected successfully, over Non Secure link
reds_main_handle_message: net test: latency 0.200000 ms, bitrate 4071570576 bps (3882.952286 Mbps)
reds_show_new_channel: channel 4:0, connected successfully, over Non Secure link
red_dispatcher_set_cursor_peer:
handle_dev_input: cursor connect
reds_show_new_channel: channel 2:0, connected successfully, over Non Secure link
red_dispatcher_set_peer:
handle_dev_input: connect
handle_new_display_channel: jpeg disabled
handle_new_display_channel: zlib-over-glz disabled
reds_show_new_channel: channel 3:0, connected successfully, over Non Secure link
inputs_link:
spice_server_add_interface: SPICE_INTERFACE_TABLET
handle_dev_input: mouse mode 2
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
handle_dev_input: oom current 0 pipe 0
spice_server_remove_interface: remove SPICE_INTERFACE_TABLET
handle_dev_input: mouse mode 1
2011-03-13 13:48:07.644: shutting down

Windows 7 KVM running in spice terminal


Leave a comment