qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Qemu-img convert with -B


From: Brad Campbell
Subject: [Qemu-devel] Qemu-img convert with -B
Date: Wed, 27 Apr 2011 11:05:48 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

G'day all,

I see there is a bug raised about the behaviour of qemu-img when used to convert using an output backing file. It allocates every sector whether or not it already exists in the output backing file.

I'm walking my way through the block driver to try and get a handle on why this is the case.

The comment in qemu-img.c is :

/* If the output image is being created as a copy on write image, copy all sectors even the ones containing only NUL bytes, because they may differ from the sectors in the base image.

Can someone verify these assumptions for me please?
- I can bdrv_open() a file that has a chain of backing files, and the following is true :
        - bdrv_read() returns the most recently allocated sector contents (or 0)
- bdrv_is_allocated() will return false only if that sector is not allocated in _any_ of the files in the chain

If these assumptions are true, can anyone see a logical error in bdrv_open() both the input file and the out_baseimg, and where sectors are allocated comparing them to see if the are the same. If so, not allocating those in the output file?

I'm assuming the comment above is to allow for the case that someone specifies the output backing file being different from the last input backing file.

Am I missing something?

Regards,
Brad



reply via email to

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