[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/61] virtio-scsi : don't use pointer for configura
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 23/61] virtio-scsi : don't use pointer for configuration. |
Date: |
Mon, 7 Jan 2013 19:40:36 +0100 |
From: KONRAD Frederic <address@hidden>
The configuration field must not be a pointer as it will be used for virtio-scsi
properties. So *conf is replaced by conf.
Signed-off-by: KONRAD Frederic <address@hidden>
---
hw/virtio-scsi.c | 14 +++++++-------
hw/virtio-scsi.h | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 4e2d884..1bd689c 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -236,7 +236,7 @@ static void virtio_scsi_save_request(QEMUFile *f,
SCSIRequest *sreq)
VirtIOSCSIReq *req = sreq->hba_private;
uint32_t n = virtio_queue_get_id(req->vq) - 2;
- assert(n < req->dev->conf->num_queues);
+ assert(n < req->dev->conf.num_queues);
qemu_put_be32s(f, &n);
qemu_put_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
}
@@ -250,7 +250,7 @@ static void *virtio_scsi_load_request(QEMUFile *f,
SCSIRequest *sreq)
req = g_malloc(sizeof(*req));
qemu_get_be32s(f, &n);
- assert(n < s->conf->num_queues);
+ assert(n < s->conf.num_queues);
qemu_get_buffer(f, (unsigned char *)&req->elem, sizeof(req->elem));
virtio_scsi_parse_req(s, s->cmd_vqs[n], req);
@@ -512,10 +512,10 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,
VirtIOSCSIConfig *scsiconf = (VirtIOSCSIConfig *)config;
VirtIOSCSI *s = (VirtIOSCSI *)vdev;
- stl_raw(&scsiconf->num_queues, s->conf->num_queues);
+ stl_raw(&scsiconf->num_queues, s->conf.num_queues);
stl_raw(&scsiconf->seg_max, 128 - 2);
- stl_raw(&scsiconf->max_sectors, s->conf->max_sectors);
- stl_raw(&scsiconf->cmd_per_lun, s->conf->cmd_per_lun);
+ stl_raw(&scsiconf->max_sectors, s->conf.max_sectors);
+ stl_raw(&scsiconf->cmd_per_lun, s->conf.cmd_per_lun);
stl_raw(&scsiconf->event_info_size, sizeof(VirtIOSCSIEvent));
stl_raw(&scsiconf->sense_size, s->sense_size);
stl_raw(&scsiconf->cdb_size, s->cdb_size);
@@ -693,7 +693,7 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev,
VirtIOSCSIConf *proxyconf)
sizeof(VirtIOSCSIConfig), sz);
s->qdev = dev;
- s->conf = proxyconf;
+ memcpy(&(s->conf), proxyconf, sizeof(struct VirtIOSCSIConf));
/* TODO set up vdev function pointers */
s->vdev.get_config = virtio_scsi_get_config;
@@ -705,7 +705,7 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev,
VirtIOSCSIConf *proxyconf)
virtio_scsi_handle_ctrl);
s->event_vq = virtio_add_queue(&s->vdev, VIRTIO_SCSI_VQ_SIZE,
virtio_scsi_handle_event);
- for (i = 0; i < s->conf->num_queues; i++) {
+ for (i = 0; i < s->conf.num_queues; i++) {
s->cmd_vqs[i] = virtio_add_queue(&s->vdev, VIRTIO_SCSI_VQ_SIZE,
virtio_scsi_handle_cmd);
}
diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h
index 38b9c0f..6e027be 100644
--- a/hw/virtio-scsi.h
+++ b/hw/virtio-scsi.h
@@ -35,7 +35,7 @@ struct VirtIOSCSIConf {
typedef struct {
VirtIODevice vdev;
DeviceState *qdev;
- VirtIOSCSIConf *conf;
+ VirtIOSCSIConf conf;
SCSIBus bus;
uint32_t sense_size;
--
1.7.11.7
- [Qemu-devel] [PATCH 10/61] virtio-blk : add the virtio-blk device., (continued)
- [Qemu-devel] [PATCH 10/61] virtio-blk : add the virtio-blk device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 12/61] virtio-blk-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 11/61] virtio-blk-pci : switch to new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 14/61] virtio-blk : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 16/61] virtio-net : add the virtio-net device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 17/61] virtio-net-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 13/61] virtio-blk : cleanup : use QOM cast., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 20/61] virtio-net : cleanup : init and exit function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 18/61] virtio-net-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 23/61] virtio-scsi : don't use pointer for configuration.,
fred . konrad <=
- [Qemu-devel] [PATCH 21/61] virtio-net : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 30/61] virtio-scsi : cleanup : init and exit functions., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 33/61] virtio-balloon : add the virtio-balloon device., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 34/61] virtio-balloon-pci : switch to the new API., fred . konrad, 2013/01/07
[Qemu-devel] [PATCH 32/61] virtio-balloon : show the VirtIOBalloon structure., fred . konrad, 2013/01/07