All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, Anthony Liguori <aliguori@us.ibm.com>,
	Avi Kivity <avi@redhat.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] Re: [PATCH v4 2/5] qed: Add QEMU Enhanced Disk image format
Date: Fri, 12 Nov 2010 17:52:10 +0100	[thread overview]
Message-ID: <4CDD70BA.60504@redhat.com> (raw)
In-Reply-To: <AANLkTi=eRVsJ=mzeDFJ6FHOPuHPa+uLaLCJ8gE-DpBEM@mail.gmail.com>

Am 12.11.2010 17:34, schrieb Stefan Hajnoczi:
> On Fri, Nov 12, 2010 at 3:43 PM, Kevin Wolf <kwolf@redhat.com> wrote:
>> Am 28.10.2010 13:01, schrieb Stefan Hajnoczi:
>>> +/**
>>> + * Check whether an image format is raw
>>> + *
>>> + * @fmt:    Backing file format, may be NULL
>>> + */
>>> +static bool qed_fmt_is_raw(const char *fmt)
>>> +{
>>> +    return fmt && strcmp(fmt, "raw") == 0;
>>> +}
>>
>> People shouldn't use them directly, but should we also consider file,
>> host_device, etc.?
> 
> Hrm..I will look into it for v5.  I thought we always have a "raw"
> format on top of "file", "host_device", etc protocols?

That's how it's meant to be used. I think at the moment we still allow
to directly use file etc. and you know that if something is possible,
users will do it.

But instead of listing all of them here, maybe we should just make the
final step and return an error if they are used directly. Unfortunately,
that will bring us back to the discussion about formats and protocols... ;-)

>>> +    if (s->header.magic != QED_MAGIC) {
>>> +        return -ENOENT;
>>> +    }
>>
>> ENOENT seems a bit odd for a wrong magic number, especially if it's used
>> for the error message. Wouldn't EINVAL or ENOTSUP be a closer match?
> 
> You're right, ENOENT is confusing for the user.
> 
>>> +static void bdrv_qed_flush(BlockDriverState *bs)
>>> +{
>>> +    bdrv_flush(bs->file);
>>> +}
>>
>> This conflicts with one of my recent changes. bdrv_flush should return
>> an int now.
> 
> Will fix and will also check for bdrv_flush() failures.
> 
>>> +    while (options && options->name) {
>>> +        if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
>>> +            image_size = options->value.n;
>>> +        } else if (!strcmp(options->name, BLOCK_OPT_BACKING_FILE)) {
>>> +            backing_file = options->value.s;
>>> +        } else if (!strcmp(options->name, BLOCK_OPT_BACKING_FMT)) {
>>> +            backing_fmt = options->value.s;
>>
>> I'm not sure here. It doesn't really matter for QED, but I find it
>> strange that -o backing_fmt=foobar works and gives you a non-raw backing
>> file. Should we check if the format exists at least?
> 
> I see the same issue in QCOW2 so let's solve this generically in a
> separate patch.

Okay, that makes sense.

Kevin

  reply	other threads:[~2010-11-12 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28 11:01 [Qemu-devel] [PATCH v4 0/5] qed: Add QEMU Enhanced Disk format Stefan Hajnoczi
2010-10-28 11:01 ` [Qemu-devel] [PATCH v4 1/5] docs: Add QED image format specification Stefan Hajnoczi
2010-11-12 13:58   ` [Qemu-devel] " Kevin Wolf
2010-11-12 14:04     ` Stefan Hajnoczi
2010-10-28 11:01 ` [Qemu-devel] [PATCH v4 2/5] qed: Add QEMU Enhanced Disk image format Stefan Hajnoczi
2010-11-12 15:43   ` [Qemu-devel] " Kevin Wolf
2010-11-12 16:34     ` Stefan Hajnoczi
2010-11-12 16:52       ` Kevin Wolf [this message]
2010-11-12 17:24         ` Markus Armbruster
2010-11-12 17:34           ` Kevin Wolf
2010-10-28 11:01 ` [Qemu-devel] [PATCH v4 3/5] qed: Table, L2 cache, and cluster functions Stefan Hajnoczi
2010-11-12 17:26   ` [Qemu-devel] " Kevin Wolf
2010-11-12 17:40     ` Stefan Hajnoczi
2010-10-28 11:01 ` [Qemu-devel] [PATCH v4 4/5] qed: Read/write support Stefan Hajnoczi
2010-10-28 11:01 ` [Qemu-devel] [PATCH v4 5/5] qed: Consistency check support Stefan Hajnoczi

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=4CDD70BA.60504@redhat.com \
    --to=kwolf@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=hch@lst.de \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.