diff mbox

[V5,02/13] block: add bdrv_get_filename() function

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

Commit Message

Wayne Xia Jan. 24, 2013, 2:57 a.m. UTC
This function will simply return the uri or filename used
to open the image.

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

Comments

Kevin Wolf Jan. 29, 2013, 12:53 p.m. UTC | #1
Am 24.01.2013 03:57, schrieb Wenchao Xia:
>   This function will simply return the uri or filename used
> to open the image.
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>

The only user of this function in the series is in block.c and could
have called it without making it public.

Kevin
Wayne Xia Jan. 31, 2013, 8:58 a.m. UTC | #2
于 2013-1-29 20:53, Kevin Wolf 写道:
> Am 24.01.2013 03:57, schrieb Wenchao Xia:
>>    This function will simply return the uri or filename used
>> to open the image.
>>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
>
> The only user of this function in the series is in block.c and could
> have called it without making it public.
>
> Kevin
>

OK.
diff mbox

Patch

diff --git a/block.c b/block.c
index 6fa7c90..a86257d 100644
--- a/block.c
+++ b/block.c
@@ -2963,6 +2963,11 @@  BlockStatsList *qmp_query_blockstats(Error **errp)
     return head;
 }
 
+const char *bdrv_get_filename(const BlockDriverState *bs)
+{
+    return bs->filename;
+}
+
 const char *bdrv_get_encrypted_filename(BlockDriverState *bs)
 {
     if (bs->backing_hd && bs->backing_hd->encrypted)
diff --git a/include/block/block.h b/include/block/block.h
index ffd1936..0b84e9b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -310,6 +310,7 @@  int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
                           const uint8_t *buf, int nb_sectors);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
 
+const char *bdrv_get_filename(const BlockDriverState *bs);
 const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);