qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Jens Freimann <jfreimann@redhat.com>
Cc: ehabkost@redhat.com, mst@redhat.com, aadam@redhat.com,
	qemu-devel@nongnu.org, dgilbert@redhat.com, laine@redhat.com,
	ailan@redhat.com, parav@mellanox.com
Subject: Re: [PATCH v3 02/10] pci: mark devices partially unplugged
Date: Tue, 15 Oct 2019 19:53:47 -0600	[thread overview]
Message-ID: <20191015195347.45c597c4@x1.home> (raw)
In-Reply-To: <20191011112015.11785-3-jfreimann@redhat.com>

On Fri, 11 Oct 2019 13:20:07 +0200
Jens Freimann <jfreimann@redhat.com> wrote:

> Only the guest unplug request was triggered. This is needed for
> the failover feature. In case of a failed migration we need to
> plug the device back to the guest.
> 
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> ---
>  hw/pci/pci.c         | 2 ++
>  hw/pci/pcie.c        | 3 +++
>  include/hw/pci/pci.h | 1 +
>  3 files changed, 6 insertions(+)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index aa05c2b9b2..c140b37765 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -2078,6 +2078,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
>      Error *local_err = NULL;
>      bool is_default_rom;
>  
> +    pci_dev->partially_hotplugged = false;

This is redundant though since the object is zero initialized on
allocation, right?  Thanks,

Alex

> +
>      /* initialize cap_present for pci_is_express() and pci_config_size(),
>       * Note that hybrid PCIs are not set automatically and need to manage
>       * QEMU_PCI_CAP_EXPRESS manually */
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index a6beb567bd..19363ff8ce 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -456,6 +456,9 @@ static void pcie_unplug_device(PCIBus *bus, PCIDevice *dev, void *opaque)
>  {
>      HotplugHandler *hotplug_ctrl = qdev_get_hotplug_handler(DEVICE(dev));
>  
> +    if (dev->partially_hotplugged) {
> +        return;
> +    }
>      hotplug_handler_unplug(hotplug_ctrl, DEVICE(dev), &error_abort);
>      object_unparent(OBJECT(dev));
>  }
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index f3f0ffd5fb..f3a39c9bbd 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -265,6 +265,7 @@ typedef struct PCIReqIDCache PCIReqIDCache;
>  
>  struct PCIDevice {
>      DeviceState qdev;
> +    bool partially_hotplugged;
>  
>      /* PCI config space */
>      uint8_t *config;



  reply	other threads:[~2019-10-16  1:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 11:20 [PATCH v3 0/10] add failover feature for assigned network devices Jens Freimann
2019-10-11 11:20 ` [PATCH v3 01/10] qdev/qbus: add hidden device support Jens Freimann
2019-10-14  9:46   ` Cornelia Huck
2019-10-14 12:02     ` Jens Freimann
2019-10-15 19:19   ` Alex Williamson
2019-10-16  7:04     ` Jens Freimann
2019-10-11 11:20 ` [PATCH v3 02/10] pci: mark devices partially unplugged Jens Freimann
2019-10-16  1:53   ` Alex Williamson [this message]
2019-10-11 11:20 ` [PATCH v3 03/10] pci: mark device having guest unplug request pending Jens Freimann
2019-10-11 11:20 ` [PATCH v3 04/10] qapi: add unplug primary event Jens Freimann
2019-10-11 11:20 ` [PATCH v3 05/10] qapi: add failover negotiated event Jens Freimann
2019-10-11 11:20 ` [PATCH v3 06/10] migration: allow unplug during migration for failover devices Jens Freimann
2019-10-11 11:20 ` [PATCH v3 07/10] migration: add new migration state wait-unplug Jens Freimann
2019-10-11 12:57   ` Michael S. Tsirkin
2019-10-11 14:22     ` Jens Freimann
2019-10-11 16:49   ` Dr. David Alan Gilbert
2019-10-11 17:11   ` Dr. David Alan Gilbert
2019-10-15  9:45     ` Jens Freimann
2019-10-15 10:50       ` Dr. David Alan Gilbert
2019-10-16  7:07         ` Jens Freimann
2019-10-11 11:20 ` [PATCH v3 08/10] libqos: tolerate wait-unplug migration state Jens Freimann
2019-10-11 11:20 ` [PATCH v3 09/10] net/virtio: add failover support Jens Freimann
2019-10-11 11:20 ` [PATCH v3 10/10] vfio: unplug failover primary device before migration Jens Freimann
2019-10-14 10:05   ` Cornelia Huck
2019-10-16  1:52   ` Alex Williamson
2019-10-16 20:18     ` Jens Freimann
2019-10-17  0:39       ` Alex Williamson
2019-10-17  7:45         ` Jens Freimann
2019-10-11 14:28 ` [PATCH v3 0/10] add failover feature for assigned network devices Michael S. Tsirkin
2019-10-11 16:04 ` no-reply
2019-10-15 19:03 ` Alex Williamson
2019-10-15 21:17   ` Michael S. Tsirkin
2019-10-17 10:33   ` Jens Freimann
2019-10-17 12:51     ` Alex Williamson
2019-10-17 14:04       ` Jens Freimann

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=20191015195347.45c597c4@x1.home \
    --to=alex.williamson@redhat.com \
    --cc=aadam@redhat.com \
    --cc=ailan@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=laine@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).