On Wed, 20 Sep 2017 16:57:39 +0100 "Dr. David Alan Gilbert" <dgilb...@redhat.com> wrote:
> * Cornelia Huck (coh...@redhat.com) wrote: > > On Tue, 19 Sep 2017 19:00:38 +0100 > > "Dr. David Alan Gilbert (git)" <dgilb...@redhat.com> wrote: > > > > > From: "Dr. David Alan Gilbert" <dgilb...@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 <dgilb...@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. Sounds even better, but even more complicated as well...