[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Tue, 10 Oct 2023 13:24:20 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TW5M88XSPh2mnv64QH1pzCHi+mM6Ti+xuwwtjMt0qZE=; b=fl5Vcai/94MefbUKUI3ej7buR7UCFn4xRc1fjNzeEubV0GXgpw1O0wMv3rYc2hp9GTs3cG50EQkZeWAIHbx2cx1gYhMP3qmE1c137AABi/GT+I9k3eutmZd8TzG+27YmbmKGCLcQ0C6re9uXe+OsOZcZFZQux2b2cnkaktJbOjnlP4Hky6e2yq/IxLArrxQHWTEWlbjfR1vL2GSAwF5OuCgjbVL6NhB9XD7tGgufFgJpalUCPztcWg1bEgZ7UvuwTwLsnTw8V0FKP9WA/em3D6gzBMwxl3IA51/odO9VXdd+GOHkccRzpsM4lH6vzFNvzvfRqmI7Mba3EwunLKGA2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JPyT78ODqkHuXSzDMvstG3CAxlWAkBqwpkjlNaA4MMbiA1rC+gzrKQwz+8LslnyxgoGCd/Ix1PXw9EJgOvVBfr7FVybrArsw64sNG8IGxmyxj51IHfoYpZZLc52EbXpzR47gujtxOZm3IiDNeTzXOhTJR+dYqLFMaCfXttKZ4zKTF8vsYuo2Y1Gcj7Uo26XMkq3AaMVE/kE2rbzw08MOABLPQOSeQDS7w73cAvzVbkoTQ+r+BVAblaNnqQlmXg0oZ2XxFalDcD42MJs+9s/Jsb/Nx8kwqs0tWKE5ywzEWKKnT5ZUwgdf72WGRWZntS83RSeW39yqH6m8xqOvABrxfA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: qemu-devel@xxxxxxxxxx, Juergen Gross <jgross@xxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, "open list:X86 Xen CPUs" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Oct 2023 20:24:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,
On Mon, Oct 09, 2023 at 04:51:53PM -0700, Stefano Stabellini wrote:
> On Thu, 5 Oct 2023, Vikram Garhwal wrote:
> > From: Juergen Gross <jgross@xxxxxxxx>
> > 
> > Virtio devices should never be unplugged at boot time, as they are
> > similar to pci passthrough devices.
> > 
> > Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> > Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
> > ---
> >  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"
Sounds good. Will update in the code comment in v2.
> 
> 
> >          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
> > 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.