Re: [Qemu-block] [PATCH v8 02/15] block: Make bdrv_states public

2015-10-27 Thread Alberto Garcia
On Mon 26 Oct 2015 09:39:06 PM CET, Max Reitz wrote:
> When inserting a BDS tree into a BB, we will need to add the root BDS to
> this list. Since we will want to do that in the blockdev-insert-medium
> implementation in blockdev.c, we will need access to it there.
>
> This patch is not exactly elegant, but bdrv_states will be removed in
> the future anyway because we no longer need it since we have BBs.
>
> Signed-off-by: Max Reitz 
Reviewed-by: Alberto Garcia 

Berto



[Qemu-block] [PATCH v8 02/15] block: Make bdrv_states public

2015-10-26 Thread Max Reitz
When inserting a BDS tree into a BB, we will need to add the root BDS to
this list. Since we will want to do that in the blockdev-insert-medium
implementation in blockdev.c, we will need access to it there.

This patch is not exactly elegant, but bdrv_states will be removed in
the future anyway because we no longer need it since we have BBs.

Signed-off-by: Max Reitz 
---
 block.c   | 3 +--
 include/block/block_int.h | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index e9f40dc..71d5474 100644
--- a/block.c
+++ b/block.c
@@ -73,8 +73,7 @@ struct BdrvDirtyBitmap {
 
 #define NOT_DONE 0x7fff /* used while emulated sync operation in progress 
*/
 
-static QTAILQ_HEAD(, BlockDriverState) bdrv_states =
-QTAILQ_HEAD_INITIALIZER(bdrv_states);
+struct BdrvStates bdrv_states = QTAILQ_HEAD_INITIALIZER(bdrv_states);
 
 static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states =
 QTAILQ_HEAD_INITIALIZER(graph_bdrv_states);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 3ceeb5a..6a3f64d 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -473,6 +473,8 @@ extern BlockDriver bdrv_file;
 extern BlockDriver bdrv_raw;
 extern BlockDriver bdrv_qcow2;
 
+extern QTAILQ_HEAD(BdrvStates, BlockDriverState) bdrv_states;
+
 /**
  * bdrv_setup_io_funcs:
  *
-- 
2.6.2