Patchwork [8/9] virtio-blk: change rq type to VirtIOBlockReq

login
register
mail settings
Submitter Juan Quintela
Date March 16, 2010, 6:51 p.m.
Message ID <39ca5a0927c83df683c20f60bed98de2143b6b39.1268765204.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/47898/
State New
Headers show

Comments

Juan Quintela - March 16, 2010, 6:51 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/virtio-blk.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
Michael S. Tsirkin - March 18, 2010, 7:27 a.m.
On Tue, Mar 16, 2010 at 07:51:24PM +0100, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/virtio-blk.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
> index 672a07b..c2ee27d 100644
> --- a/hw/virtio-blk.c
> +++ b/hw/virtio-blk.c
> @@ -19,17 +19,19 @@
>  # include <scsi/sg.h>
>  #endif
> 
> +typedef struct VirtIOBlockReq VirtIOBlockReq;
> +
>  typedef struct VirtIOBlock
>  {
>      VirtIODevice vdev;
>      BlockDriverState *bs;
>      VirtQueue *vq;
> -    void *rq;
> +    VirtIOBlockReq *rq;
>      QEMUBH *bh;
>      BlockConf *conf;
>  } VirtIOBlock;
> 
> -typedef struct VirtIOBlockReq
> +struct VirtIOBlockReq
>  {
>      VirtIOBlock *dev;
>      VirtQueueElement elem;
> @@ -38,7 +40,7 @@ typedef struct VirtIOBlockReq
>      struct virtio_scsi_inhdr *scsi;
>      QEMUIOVector qiov;
>      struct VirtIOBlockReq *next;
> -} VirtIOBlockReq;
> +};
> 
>  static void virtio_blk_req_complete(VirtIOBlockReq *req, int status)
>  {
> -- 
> 1.6.6.1
> 
>

Patch

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 672a07b..c2ee27d 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -19,17 +19,19 @@ 
 # include <scsi/sg.h>
 #endif

+typedef struct VirtIOBlockReq VirtIOBlockReq;
+
 typedef struct VirtIOBlock
 {
     VirtIODevice vdev;
     BlockDriverState *bs;
     VirtQueue *vq;
-    void *rq;
+    VirtIOBlockReq *rq;
     QEMUBH *bh;
     BlockConf *conf;
 } VirtIOBlock;

-typedef struct VirtIOBlockReq
+struct VirtIOBlockReq
 {
     VirtIOBlock *dev;
     VirtQueueElement elem;
@@ -38,7 +40,7 @@  typedef struct VirtIOBlockReq
     struct virtio_scsi_inhdr *scsi;
     QEMUIOVector qiov;
     struct VirtIOBlockReq *next;
-} VirtIOBlockReq;
+};

 static void virtio_blk_req_complete(VirtIOBlockReq *req, int status)
 {