Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
Gerd Hoffmann kra...@redhat.com writes: 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. Well, yea, right. Sort of. The ACPI thing applies to some of the slots only. But, yes, strictly speaking this is a slot not a device property in the case of PCI. Problem is qemu doesn't really has an idea what a pci slot is ... Needs fixing. Can't see how we can get sane hot plug without a proper representation of PCI slots in QEMU. 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. Indeed. 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. (3) The qemu emulation can't handle hot-unplug. Since the PIIX3 lives in slot 1, our ACPI tables should not advertise slot 0 or slot 1 as supporting hotplug. They do currently. Should be easily fixable. 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. Wrong. PCI certainly isn't the only bus which supports hotplug. It *does* make sense to handle generic hotplug stuff at qdev level. Could the proper place be qbus instead of qdev? 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. Indeed. That one is a bit harder I suspect. Can this be done without generating acpi tables dynamically?
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
Hi, Wrong. PCI certainly isn't the only bus which supports hotplug. It *does* make sense to handle generic hotplug stuff at qdev level. Could the proper place be qbus instead of qdev? No. But PCI is the only bus where some devices are hot-pluggable and some are not. On all other busses it is either all or no devices. So moving to pci is an option (patches for that are on the list). cheers, Gerd
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for 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. Well, yea, right. Sort of. The ACPI thing applies to some of the slots only. But, yes, strictly speaking this is a slot not a device property in the case of PCI. Problem is qemu doesn't really has an idea what a pci slot is ... 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. Indeed. 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. (3) The qemu emulation can't handle hot-unplug. Since the PIIX3 lives in slot 1, our ACPI tables should not advertise slot 0 or slot 1 as supporting hotplug. They do currently. Should be easily fixable. 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. Wrong. PCI certainly isn't the only bus which supports hotplug. It *does* make sense to handle generic hotplug stuff at qdev level. 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. Indeed. That one is a bit harder I suspect. Can this be done without generating acpi tables dynamically? cheers, Gerd
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Mon, Nov 22, 2010 at 11:17:10AM +0100, Gerd Hoffmann wrote: 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. Indeed. That one is a bit harder I suspect. Can this be done without generating acpi tables dynamically? I tried and failed :( You can try to :) -- Gleb.
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
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(-)
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Fri, Nov 19, 2010 at 08:30:35PM -0600, Anthony Liguori wrote: 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. This patch series introduce soldered property for qdev device. It means that device is not removable from the MB and thus can't be deleted by issuing delete command in qemu monitor. Since the PIIX3 lives in slot 1, our ACPI tables should not advertise slot 0 or slot 1 as supporting hotplug. ACPI table may not advertise it, but it will not prevent removing of PIIX3 by device_del command (or how it is called this days). 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. I am not sure that PCI is the only bus that supports hot-plug. USB and SCSI support it to and I am sure many others. 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(-) -- Gleb.
[Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
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. 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(-)
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Thu, Nov 18, 2010 at 11:45:15AM +0100, 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. Do we want to be able to mark device as not hot-unpluggable from command like too? Something like this -device blabla,notunplug=no. 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(-) -- Gleb.
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On 11/18/10 12:01, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 11:45:15AM +0100, 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. Do we want to be able to mark device as not hot-unpluggable from command like too? Something like this -device blabla,notunplug=no. Hmm, dunno. Do you have a example where this would be needed or useful? cheers, Gerd
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Thu, Nov 18, 2010 at 12:13:21PM +0100, Gerd Hoffmann wrote: On 11/18/10 12:01, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 11:45:15AM +0100, 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. Do we want to be able to mark device as not hot-unpluggable from command like too? Something like this -device blabla,notunplug=no. Hmm, dunno. Do you have a example where this would be needed or useful? Dunno me too. Windows allows to eject any hot-unpluggable device to any user and in the past we got requirement to disable this and had to build two BIOSes one with cpu hot-plug support another without. So hot-pluggability of device looks like management decision (along with technical one if device can't be actually unplugged). -- Gleb.
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On 11/18/10 12:20, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 12:13:21PM +0100, Gerd Hoffmann wrote: On 11/18/10 12:01, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 11:45:15AM +0100, 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. Do we want to be able to mark device as not hot-unpluggable from command like too? Something like this -device blabla,notunplug=no. Hmm, dunno. Do you have a example where this would be needed or useful? Dunno me too. Windows allows to eject any hot-unpluggable device to any user and in the past we got requirement to disable this and had to build two BIOSes one with cpu hot-plug support another without. So hot-pluggability of device looks like management decision (along with technical one if device can't be actually unplugged). For *that* use case well have to do a bit more like dynamically building the acpi table which indicates which slots are hot-pluggable and which are not. Which indeed would be useful and would fix the windows xp offering me to unplug the piix chipset in the savely remove hardware menu ;) But I suspect it also isn't exactly trivial and way behind the scope of this little patch set ... cheers, Gerd
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Thu, Nov 18, 2010 at 12:29:07PM +0100, Gerd Hoffmann wrote: On 11/18/10 12:20, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 12:13:21PM +0100, Gerd Hoffmann wrote: On 11/18/10 12:01, Gleb Natapov wrote: On Thu, Nov 18, 2010 at 11:45:15AM +0100, 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. Do we want to be able to mark device as not hot-unpluggable from command like too? Something like this -device blabla,notunplug=no. Hmm, dunno. Do you have a example where this would be needed or useful? Dunno me too. Windows allows to eject any hot-unpluggable device to any user and in the past we got requirement to disable this and had to build two BIOSes one with cpu hot-plug support another without. So hot-pluggability of device looks like management decision (along with technical one if device can't be actually unplugged). For *that* use case well have to do a bit more like dynamically building the acpi table which indicates which slots are hot-pluggable and which are not. Which indeed would be useful and would fix the windows xp offering me to unplug the piix chipset in the savely remove hardware menu ;) Yes, but management has to specify to us somehow that certain device is not hotpluggable and notunplug=no looks like good way to do it. But I suspect it also isn't exactly trivial and way behind the scope of this little patch set ... If it is not trivial I will not insist. -- Gleb.
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On 18.11.2010 14:42, Gleb Natapov wrote: [] For *that* use case well have to do a bit more like dynamically building the acpi table which indicates which slots are hot-pluggable and which are not. Which indeed would be useful and would fix the windows xp offering me to unplug the piix chipset in the savely remove hardware menu ;) Yes, but management has to specify to us somehow that certain device is not hotpluggable and notunplug=no looks like good way to do it. Can we _please_ get rid of this double negative and specify it as usual hotplug={on|off} ? :) It does not matter if in the code it will be called nohotplug, the parameter parser function can perform the necessary negation. nohotplug=no is just plain wrong ;) /mjt
Re: [Qemu-devel] [PATCH 0/3] add hotplug opt-out option for devices.
On Thu, Nov 18, 2010 at 03:07:48PM +0300, Michael Tokarev wrote: On 18.11.2010 14:42, Gleb Natapov wrote: [] For *that* use case well have to do a bit more like dynamically building the acpi table which indicates which slots are hot-pluggable and which are not. Which indeed would be useful and would fix the windows xp offering me to unplug the piix chipset in the savely remove hardware menu ;) Yes, but management has to specify to us somehow that certain device is not hotpluggable and notunplug=no looks like good way to do it. Can we _please_ get rid of this double negative and specify it as usual hotplug={on|off} ? :) It does not matter if in the code it will be called nohotplug, the parameter parser function can perform the necessary negation. nohotplug=no is just plain wrong ;) Don't care about name. -- Gleb.