[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 6/8] failover: pci: unregister ROM on unplug
|
From: |
Laurent Vivier |
|
Subject: |
[RFC PATCH v2 6/8] failover: pci: unregister ROM on unplug |
|
Date: |
Fri, 20 Aug 2021 16:20:00 +0200 |
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 dd5e95216abf..10b875fdfad1 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
- [RFC PATCH v2 0/8] virtio-net failover cleanup and new features, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 1/8] qdev: add an Error parameter to the DeviceListener hide_device() function, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 2/8] qdev/qbus: remove failover specific code, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 3/8] failover: virtio-net: remove failover_primary_hidden flag, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 5/8] failover: hide the PCI device if the virtio-net device is not present, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 4/8] failover: pci: move failover hotplug/unplug code into pci subsystem, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 6/8] failover: pci: unregister ROM on unplug,
Laurent Vivier <=
- [RFC PATCH v2 7/8] pci: automatically unplug a PCI card before migration, Laurent Vivier, 2021/08/20
- [RFC PATCH v2 8/8] failover: qemu-opts: manage hidden device list, Laurent Vivier, 2021/08/20