All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Garhwal <vikram.garhwal@amd.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, Juergen Gross <jgross@suse.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Paul Durrant <paul@xen.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>,
	"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Subject: Re: [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices
Date: Tue, 10 Oct 2023 13:24:20 -0700	[thread overview]
Message-ID: <ZSWy9P4tKvPv0M_d@amd.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2310091651110.3431292@ubuntu-linux-20-04-desktop>

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@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"
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
> > 


  reply	other threads:[~2023-10-10 20:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 18:16 [QEMU][PATCH v1 0/7] Xen: support grant mappings Vikram Garhwal
2023-10-05 18:16 ` [QEMU][PATCH v1 1/7] xen: when unplugging emulated devices skip virtio devices Vikram Garhwal
2023-10-09 23:51   ` Stefano Stabellini
2023-10-10 20:24     ` Vikram Garhwal [this message]
2023-10-19  9:17       ` David Woodhouse
2023-10-05 18:16 ` [QEMU][PATCH v1 2/7] xen: add pseudo RAM region for grant mappings Vikram Garhwal
2023-10-10  0:02   ` Stefano Stabellini
2023-10-10  0:29     ` Stefano Stabellini
2023-10-10 21:25     ` Vikram Garhwal
2023-10-10 22:30       ` Stefano Stabellini
2023-10-05 18:16 ` [QEMU][PATCH v1 3/7] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length() Vikram Garhwal
2023-10-10  0:10   ` Stefano Stabellini
2023-10-10 21:26     ` Vikram Garhwal
2023-10-05 18:16 ` [QEMU][PATCH v1 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry Vikram Garhwal
2023-10-10  0:13   ` Stefano Stabellini
2023-10-05 18:16 ` [QEMU][PATCH v1 5/7] memory: add MemoryRegion map and unmap callbacks Vikram Garhwal
2023-10-10  0:17   ` Stefano Stabellini
2023-10-11  7:01     ` Juergen Gross
2023-10-26  1:41       ` Stefano Stabellini
2023-10-05 18:16 ` [QEMU][PATCH v1 6/7] xen: add map and unmap callbacks for grant region Vikram Garhwal
2023-10-10  0:27   ` Stefano Stabellini
2023-10-05 18:16 ` [QEMU][PATCH v1 7/7] hw: arm: Add grant mapping Vikram Garhwal
2023-10-10  0:28   ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZSWy9P4tKvPv0M_d@amd.com \
    --to=vikram.garhwal@amd.com \
    --cc=anthony.perard@citrix.com \
    --cc=eduardo@habkost.net \
    --cc=jgross@suse.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.