pci_del fails to remove PCI virtio storage device

Bug #544367 reported by Rafael Lorandi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

In qemu monitor, command pci_del silently fails to remove a virtio storage device previously added with pci_add.
It doesn't matter whether the guest actually makes use of the virtio device for this failure to happen.

= QEMU command line =
/usr/local/bin/qemu-system-x86_64 -S -snapshot -enable-kvm -smp 1 -cdrom /pub/gentoo/releases/x86/10.1/livedvd-x86-amd64-32ul-10.1.iso -boot order=d -m 512 -usb -name gentoo_livedvd -ctrl-grab -vga cirrus -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -chardev socket,id=monitor,path=/tmp/gentoo_livedvd.monitor,server,nowait -mon chardev=monitor,mode=readline

= Host information =
Distribution: Gentoo Linux
Portage 2.1.7.16 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.31-gentoo-r6 i686)
System uname: Linux-2.6.31-gentoo-r6-i686-Genuine_Intel-R-_CPU_T1300_@_1.66GHz-with-gentoo-1.12.13

= Guest information =
Gentoo Linux 10.1 x86 LiveDVD

Revision history for this message
Rafael Lorandi (rafael-lorandi) wrote :
Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

I've confirmed this works correctly with the latest git. If you can reproduce it with the latest bits, please reopen a new bug report with details.

I've tested:

commit d9b73e47a3d596c5b33802597ec5bd91ef3348e2
Author: Corentin Chary <email address hidden>
Date: Tue Jun 1 23:05:44 2010 +0200

    vnc: add missing target for vnc-encodings-*.o

Changed in qemu:
status: New → Fix Released
Revision history for this message
Marcos Oviedo (moviedo) wrote :

This bug is still present on latest git. It seems, please double check this, that the commit you tested is related to a different issue.

The steps to reproduce the bug are attached on the case. Usually, when there is support for ACPI operations on the guest OS, the pci_del command triggers a general purpose event indicating to the OS ACPI event handlers that the device is going to be removed. The handlers are then in charge of trigger an eject operation (EJx) on the hw device, which causes the removal of the device. The EJx operation is handled on qemu by pciej_write() and ends by calling qdev_free(), which removes the device in question from the system.

When there is no support for ACPI (either because the ACPI related drivers are not loaded on the guest OS or the VM is stopped using -s -S), there is no way to remove a previously added PCI device.

I've just send a patch that adds the -f (force) option to pci_del in order to be able to remove a PCI device when the ACPI support is not present.

Regards,

Marcos

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.