Red Hat Bugzilla – Bug 736975
Qemu-kvm fails to unregister virtio-balloon-pci device when unplugging
Last modified: 2013-01-09 19:18:19 EST
Description of problem: ------------------------ Qemu-kvm fails to unregister virtio-balloon-pci device when unplugging, causes following virtio-balloon-pci device plugging failed. Version-Release number of selected component (if applicable): -------------------------------------------------------------- qemu-kvm-0.12.1.2-2.188.el6.x86_64 2.6.32-196.el6.x86_64 How reproducible: ------------------ 100% Steps to Reproduce: -------------------- 1. boot guest with: usr/libexec/qemu-kvm -enable-kvm -M rhel6.2.0 -smp 4 -m 4G -name rhel6.1-64 -uuid 3f2ea5cd-3d29-48ff-aab2-23df1b6ae213 -drive file=RHEL-Server-6.1-64-virtio.qcow2,cache=none,if=none,rerror=stop,werror=stop,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=device-virtio-disk0,bootindex=1 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -boot order=cd,menu=on -vnc :10 -monitor stdio -monitor unix:/tmp/tt,server,nowait 2.in qemu monitor: (qemu) info balloon Device 'balloon' has not been activated by the guest (qemu) device_add virtio-balloon-pci,id=balloon1 (qemu) info balloon balloon: actual=4096 (qemu) balloon 2048 (qemu) info balloon balloon: actual=2048 (qemu) device_del balloon1 (qemu) info balloon balloon: actual=4096 (qemu) balloon 2048 (qemu) info balloon balloon: actual=4096 (qemu) device_del balloon1 Device 'balloon1' not found (qemu) device_add virtio-balloon-pci,id=balloon1 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized (qemu) device_add virtio-balloon-pci,id=balloon2 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized Actual results: ---------------- As in step 2, can not hotplug a virtio-balloon-pci device any more. Expected results: ----------------- Recently, patch has been added to limit there is only one balloon device assigned to guest, but when this balloon device unplugged, should allow another balloon device plugged. Extra expected result will be after balloon device unplugged, when issue "info balloon" in qemu monitor, it should prompt "Device 'balloon' has not been activated by the guest", and cannot run "balloon xxx" in qemu monitor.
Patches posted upstream: http://thread.gmane.org/gmane.comp.emulators.qemu/116640
Reproduced this issue with qemu-kvm-0.12.1.2-2.190.el6.x86_64 kernel:2.6.32-202.el6.x86_64 steps: 1.boot guest #/usr/libexec/qemu-kvm -smp 2....... 2.1.boot guest #/usr/libexec/qemu-kvm -smp 2....... 2.(qemu) device_add virtio-balloon-pci,id=balloon1 (qemu) info balloon balloon: actual=2048 (qemu) balloon 1024 (qemu) info balloon balloon: actual=1024 (qemu) device_del balloon1 (qemu) info balloon balloon: actual=2048 (qemu) device_del balloon1 Device 'balloon1' not found (qemu) device_add virtio-balloon-pci,id=balloon1 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized (qemu) device_add virtio-balloon-pci,id=balloon2 Another balloon device already registered Device 'virtio-balloon-pci' could not be initialized (qemu) Results:as step 2,can not hotplug a virtio-balloon-pci device . Veriry this issue with hostA(rhel6.2):qemu-kvm-0.12.1.2-2.192.el6.x86_64 kernel:2.6.32-202.el6.x86_64 using steps as same as reproduce Results:1)can unhotplug balloon device 2)can not hotplug more than one balloon device 3) when one balloon device unplugged, should allow another balloon device plugged. Above all,this issue have been fixed.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Hot-plugging a baloon device after hot-unplugging a previous one failed. This was fixed by unregistering the balloon device from the balloon core in QEMU. With the fix, balloon devices can be added and removed without problems.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2011-1531.html