[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V3 28/44] virtio-rng: don't use pointer for configur
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH V3 28/44] virtio-rng: don't use pointer for configuration. |
Date: |
Tue, 15 Jan 2013 15:09:42 +0100 |
From: KONRAD Frederic <address@hidden>
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 <address@hidden>
---
hw/virtio-rng.c | 12 ++++++------
hw/virtio-rng.h | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index d79aa46..e672c40 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -123,10 +123,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);
}
@@ -158,16 +158,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/hw/virtio-rng.h b/hw/virtio-rng.h
index 3711c97..3deb283 100644
--- a/hw/virtio-rng.h
+++ b/hw/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;
--
1.7.11.7
- [Qemu-devel] [PATCH V3 34/44] virtio-rng.c: cleanup: use QOM casts., (continued)
- [Qemu-devel] [PATCH V3 34/44] virtio-rng.c: cleanup: use QOM casts., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 27/44] virtio-balloon: cleanup: remove qdev field., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 29/44] virtio-rng: add virtio-rng device., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 42/44] virtio-9p-pci: switch to the new API., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 21/44] virtio-scsi: cleanup: init and exit functions., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 30/44] virtio-rng-s390: switch to the new API., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 35/44] virtio-serial: add the virtio-serial device., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 43/44] virtio-9p: cleanup: init function., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 24/44] virtio-balloon-pci: switch to the new API., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 23/44] virtio-balloon: add the virtio-balloon device., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 28/44] virtio-rng: don't use pointer for configuration.,
fred . konrad <=
- [Qemu-devel] [PATCH V3 25/44] virtio-balloon: cleanup: init and exit function., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 16/44] virtio-scsi: moving host_features from properties to transport properties., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 37/44] virtio-serial-s390: switch to the new API., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 38/44] virtio-serial: cleanup: init and exit functions., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 17/44] virtio-scsi: add the virtio-scsi device., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 31/44] virtio-rng-pci: switch to the new API., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 22/44] virtio-scsi: cleanup: remove qdev field., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 40/44] virtio-serial: cleanup: remove qdev field., fred . konrad, 2013/01/15
- [Qemu-devel] [PATCH V3 20/44] virtio-scsi: cleanup: use QOM casts., fred . konrad, 2013/01/15