Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.313
0113-virtio-rng-implement-per-device-mig.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0113-virtio-rng-implement-per-device-mig.patch of Package qemu.313
From 3cf47d24669f955842f30fed349b46ad28ac7ae0 Mon Sep 17 00:00:00 2001 From: Greg Kurz <gkurz@linux.vnet.ibm.com> Date: Tue, 24 Jun 2014 19:20:23 +0200 Subject: [PATCH] virtio-rng: implement per-device migration calls While we are here, we also check virtio_load() return value. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 3902d49e13c2428bd6381cfdf183103ca4477c1f) Signed-off-by: Alexander Graf <agraf@suse.de> --- 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)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor