[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 24/61] virtio-scsi : allocate cmd_vqs array separate
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 24/61] virtio-scsi : allocate cmd_vqs array separately. |
Date: |
Mon, 7 Jan 2013 19:40:37 +0100 |
From: KONRAD Frederic <address@hidden>
Allocate/Free the cmd_vqs array separately to have a fixed size device.
Signed-off-by: KONRAD Frederic <address@hidden>
---
hw/virtio-scsi.c | 6 +++---
hw/virtio-scsi.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 1bd689c..7b922ab 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -685,12 +685,12 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev,
VirtIOSCSIConf *proxyconf)
{
VirtIOSCSI *s;
static int virtio_scsi_id;
- size_t sz;
int i;
- sz = sizeof(VirtIOSCSI) + proxyconf->num_queues * sizeof(VirtQueue *);
s = (VirtIOSCSI *)virtio_common_init("virtio-scsi", VIRTIO_ID_SCSI,
- sizeof(VirtIOSCSIConfig), sz);
+ sizeof(VirtIOSCSIConfig),
+ sizeof(VirtIOSCSI));
+ s->cmd_vqs = g_malloc0(proxyconf->num_queues * sizeof(VirtQueue *));
s->qdev = dev;
memcpy(&(s->conf), proxyconf, sizeof(struct VirtIOSCSIConf));
diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h
index 6e027be..c659ba1 100644
--- a/hw/virtio-scsi.h
+++ b/hw/virtio-scsi.h
@@ -44,7 +44,7 @@ typedef struct {
bool events_dropped;
VirtQueue *ctrl_vq;
VirtQueue *event_vq;
- VirtQueue *cmd_vqs[0];
+ VirtQueue **cmd_vqs;
} VirtIOSCSI;
#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _features_field, _conf_field) \
--
1.7.11.7
- [Qemu-devel] [PATCH 22/61] virtio-scsi : show the VirtIOSCSI structure., (continued)
- [Qemu-devel] [PATCH 22/61] virtio-scsi : show the VirtIOSCSI structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 58/61] virtio-pci : cleanup : init, exit and reset functions., fred . konrad, 2013/01/07
- [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 <=
- [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, 2013/01/07
- 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