[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virt
|
From: |
Stefano Stabellini |
|
Subject: |
Re: [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices |
|
Date: |
Mon, 9 Oct 2023 16:51:53 -0700 (PDT) |
|
User-agent: |
Alpine 2.22 (DEB 394 2020-01-19) |
On Thu, 5 Oct 2023, Vikram Garhwal wrote:
> From: Juergen Gross <jgross@suse.com>
>
> Virtio devices should never be unplugged at boot time, as they are
> similar to pci passthrough devices.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
> ---
> hw/i386/xen/xen_platform.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 17457ff3de..3560eaf8c8 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -28,6 +28,7 @@
> #include "hw/ide/pci.h"
> #include "hw/pci/pci.h"
> #include "migration/vmstate.h"
> +#include "hw/virtio/virtio-bus.h"
> #include "net/net.h"
> #include "trace.h"
> #include "sysemu/xen.h"
> @@ -132,7 +133,8 @@ static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
> /* We have to ignore passthrough devices */
> if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
> PCI_CLASS_NETWORK_ETHERNET
> - && !pci_device_is_passthrough(d)) {
> + && !pci_device_is_passthrough(d)
> + && !qdev_get_child_bus(&d->qdev, TYPE_VIRTIO_BUS)) {
Please update the in-code comment above to say "ignore passthrough
devices and virtio devices"
> object_unparent(OBJECT(d));
> }
> }
> @@ -208,6 +210,10 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void
> *opaque)
> /* We have to ignore passthrough devices */
> if (pci_device_is_passthrough(d))
> return;
> + /* Ignore virtio devices */
> + if (qdev_get_child_bus(&d->qdev, TYPE_VIRTIO_BUS)) {
> + return;
> + }
>
> switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) {
> case PCI_CLASS_STORAGE_IDE:
> --
> 2.17.1
>
- [QEMU][PATCH v1 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry, (continued)
- [QEMU][PATCH v1 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry, Vikram Garhwal, 2023/10/05
- [QEMU][PATCH v1 5/7] memory: add MemoryRegion map and unmap callbacks, Vikram Garhwal, 2023/10/05
- [QEMU][PATCH v1 6/7] xen: add map and unmap callbacks for grant region, Vikram Garhwal, 2023/10/05
- [QEMU][PATCH v1 7/7] hw: arm: Add grant mapping., Vikram Garhwal, 2023/10/05
- [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices, Vikram Garhwal, 2023/10/05
- Re: [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices,
Stefano Stabellini <=