[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/61] virtio-blk : don't use pointer for configurat
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 09/61] virtio-blk : don't use pointer for configuration. |
Date: |
Mon, 7 Jan 2013 19:40:22 +0100 |
From: KONRAD Frederic <address@hidden>
The configuration field must not be a pointer as it will be used for virtio-blk
properties. So *blk is replaced by blk in VirtIOBlock structure.
Signed-off-by: KONRAD Frederic <address@hidden>
---
hw/virtio-blk.c | 8 ++++----
hw/virtio-blk.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 38a53e9..93a52b5 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -154,7 +154,7 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
*/
req->scsi = (void *)req->elem.in_sg[req->elem.in_num - 2].iov_base;
- if (!req->dev->blk->scsi) {
+ if (!req->dev->blk.scsi) {
status = VIRTIO_BLK_S_UNSUPP;
goto fail;
}
@@ -374,7 +374,7 @@ static void virtio_blk_handle_request(VirtIOBlockReq *req,
* terminated by '\0' only when shorter than buffer.
*/
strncpy(req->elem.in_sg[0].iov_base,
- s->blk->serial ? s->blk->serial : "",
+ s->blk.serial ? s->blk.serial : "",
MIN(req->elem.in_sg[0].iov_len, VIRTIO_BLK_ID_BYTES));
virtio_blk_req_complete(req, VIRTIO_BLK_S_OK);
g_free(req);
@@ -537,7 +537,7 @@ static uint32_t virtio_blk_get_features(VirtIODevice *vdev,
uint32_t features)
features |= (1 << VIRTIO_BLK_F_BLK_SIZE);
features |= (1 << VIRTIO_BLK_F_SCSI);
- if (s->blk->config_wce) {
+ if (s->blk.config_wce) {
features |= (1 << VIRTIO_BLK_F_CONFIG_WCE);
}
if (bdrv_enable_write_cache(s->bs))
@@ -652,7 +652,7 @@ VirtIODevice *virtio_blk_init(DeviceState *dev,
VirtIOBlkConf *blk)
s->vdev.reset = virtio_blk_reset;
s->bs = blk->conf.bs;
s->conf = &blk->conf;
- s->blk = blk;
+ memcpy(&(s->blk), blk, sizeof(struct VirtIOBlkConf));
s->rq = NULL;
s->sector_mask = (s->conf->logical_block_size / BDRV_SECTOR_SIZE) - 1;
diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h
index 2a7aef2..df07419 100644
--- a/hw/virtio-blk.h
+++ b/hw/virtio-blk.h
@@ -115,7 +115,7 @@ typedef struct VirtIOBlock {
void *rq;
QEMUBH *bh;
BlockConf *conf;
- VirtIOBlkConf *blk;
+ VirtIOBlkConf blk;
unsigned short sector_mask;
DeviceState *qdev;
#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
--
1.7.11.7
- [Qemu-devel] [PATCH 00/61] Virtio refactoring., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 01/61] qdev : add a maximum device allowed field for the bus., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 03/61] virtio-pci-bus : introduce virtio-pci-bus., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 02/61] virtio-bus : introduce virtio-bus, fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 04/61] virtio-pci : refactor virtio-pci device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 06/61] virtio-s390-bus : add virtio-s390-bus., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 05/61] virtio-device : refactor virtio-device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 07/61] virtio-s390-device : create a virtio-s390-bus during init., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 08/61] virtio-blk : show VirtIOBlock structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 09/61] virtio-blk : don't use pointer for configuration.,
fred . konrad <=
- [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