Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 596274 - QMP: netdev_del sometimes fails claiming the device is in use
Summary: QMP: netdev_del sometimes fails claiming the device is in use
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Virtualization Bugs
Depends On:
Blocks: 580953
TreeView+ depends on / blocked
Reported: 2010-05-26 14:05 UTC by Daniel Berrangé
Modified: 2013-01-09 22:37 UTC (History)
5 users (show)

Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-07-02 05:09:03 UTC
Target Upstream Version:

Attachments (Terms of Use)

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


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 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

Comment 6 juzhang 2010-06-28 09:44:58 UTC
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 05:09:03 UTC
according to comment6,close this issue.

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