[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 39/61] virtio-rng : don't use pointer for configurat
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 39/61] virtio-rng : don't use pointer for configuration. |
Date: |
Mon, 7 Jan 2013 19:40:52 +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 53/61] virtio-9p : add the virtio-9p device., (continued)
- [Qemu-devel] [PATCH 53/61] virtio-9p : add the virtio-9p device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 25/61] virtio-scsi : moving host_features from properties to transport properties., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 55/61] virtio-9p : cleanup : init function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 54/61] virtio-9p-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 60/61] virtio : remove virtiobindings., fred . konrad, 2013/01/07
- Re: [Qemu-devel] [PATCH 00/61] Virtio refactoring., Anthony Liguori, 2013/01/07
- [Qemu-devel] [PATCH 44/61] virtio-rng.c : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 26/61] virtio-scsi : add the virtio-scsi device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 24/61] virtio-scsi : allocate cmd_vqs array separately., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 45/61] virtio-rng.c : cleanup : use QOM casts., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 39/61] virtio-rng : don't use pointer for configuration.,
fred . konrad <=
- Re: [Qemu-devel] [PATCH 00/61] Virtio refactoring., Michael S. Tsirkin, 2013/01/07
- [Qemu-devel] [PATCH 52/61] virtio-serial : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 28/61] virtio-scsi-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 38/61] virtio-rng : show the VirtIORNG structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 31/61] virtio-scsi : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 46/61] virtio-serial : show structures., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 37/61] virtio-balloon : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 27/61] virtio-scsi-pci : switch to new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 29/61] virtio-scsi : cleanup : use QOM casts., fred . konrad, 2013/01/07