qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Jens Freimann <jfreimann@redhat.com>
Subject: Re: [PATCH] failover: unregister ram on unplug
Date: Wed, 21 Jul 2021 06:41:20 -0400	[thread overview]
Message-ID: <20210721062035-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20210721105817.0a4afc21@redhat.com>

On Wed, Jul 21, 2021 at 10:58:17AM +0200, Igor Mammedov wrote:
> On Tue, 20 Jul 2021 20:16:44 +0200
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
> > 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>
> 
> Reviewed-by: Igor Mammedov <imammedo@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) {


Hmm. Any way to hide this behind an interface so
we don't need to poke at pci device internals?

> > +                vmstate_unregister_ram(&PCI_DEVICE(dev)->rom , dev);
> > +            }
> >              qapi_event_send_unplug_primary(dev->id);
> >              qatomic_set(&n->failover_primary_hidden, true);
> >          } else {



  parent reply	other threads:[~2021-07-21 10:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 18:16 [PATCH] failover: unregister ram on unplug Laurent Vivier
2021-07-21  8:58 ` Igor Mammedov
2021-07-21  9:31   ` Laurent Vivier
2021-07-21 10:41   ` Michael S. Tsirkin [this message]
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=20210721062035-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=lvivier@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).