qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: return allocated size fo


From: 叶残风
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-img: return allocated size for block device with qcow2 format
Date: Thu, 03 May 2018 13:06:31 +0000


Thanks for your review, Eric.
Yes, the wr_highest_offset can tell the end offset at runtime, and 
write_threshold similar to it. But in my situation, I need to know 
the allocated end without a vm running.

Eric Blake <address@hidden> 于2018年5月2日周三 下午10:02写道:
On 05/02/2018 08:34 AM, Ivan Ren wrote:
> qemu-img info with a block device which has a qcow2 format always
> return 0 for disk size, and this can not reflect the qcow2 size
> and the used space of the block device. This patch return the
> allocated size of qcow2 as the disk size.

How does this differ from what qemu can already give you at runtime via
the wr_highest_offset property in BlockDeviceStats, and related to the
write_threshold ('block-set-write-threshold command,
BLOCK_WRITE_THRESHOLD event)?  Is there any code we can reuse, rather
than writing something from scratch?

>
> Signed-off-by: Ivan Ren <address@hidden>
> ---
>   block/qcow2-bitmap.c |  69 +++++++++++++++++
>   block/qcow2.c        | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++
>   block/qcow2.h        |  42 ++++++++++
>   3 files changed, 323 insertions(+)
>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]