* [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend
@ 2013-09-09 10:17 Max Reitz
2013-10-02 12:32 ` Stefan Hajnoczi
0 siblings, 1 reply; 3+ messages in thread
From: Max Reitz @ 2013-09-09 10:17 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Max Reitz
When amending the size option for a qcow2 image, use bdrv_truncate
instead of qcow2_truncate directly, since the latter will not adjust the
total_sectors count in the BDS structure (whereas the former will).
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
Depends on (follow-up to):
- block/qcow2: Image file option amendment (series, v5)
---
block/qcow2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index d29547b..259edfd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1997,7 +1997,7 @@ static int qcow2_amend_options(BlockDriverState *bs,
}
if (new_size) {
- ret = qcow2_truncate(bs, new_size);
+ ret = bdrv_truncate(bs, new_size);
if (ret < 0) {
return ret;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend
2013-09-09 10:17 [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend Max Reitz
@ 2013-10-02 12:32 ` Stefan Hajnoczi
2013-10-02 12:44 ` Max Reitz
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-10-02 12:32 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On Mon, Sep 09, 2013 at 12:17:41PM +0200, Max Reitz wrote:
> When amending the size option for a qcow2 image, use bdrv_truncate
> instead of qcow2_truncate directly, since the latter will not adjust the
> total_sectors count in the BDS structure (whereas the former will).
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> Depends on (follow-up to):
> - block/qcow2: Image file option amendment (series, v5)
> ---
> block/qcow2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index d29547b..259edfd 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1997,7 +1997,7 @@ static int qcow2_amend_options(BlockDriverState *bs,
> }
>
> if (new_size) {
> - ret = qcow2_truncate(bs, new_size);
> + ret = bdrv_truncate(bs, new_size);
> if (ret < 0) {
> return ret;
> }
It seems this patch was already squashed into
9296b3ed7050cc6e0645fbc3b0aea74406d7eeb2 ("qcow2: Implement
bdrv_amend_options").
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend
2013-10-02 12:32 ` Stefan Hajnoczi
@ 2013-10-02 12:44 ` Max Reitz
0 siblings, 0 replies; 3+ messages in thread
From: Max Reitz @ 2013-10-02 12:44 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi
On 2013-10-02 14:32, Stefan Hajnoczi wrote:
> On Mon, Sep 09, 2013 at 12:17:41PM +0200, Max Reitz wrote:
>> When amending the size option for a qcow2 image, use bdrv_truncate
>> instead of qcow2_truncate directly, since the latter will not adjust the
>> total_sectors count in the BDS structure (whereas the former will).
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>> Depends on (follow-up to):
>> - block/qcow2: Image file option amendment (series, v5)
>> ---
>> block/qcow2.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/qcow2.c b/block/qcow2.c
>> index d29547b..259edfd 100644
>> --- a/block/qcow2.c
>> +++ b/block/qcow2.c
>> @@ -1997,7 +1997,7 @@ static int qcow2_amend_options(BlockDriverState *bs,
>> }
>>
>> if (new_size) {
>> - ret = qcow2_truncate(bs, new_size);
>> + ret = bdrv_truncate(bs, new_size);
>> if (ret < 0) {
>> return ret;
>> }
> It seems this patch was already squashed into
> 9296b3ed7050cc6e0645fbc3b0aea74406d7eeb2 ("qcow2: Implement
> bdrv_amend_options").
Yes, as Kevin stated in his reply to that series:
> Thanks, applied to the block branch with the following changes:
>
> - Updated patch 5 with
> [PATCH] block/qcow2: Use bdrv_truncate for size amend
Max
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-02 12:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 10:17 [Qemu-devel] [PATCH] block/qcow2: Use bdrv_truncate for size amend Max Reitz
2013-10-02 12:32 ` Stefan Hajnoczi
2013-10-02 12:44 ` Max Reitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).