qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create()
Date: Wed, 08 Dec 2010 09:54:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10

Am 07.12.2010 21:36, schrieb Stefan Hajnoczi:
> On Tue, Dec 7, 2010 at 5:39 PM,  <address@hidden> wrote:
>>     // The size for the image must always be specified, with one exception:
>>     // If we are using a backing file, we can obtain the size from there
>> -    if (get_option_parameter(param, BLOCK_OPT_SIZE)->value.n == -1) {
>> -
>> +    if (get_option_parameter(param, BLOCK_OPT_SIZE)->value.n == 0) {
>>         QEMUOptionParameter *backing_file =
>>             get_option_parameter(param, BLOCK_OPT_BACKING_FILE);
>>         QEMUOptionParameter *backing_fmt =
> 
> Today it is possible to create 0 byte sized images.  Your patch will
> change that:
> If there is a backing file, then the size will be taken from the backing file.
> If there is no backing file, then an error about missing size will be
> printed, even though a size of 0 has been given.

I can think of one use case for it: You can store the VM state on a
zero-sized qcow2 image for internal snapshots.

Otherwise it's probably rather useless, but we have supported it for a
long time, so I wouldn't remove it. People have actually noticed in the
past when something was broken with it.

Kevin



reply via email to

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