On 11/18/2010 04:45 AM, Gerd Hoffmann wrote:
Hi,
This patch series adds a qdev flag which allows devices being tagged as
not hotpluggable. It also sets this flag for a number of devices.
I understand why you're adding this but this is one of those horrible
abuses of qdev that we really need to avoid.
There are two valid reasons why hotplug is not possible:
1) Hotplugging is not supported by the *slot*. This is something that
needs to be exposes through ACPI. This is not a qdev property, but a
property of a PCI slot. It's very important that we do this correctly
because Windows puts a little icon in the systray that advertises
quick-removal of devices in slots that support hotplug.
2) The PCI device is soldered to the MB or is otherwise not part of a
PCI slot. Again, this is part of the ACPI definition.
Since the PIIX3 lives in slot 1, our ACPI tables should not advertise
slot 0 or slot 1 as supporting hotplug.
Hotplug information has no business being part of the core qdev
structures. Hotplug is a PCI concept and the information needs to live
at the PCI layer to be meaningfully.
An ideal interface would explicitly allow a user to mark a series of PCI
slots as no supporting hotplug. It would be convenient in order to
ensure that your virtio-net wasn't accidentally ejected by a click-happy
Windows user.
Regards,
Anthony Liguori
Gerd Hoffmann (3):
qdev: allow devices being tagged as not hotpluggable.
piix: tag as non-hotpluggable.
vga: tag as not hotplugable.
hw/acpi_piix4.c | 2 ++
hw/cirrus_vga.c | 1 +
hw/ide/piix.c | 2 ++
hw/piix4.c | 1 +
hw/piix_pci.c | 2 ++
hw/qdev.c | 16 +++++++++++++---
hw/qdev.h | 1 +
hw/vga-pci.c | 1 +
hw/vmware_vga.c | 1 +
qerror.c | 4 ++++
qerror.h | 3 +++
11 files changed, 31 insertions(+), 3 deletions(-)