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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create()
Date: Tue, 7 Dec 2010 20:36:47 +0000

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 don't think 0 sized images are very useful, but I'm not sure we
should make this change.

Stefan



reply via email to

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