From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35774 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQFlo-000649-3e for qemu-devel@nongnu.org; Wed, 08 Dec 2010 03:53:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQFln-0001sl-3k for qemu-devel@nongnu.org; Wed, 08 Dec 2010 03:53:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQFlm-0001sM-SN for qemu-devel@nongnu.org; Wed, 08 Dec 2010 03:53:03 -0500 Message-ID: <4CFF47B0.1030906@redhat.com> Date: Wed, 08 Dec 2010 09:54:08 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create() References: <1291743586-3518-1-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Jes.Sorensen@redhat.com, qemu-devel@nongnu.org Am 07.12.2010 21:36, schrieb Stefan Hajnoczi: > On Tue, Dec 7, 2010 at 5:39 PM, 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