diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-04-24 10:07:54 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-24 11:50:19 -0500 |
commit | af1a8ad6467eb7056573bc3580d3d1824a05224a (patch) | |
tree | f7d1859f27b4a465aee9aedb352599cbbb20bd16 | |
parent | 5a37532d0897de488c35ab2db6d86647bd2a1b6f (diff) | |
download | qemu-af1a8ad6467eb7056573bc3580d3d1824a05224a.tar.gz qemu-af1a8ad6467eb7056573bc3580d3d1824a05224a.tar.bz2 qemu-af1a8ad6467eb7056573bc3580d3d1824a05224a.zip |
virtio-rng: don't use pointer for configuration.
The configuration field must not be a pointer as it will be used for
virtio-rng properties. So *conf is replaced by conf.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/virtio/virtio-rng.c | 12 | ||||
-rw-r--r-- | include/hw/virtio/virtio-rng.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index fcc223af06..05b4d57b2f 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -124,10 +124,10 @@ static void check_rate_limit(void *opaque) { VirtIORNG *s = opaque; - s->quota_remaining = s->conf->max_bytes; + s->quota_remaining = s->conf.max_bytes; virtio_rng_process(s); qemu_mod_timer(s->rate_limit_timer, - qemu_get_clock_ms(vm_clock) + s->conf->period_ms); + qemu_get_clock_ms(vm_clock) + s->conf.period_ms); } @@ -159,16 +159,16 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf) vrng->vdev.get_features = get_features; vrng->qdev = dev; - vrng->conf = conf; + memcpy(&(vrng->conf), conf, sizeof(struct VirtIORNGConf)); - assert(vrng->conf->max_bytes <= INT64_MAX); - vrng->quota_remaining = vrng->conf->max_bytes; + assert(vrng->conf.max_bytes <= INT64_MAX); + vrng->quota_remaining = vrng->conf.max_bytes; vrng->rate_limit_timer = qemu_new_timer_ms(vm_clock, check_rate_limit, vrng); qemu_mod_timer(vrng->rate_limit_timer, - qemu_get_clock_ms(vm_clock) + vrng->conf->period_ms); + qemu_get_clock_ms(vm_clock) + vrng->conf.period_ms); register_savevm(dev, "virtio-rng", -1, 1, virtio_rng_save, virtio_rng_load, vrng); diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h index c9cadc24b6..c578c00c1b 100644 --- a/include/hw/virtio/virtio-rng.h +++ b/include/hw/virtio/virtio-rng.h @@ -33,7 +33,7 @@ typedef struct VirtIORNG { /* Only one vq - guest puts buffer(s) on it when it needs entropy */ VirtQueue *vq; - VirtIORNGConf *conf; + VirtIORNGConf conf; RngBackend *rng; |