[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 08/22] virtio-rng: implement per-device migration
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH v9 08/22] virtio-rng: implement per-device migration calls |
Date: |
Tue, 24 Jun 2014 19:20:23 +0200 |
User-agent: |
StGit/0.17-dirty |
While we are here, we also check virtio_load() return value.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
---
hw/virtio/virtio-rng.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index 025de81..1356aca 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -107,19 +107,20 @@ static void virtio_rng_save(QEMUFile *f, void *opaque)
static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
{
- VirtIORNG *vrng = opaque;
- VirtIODevice *vdev = VIRTIO_DEVICE(vrng);
-
if (version_id != 1) {
return -EINVAL;
}
- virtio_load(vdev, f, version_id);
+ return virtio_load(VIRTIO_DEVICE(opaque), f, version_id);
+}
+static int virtio_rng_load_device(VirtIODevice *vdev, QEMUFile *f,
+ int version_id)
+{
/* We may have an element ready but couldn't process it due to a quota
* limit. Make sure to try again after live migration when the quota may
* have been reset.
*/
- virtio_rng_process(vrng);
+ virtio_rng_process(VIRTIO_RNG(vdev));
return 0;
}
@@ -219,6 +220,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void
*data)
vdc->realize = virtio_rng_device_realize;
vdc->unrealize = virtio_rng_device_unrealize;
vdc->get_features = get_features;
+ vdc->load = virtio_rng_load_device;
}
static void virtio_rng_initfn(Object *obj)
- [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 01/22] virtio-net: byteswap virtio-net header, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 02/22] virtio-serial: don't migrate the config space, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 03/22] virtio: introduce device specific migration calls, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 04/22] virtio-net: implement per-device migration calls, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 05/22] virtio-blk: implement per-device migration calls, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 06/22] virtio-serial: implement per-device migration calls, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 07/22] virtio-balloon: implement per-device migration calls, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 08/22] virtio-rng: implement per-device migration calls,
Greg Kurz <=
- [Qemu-devel] [PATCH v9 09/22] virtio: add subsections to the migration stream, Greg Kurz, 2014/06/24
- Re: [Qemu-devel] [PATCH v9 00/22] legacy virtio support for cross-endian targets, Michael S. Tsirkin, 2014/06/24
- [Qemu-devel] [PATCH v9 10/22] exec: introduce target_words_bigendian() helper, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 11/22] cpu: introduce CPUClass::virtio_is_big_endian(), Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 12/22] virtio: add endian-ambivalent support to VirtIODevice, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 13/22] virtio: memory accessors for endian-ambivalent targets, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 14/22] virtio: allow byte swapping for vring, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 15/22] virtio-net: use virtio wrappers to access headers, Greg Kurz, 2014/06/24
- [Qemu-devel] [PATCH v9 16/22] virtio-balloon: use virtio wrappers to access page frame numbers, Greg Kurz, 2014/06/24