qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Qemu-img convert with -B
@ 2011-04-27  3:05 Brad Campbell
  2011-04-27  8:10 ` Stefan Hajnoczi
  0 siblings, 1 reply; 10+ messages in thread
From: Brad Campbell @ 2011-04-27  3:05 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-04-28 10:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27  3:05 [Qemu-devel] Qemu-img convert with -B Brad Campbell
2011-04-27  8:10 ` Stefan Hajnoczi
2011-04-27  8:56   ` Brad Campbell
2011-04-27 10:06     ` Kevin Wolf
2011-04-27 13:45       ` Brad Campbell
2011-04-27 13:56         ` Kevin Wolf
2011-04-27 14:02           ` Brad Campbell
2011-04-28  2:06             ` Brad Campbell
2011-04-28  6:36               ` Kevin Wolf
2011-04-28  9:38                 ` Brad Campbell

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).