Bug 596274

Summary: QMP: netdev_del sometimes fails claiming the device is in use
Product: Red Hat Enterprise Linux 6 Reporter: Daniel Berrangé <berrange>
Component: qemu-kvmAssignee: Markus Armbruster <armbru>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: amit.shah, juzhang, llim, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.82.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-02 05:09:03 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: 580953    

Description Daniel Berrangé 2010-05-26 14:05:00 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Boot a guest with

LC_ALL=C PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin HOME=/root USER=root LOGNAME=root /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 64 -smp 1,sockets=1,cores=1,threads=1 -name tck -uuid 2e7bb6f8-082a-2cc7-dcce-daef2e693c35 -nographic -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/tck.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -kernel /var/cache/libvirt-tck/os-i686-hvm/vmlinuz -initrd /var/cache/libvirt-tck/os-i686-hvm/initrd -drive file=/var/cache/libvirt-tck/os-i686-hvm/disk.img,if=none,id=drive-virtio-disk0,boot=on -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 


Where that 'vmlinuz' and 'initrd.img' files are the ones from

     kernel = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/i386/os/images/pxeboot/vmlinuz-PAE
     initrd = http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/i386/os/images/pxeboot/initrd-PAE.img

And 'disk.img' is just an uninitialized 100MB sparse file



2. Hotplug a netdev backend

{"execute":"netdev_add","arguments":{"type":"user","id":"hostnet0"}}

3. Hotplug a NIC device

{"execute":"device_add","arguments":{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bus":"pci.0","addr":"0x5"}}

4. Hotunplug the NIC device

{"execute":"device_del","arguments":{"id":"net0"}}

5. Hotunplug the netdev backend

{"execute":"netdev_del","arguments":{"id":"hostnet0"}}


  
Actual results:
{"error": {"class": "DeviceInUse", "desc": "Device 'hostnet0' is in use", "data": {"device": "hostnet0"}}}


Expected results:
netdev_del succeeds.  NB the reason why its claiming it is still in use, is that this kernel probably isn't processing the ACPI unplug event for the guest NIC.  Regardless netdev_del should still be able to succeeed, leaving the NIC with a "null" backend

Additional info:

Comment 2 RHEL Program Management 2010-05-28 11:55:31 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 6 juzhang 2010-06-28 09:44:58 UTC
Using the comment0 steps

Reproduced on qemu-kvm-0.12.1.2-2.77.el6

After step 5,qmp emit the following message.

"{"error": {"class": "DeviceInUse", "desc": "Device 'hostnet2' is in use", "data": {"device": "hostnet2"}}}"

Verified on qemu-kvm-0.12.1.2-2.82.el6


before step5
Devices not on any VLAN:
  net1: model=virtio-net-pci,macaddr=1a:2b:3c:4d:5f:6e
  hostnet2: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown

after step5
Devices not on any VLAN:
net1: model=virtio-net-pci,macaddr=1a:2b:3c:4d:5f:6e

Results:
{"return": {}}
netdev_del succeeds.

Comment 8 juzhang 2010-07-02 05:09:03 UTC
according to comment6,close this issue.