mirror of
https://github.com/mii443/qemu.git
synced 2025-12-09 14:08:32 +00:00
migration: Route more error paths
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 their own error paths need fixing. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170925112917.21340-7-dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Commit message fix up as Peter's review
This commit is contained in:
@@ -1050,9 +1050,7 @@ static int virtio_gpu_save(QEMUFile *f, void *opaque, size_t size,
|
||||
}
|
||||
qemu_put_be32(f, 0); /* end of list */
|
||||
|
||||
vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL);
|
||||
|
||||
return 0;
|
||||
return vmstate_save_state(f, &vmstate_virtio_gpu_scanouts, g, NULL);
|
||||
}
|
||||
|
||||
static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,
|
||||
|
||||
@@ -1897,7 +1897,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);
|
||||
@@ -1947,20 +1947,21 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *f)
|
||||
}
|
||||
|
||||
if (vdc->vmsd) {
|
||||
vmstate_save_state(f, vdc->vmsd, vdev, NULL);
|
||||
int ret = vmstate_save_state(f, vdc->vmsd, vdev, NULL);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Subsections */
|
||||
vmstate_save_state(f, &vmstate_virtio, vdev, NULL);
|
||||
return vmstate_save_state(f, &vmstate_virtio, vdev, NULL);
|
||||
}
|
||||
|
||||
/* A wrapper for use as a VMState .put function */
|
||||
static int virtio_device_put(QEMUFile *f, void *opaque, size_t size,
|
||||
VMStateField *field, QJSON *vmdesc)
|
||||
{
|
||||
virtio_save(VIRTIO_DEVICE(opaque), f);
|
||||
|
||||
return 0;
|
||||
return virtio_save(VIRTIO_DEVICE(opaque), f);
|
||||
}
|
||||
|
||||
/* A wrapper for use as a VMState .get function */
|
||||
|
||||
Reference in New Issue
Block a user