Patchwork [V3,02/11] block: add bdrv_get_filename() function

login
register
mail settings
Submitter Wayne Xia
Date Jan. 14, 2013, 7:09 a.m.
Message ID <1358147387-8221-3-git-send-email-xiawenc@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/211714/
State New
Headers show

Comments

Wayne Xia - Jan. 14, 2013, 7:09 a.m.
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(-)
Luiz Capitulino - Jan. 14, 2013, 5:08 p.m.
On Mon, 14 Jan 2013 15:09:38 +0800
Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:

>   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(-)
> 
> diff --git a/block.c b/block.c
> index 4e28c55..5f95da5 100644
> --- a/block.c
> +++ b/block.c
> @@ -2967,6 +2967,11 @@ BlockStatsList *qmp_query_blockstats(Error **errp)
>      return head;
>  }
>  
> +const char *bdrv_get_filename(BlockDriverState *bs)
> +{

bs can be const.

> +    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 0719339..a0fc2a6 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(BlockDriverState *bs);
>  const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
>  void bdrv_get_backing_filename(BlockDriverState *bs,
>                                 char *filename, int filename_size);
Wayne Xia - Jan. 15, 2013, 7:30 a.m.
于 2013-1-15 1:08, Luiz Capitulino 写道:
> On Mon, 14 Jan 2013 15:09:38 +0800
> Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:
>
>>    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(-)
>>
>> diff --git a/block.c b/block.c
>> index 4e28c55..5f95da5 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -2967,6 +2967,11 @@ BlockStatsList *qmp_query_blockstats(Error **errp)
>>       return head;
>>   }
>>
>> +const char *bdrv_get_filename(BlockDriverState *bs)
>> +{
>
> bs can be const.
>
OK.
Shijesta Victor - Jan. 15, 2013, 8:40 a.m.
I am trying to use QEMU to print the virtual and physical addresses of all memory accesses for target-arm. I can see the addresses being computed, but they pass IS_USER(s) as an index to routines like gen_ld8s etc, Can you please explain what this does?
Any help is appreciated; thanks in advance!

regards,

shijesta

--- On Tue, 15/1/13, Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:

From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH V3 02/11] block: add bdrv_get_filename() function
To: "Luiz Capitulino" <lcapitulino@redhat.com>
Cc: aliguori@us.ibm.com, phrdina@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com
Date: Tuesday, 15 January, 2013, 13:00

于 2013-1-15 1:08, Luiz Capitulino 写道:
> On Mon, 14 Jan 2013 15:09:38 +0800
> Wenchao Xia <xiawenc@linux.vnet.ibm.com> wrote:
>
>>    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(-)
>>
>> diff --git a/block.c b/block.c
>> index 4e28c55..5f95da5 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -2967,6 +2967,11 @@ BlockStatsList *qmp_query_blockstats(Error **errp)
>>       return head;
>>   }
>>
>> +const char *bdrv_get_filename(BlockDriverState *bs)
>> +{
>
> bs can be const.
>
OK.

Patch

diff --git a/block.c b/block.c
index 4e28c55..5f95da5 100644
--- a/block.c
+++ b/block.c
@@ -2967,6 +2967,11 @@  BlockStatsList *qmp_query_blockstats(Error **errp)
     return head;
 }
 
+const char *bdrv_get_filename(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 0719339..a0fc2a6 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(BlockDriverState *bs);
 const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);