diff mbox

[V5,07/13] block: rename bdrv_query_info to bdrv_query_block_info

Message ID 1358996283-32441-8-git-send-email-xiawenc@linux.vnet.ibm.com
State New
Headers show

Commit Message

Wayne Xia Jan. 24, 2013, 2:57 a.m. UTC
Now that we have bdrv_query_image_info, rename this function to make it
more obvious what it is doing.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 block.c               |    4 ++--
 include/block/block.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Kevin Wolf Jan. 29, 2013, 1:04 p.m. UTC | #1
Am 24.01.2013 03:57, schrieb Wenchao Xia:
>   Now that we have bdrv_query_image_info, rename this function to make it
> more obvious what it is doing.
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>

Should this provide an option to give information on each image in the
backing file chain, as well as the BlockDriverStates stacked via bs->file?

Kevin
Kevin Wolf Jan. 29, 2013, 1:05 p.m. UTC | #2
Am 29.01.2013 14:04, schrieb Kevin Wolf:
> Am 24.01.2013 03:57, schrieb Wenchao Xia:
>>   Now that we have bdrv_query_image_info, rename this function to make it
>> more obvious what it is doing.
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
> 
> Should this provide an option to give information on each image in the
> backing file chain, as well as the BlockDriverStates stacked via bs->file?

Sorry, this was meant as a reply to patch 8.

Kevin
Wayne Xia Jan. 31, 2013, 9:15 a.m. UTC | #3
于 2013-1-29 21:05, Kevin Wolf 写道:
> Am 29.01.2013 14:04, schrieb Kevin Wolf:
>> Am 24.01.2013 03:57, schrieb Wenchao Xia:
>>>    Now that we have bdrv_query_image_info, rename this function to make it
>>> more obvious what it is doing.
>>>
>>> Reviewed-by: Eric Blake <eblake@redhat.com>
>>> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
>>
>> Should this provide an option to give information on each image in the
>> backing file chain, as well as the BlockDriverStates stacked via bs->file?
>
> Sorry, this was meant as a reply to patch 8.
>
> Kevin
>
   I think so, how about:
# @query-images:
#
# Get a list of DeviceImageInfo for all virtual block devices.
#
# Returns: a list of @DeviceImageInfo describing each virtual block device
#
# Since: 1.4
##
{ 'command': 'query-images',
    'data': { '*all': 'bool' },
    'returns': ['DeviceImageInfo'] }
diff mbox

Patch

diff --git a/block.c b/block.c
index 14bf653..082237b 100644
--- a/block.c
+++ b/block.c
@@ -2975,7 +2975,7 @@  ImageInfo *bdrv_query_image_info(BlockDriverState *bs, Error **errp)
     return info;
 }
 
-BlockInfo *bdrv_query_info(BlockDriverState *bs)
+BlockInfo *bdrv_query_block_info(BlockDriverState *bs)
 {
     BlockInfo *info = g_malloc0(sizeof(*info));
     info->device = g_strdup(bs->device_name);
@@ -3041,7 +3041,7 @@  BlockInfoList *qmp_query_block(Error **errp)
 
     QTAILQ_FOREACH(bs, &bdrv_states, list) {
         BlockInfoList *info = g_malloc0(sizeof(*info));
-        info->value = bdrv_query_info(bs);
+        info->value = bdrv_query_block_info(bs);
 
         *p_next = info;
         p_next = &info->next;
diff --git a/include/block/block.h b/include/block/block.h
index b6f80c3..9838c48 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -324,7 +324,7 @@  SnapshotInfoList *bdrv_query_snapshot_infolist(BlockDriverState *bs,
                                                void *opaque,
                                                Error **errp);
 ImageInfo *bdrv_query_image_info(BlockDriverState *bs, Error **errp);
-BlockInfo *bdrv_query_info(BlockDriverState *s);
+BlockInfo *bdrv_query_block_info(BlockDriverState *bs);
 BlockStats *bdrv_query_stats(const BlockDriverState *bs);
 int bdrv_can_read_snapshot(BlockDriverState *bs);
 int bdrv_can_snapshot(BlockDriverState *bs);