Patchwork [08/61] virtio-blk : show VirtIOBlock structure.

login
register
mail settings
Submitter fred.konrad@greensocs.com
Date Jan. 7, 2013, 6:40 p.m.
Message ID <1357584074-10852-9-git-send-email-fred.konrad@greensocs.com>
Download mbox | patch
Permalink /patch/210077/
State New
Headers show

Comments

fred.konrad@greensocs.com - Jan. 7, 2013, 6:40 p.m.
From: KONRAD Frederic <fred.konrad@greensocs.com>

As we discuss with anthony and andreas, this structure must be showed to avoid
two memory allocations for virtio-blk-x.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
 hw/virtio-blk.c | 16 ----------------
 hw/virtio-blk.h | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 16 deletions(-)
Peter Maydell - Jan. 8, 2013, 4:18 p.m.
On 7 January 2013 18:40,  <fred.konrad@greensocs.com> wrote:
> virtio-blk : show VirtIOBlock structure.

If this survives as a separate patch then this should read
"virtio-blk: make VirtIOBlock structure public"

> As we discuss with anthony and andreas, this structure must be showed to avoid
> two memory allocations for virtio-blk-x.

I don't really like chatty references to mailing list discussions in
commit messages; commit messages should just confidently
say what/why they're making the change. You can always put
in remarks below the '---' line if you want to remind reviewers of
earlier discussion. Similarly, you don't need to say "must be
committed after patches X and Y" in the commit message proper --
as a git commit the order is inherent.

-- PMM

Patch

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index df57b35..38a53e9 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -25,22 +25,6 @@ 
 # include <scsi/sg.h>
 #endif
 
-typedef struct VirtIOBlock
-{
-    VirtIODevice vdev;
-    BlockDriverState *bs;
-    VirtQueue *vq;
-    void *rq;
-    QEMUBH *bh;
-    BlockConf *conf;
-    VirtIOBlkConf *blk;
-    unsigned short sector_mask;
-    DeviceState *qdev;
-#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
-    VirtIOBlockDataPlane *dataplane;
-#endif
-} VirtIOBlock;
-
 static VirtIOBlock *to_virtio_blk(VirtIODevice *vdev)
 {
     return (VirtIOBlock *)vdev;
diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h
index 43ca492..2a7aef2 100644
--- a/hw/virtio-blk.h
+++ b/hw/virtio-blk.h
@@ -108,6 +108,21 @@  struct VirtIOBlkConf
     uint32_t data_plane;
 };
 
+typedef struct VirtIOBlock {
+    VirtIODevice vdev;
+    BlockDriverState *bs;
+    VirtQueue *vq;
+    void *rq;
+    QEMUBH *bh;
+    BlockConf *conf;
+    VirtIOBlkConf *blk;
+    unsigned short sector_mask;
+    DeviceState *qdev;
+#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
+    VirtIOBlockDataPlane *dataplane;
+#endif
+} VirtIOBlock;
+
 #define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \
         DEFINE_VIRTIO_COMMON_FEATURES(_state, _field)