[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return false for copy-on-write-images |
Date: |
Fri, 19 Jul 2013 07:21:05 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
On 07/16/2013 10:29 AM, Paolo Bonzini wrote:
> This helps implementing is_allocated on top of get_block_status.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block.c | 5 +++++
> qemu-img.c | 9 +--------
> 2 files changed, 6 insertions(+), 8 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
> +++ b/block.c
> @@ -2934,6 +2934,11 @@ int bdrv_has_zero_init(BlockDriverState *bs)
> {
> assert(bs->drv);
>
> + /* If BS is a copy on write image, it is initialized to
> + the contents of the base image, which may not be zeroes. */
> + if (bs->backing_hd) {
> + return 0;
Question (more for my understanding, not that you need to change code):
must we blindly return 0 in the presence of a backing file, or is it
possible to recursively query the backing_hd's zero_init status,
allowing us to return 1 iff all files in the chain support zero_init.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/17] Add qemu-img subcommand to dump file metadata, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 01/17] cow: make reads go at a decent speed, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 02/17] cow: make writes go at a less indecent speed, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 03/17] cow: do not call bdrv_co_is_allocated, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 04/17] block: make bdrv_co_is_allocated static, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return false for copy-on-write-images, Paolo Bonzini, 2013/07/16
- Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return false for copy-on-write-images,
Eric Blake <=
- [Qemu-devel] [PATCH v2 09/17] block: introduce bdrv_get_block_status API, Paolo Bonzini, 2013/07/16
- [Qemu-devel] [PATCH v2 10/17] block: define get_block_status return value, Paolo Bonzini, 2013/07/16