Bug 736975

Summary: Qemu-kvm fails to unregister virtio-balloon-pci device when unplugging
Product: Red Hat Enterprise Linux 6 Reporter: Shaolong Hu <shu>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: acathrow, amit.shah, flang, juzhang, michen, mkenneth, qzhang, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.192.el6 Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 16:03:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 743047    

Description Shaolong Hu 2011-09-09 08:15:52 UTC
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.

Comment 2 Amit Shah 2011-09-09 09:16:04 UTC
Patches posted upstream:
http://thread.gmane.org/gmane.comp.emulators.qemu/116640

Comment 8 langfang 2011-09-27 06:33:42 UTC
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.

Comment 10 Amit Shah 2011-11-18 12:06:48 UTC
    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.

Comment 11 errata-xmlrpc 2011-12-06 16:03:04 UTC
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