From: Laurent Vivier <lvivier@redhat.com>
To: qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>,
Jens Freimann <jfreimann@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: [PATCH] failover: unregister ram on unplug
Date: Tue, 20 Jul 2021 20:16:44 +0200 [thread overview]
Message-ID: <20210720181644.196315-1-lvivier@redhat.com> (raw)
This simple change allows to test failover with a simulated device
like e1000e rather than a vfio device.
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:
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
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/virtio-net.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 16d20cdee52a..8f7735bad4f2 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3256,6 +3256,9 @@ static void virtio_net_handle_migration_primary(VirtIONet *n, MigrationState *s)
if (migration_in_setup(s) && !should_be_hidden) {
if (failover_unplug_primary(n, dev)) {
vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev);
+ if (PCI_DEVICE(dev)->has_rom) {
+ vmstate_unregister_ram(&PCI_DEVICE(dev)->rom , dev);
+ }
qapi_event_send_unplug_primary(dev->id);
qatomic_set(&n->failover_primary_hidden, true);
} else {
--
2.31.1
next reply other threads:[~2021-07-20 18:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 18:16 Laurent Vivier [this message]
2021-07-21 8:58 ` [PATCH] failover: unregister ram on unplug Igor Mammedov
2021-07-21 9:31 ` Laurent Vivier
2021-07-21 10:41 ` Michael S. Tsirkin
2021-07-21 10:49 ` Laurent Vivier
2021-07-21 15:36 ` Philippe Mathieu-Daudé
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=20210720181644.196315-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jasowang@redhat.com \
--cc=jfreimann@redhat.com \
--cc=mst@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).