Am 07.12.2010 21:36, schrieb Stefan Hajnoczi: > On Tue, Dec 7, 2010 at 5:39 PM, <[email protected]> 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
