Bug 596274 - QMP: netdev_del sometimes fails claiming the device is in use
QMP: netdev_del sometimes fails claiming the device is in use
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
Depends On:
Blocks: 580953
  Show dependency treegraph
Reported: 2010-05-26 10:05 EDT by Daniel Berrange
Modified: 2013-01-09 17:37 EST (History)
5 users (show)

See Also:
Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-02 01:09:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Daniel Berrange 2010-05-26 10:05:00 EDT
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


3. Hotplug a NIC device


4. Hotunplug the NIC device


5. Hotunplug the netdev backend


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 Product and Program Management 2010-05-28 07:55:31 EDT
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
Comment 6 juzhang 2010-06-28 05:44:58 EDT
Using the comment0 steps

Reproduced on qemu-kvm-

After step 5,qmp emit the following message.

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

Verified on qemu-kvm-

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

{"return": {}}
netdev_del succeeds.
Comment 8 juzhang 2010-07-02 01:09:03 EDT
according to comment6,close this issue.

Note You need to log in before you can comment on or make changes to this bug.