From: Laurent Vivier <lvivier@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Jens Freimann" <jfreimann@redhat.com>
Subject: [RFC PATCH 5/6] failover: pci: unregister ROM on unplug
Date: Mon, 16 Aug 2021 16:58:23 +0200 [thread overview]
Message-ID: <20210816145824.15825-6-lvivier@redhat.com> (raw)
In-Reply-To: <20210816145824.15825-1-lvivier@redhat.com>
The intend of failover is to allow a VM with a VFIO networking card to
be migrated without disrupting the network operation by switching
to a virtio-net device during the migration.
This simple change allows a simulated device like e1000e to be tested
rather than a vfio device, even if it's useless in real life it can help
to debug failover.
This is interesting to developers that want to test failover on
a system with no vfio device. Moreover it simplifies host networking
configuration as we can use the same bridge for virtio-net and
the other failover networking device.
Without this change the migration of a system configured with failover
fails with:
...
-device virtio-net-pci,id=virtionet0,failover=on,... \
-device e1000,failover_pair_id=virtionet0,... \
...
(qemu) migrate ...
Unknown ramblock "0000:00:01.1:00.0/e1000e.rom", cannot accept migration
error while loading state for instance 0x0 of device 'ram'
load of migration failed: Invalid argument
This happens because QEMU correctly unregisters the interface vmstate but
not the ROM one. This patch fixes that.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/pci/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e88686b45976..7cb140940a84 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2208,6 +2208,7 @@ static void pci_dev_handle_migration(PCIDevice *pci_dev, MigrationState *s)
if (migration_in_setup(s)) {
if (pci_dev_migration_unplug(pci_dev)) {
vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev);
+ pci_del_option_rom(pci_dev);
qapi_event_send_unplug_primary(dev->id);
} else {
warn_report("couldn't unplug primary device");
--
2.31.1
next prev parent reply other threads:[~2021-08-16 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 14:58 [RFC PATCH 0/6] virtio-net failover cleanup and new features Laurent Vivier
2021-08-16 14:58 ` [RFC PATCH 1/6] qdev: add an Error parameter to the DeviceListener hide_device() function Laurent Vivier
2021-08-16 14:58 ` [RFC PATCH 2/6] qdev/qbus: remove failover specific code Laurent Vivier
2021-08-16 14:58 ` [RFC PATCH 3/6] failover: virtio-net: remove failover_primary_hidden flag Laurent Vivier
2021-08-16 14:58 ` [RFC PATCH 4/6] failover: pci: move failover hotplug/unplug code into pci subsystem Laurent Vivier
2021-08-16 14:58 ` Laurent Vivier [this message]
2021-08-16 14:58 ` [RFC PATCH 6/6] pci: automatically unplug a PCI card before migration Laurent Vivier
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=20210816145824.15825-6-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jasowang@redhat.com \
--cc=jfreimann@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).