qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Jes.Sorensen@redhat.com
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <AANLkTikLhAtCw2bYqtwYXFOCsHseWc3DZWXbyW55TxAd@mail.gmail.com> (raw)
In-Reply-To: <1291743586-3518-1-git-send-email-Jes.Sorensen@redhat.com>

On Tue, Dec 7, 2010 at 5:39 PM,  <Jes.Sorensen@redhat.com> 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	other threads:[~2010-12-07 20:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 17:39 [Qemu-devel] [PATCH 1/1] qemu-img.c: Clean up handling of image size in img_create() Jes.Sorensen
2010-12-07 20:36 ` Stefan Hajnoczi [this message]
2010-12-08  6:30   ` Jes Sorensen
2010-12-08  8:54   ` Kevin Wolf
2010-12-08  9:14     ` Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikLhAtCw2bYqtwYXFOCsHseWc3DZWXbyW55TxAd@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).