qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com,
	peter.maydell@linaro.org, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH 5/5] migration: Route more error paths
Date: Wed, 20 Sep 2017 16:57:39 +0100	[thread overview]
Message-ID: <20170920155739.GI2449@work-vm> (raw)
In-Reply-To: <20170920163059.2ddd456c.cohuck@redhat.com>

* Cornelia Huck (cohuck@redhat.com) wrote:
> On Tue, 19 Sep 2017 19:00:38 +0100
> "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> 
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> > 
> > vmstate_save is called in a few places, and vmstate_save_state is
> > called in lots of places.
> > 
> > Route error returns from the easier cases back up;  there are lots
> > of more complex cases where there own error paths need fixing.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> >  hw/display/virtio-gpu.c    |  4 +---
> >  hw/virtio/virtio.c         | 13 +++++++------
> >  include/hw/virtio/virtio.h |  2 +-
> >  migration/vmstate-types.c  | 11 ++++++++---
> >  tests/test-vmstate.c       |  6 +++---
> >  5 files changed, 20 insertions(+), 16 deletions(-)
> > 
> 
> > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > index 464947f76d..860333788b 100644
> > --- a/hw/virtio/virtio.c
> > +++ b/hw/virtio/virtio.c
> > @@ -1899,7 +1899,7 @@ static const VMStateDescription vmstate_virtio = {
> >      }
> >  };
> >  
> > -void virtio_save(VirtIODevice *vdev, QEMUFile *f)
> > +int virtio_save(VirtIODevice *vdev, QEMUFile *f)
> >  {
> >      BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
> >      VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> 
> Would it make sense to touch up the save_config callback as well? Else
> virtio_save() looks a bit lopsided.
> 
> [For virtio-ccw, the callback can simply pass on any return code from
> vmstate_save_state(). For virtio-pci, we can probably make
> pci_device_save() restore the interrupt state in any case.]

What I'd really love to do with save_config is turn it into a
VMStateDescription* - I think I've figured out how to
do that for ccw and mmio - but the pci version is a much harder
mess of casts and stuff.

Dave

--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-09-20 15:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 18:00 [Qemu-devel] [PATCH 0/5] migration: let pre_save fail Dr. David Alan Gilbert (git)
2017-09-19 18:00 ` [Qemu-devel] [PATCH 1/5] migration: pre_save return int Dr. David Alan Gilbert (git)
2017-09-20 13:57   ` Cornelia Huck
2017-09-20 14:32     ` Dr. David Alan Gilbert
2017-09-19 18:00 ` [Qemu-devel] [PATCH 2/5] migration: check pre_save return in vmstate_save_state Dr. David Alan Gilbert (git)
2017-09-19 18:00 ` [Qemu-devel] [PATCH 3/5] migration: wire vmstate_save_state errors up to vmstate_subsection_save Dr. David Alan Gilbert (git)
2017-09-19 18:00 ` [Qemu-devel] [PATCH 4/5] migration: Route errors up through vmstate_save Dr. David Alan Gilbert (git)
2017-09-19 18:00 ` [Qemu-devel] [PATCH 5/5] migration: Route more error paths Dr. David Alan Gilbert (git)
2017-09-20  3:31   ` Peter Xu
2017-09-20 15:45     ` Dr. David Alan Gilbert
2017-09-20  3:55   ` Fam Zheng
2017-09-20 13:26     ` Eric Blake
2017-09-20 14:20     ` Dr. David Alan Gilbert
2017-09-20 15:32       ` Eric Blake
2017-09-20 14:30   ` Cornelia Huck
2017-09-20 15:57     ` Dr. David Alan Gilbert [this message]
2017-09-20 16:00       ` Cornelia Huck

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=20170920155739.GI2449@work-vm \
    --to=dgilbert@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    /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).