All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Peter Lieven <pl@kamp.de>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 01/12] block: qcow2 driver may not be found
Date: Wed, 26 Nov 2014 10:13:05 +0100	[thread overview]
Message-ID: <547599A1.5080100@redhat.com> (raw)
In-Reply-To: <87h9xm4e8u.fsf@blackfin.pond.sub.org>

On 2014-11-26 at 08:23, Markus Armbruster wrote:
> Max Reitz <mreitz@redhat.com> writes:
>
>> Albeit absolutely impossible right now, bdrv_find_format("qcow2") may
>> fail. bdrv_append_temp_snapshot() should heed that case.
> Impossible because we always compile in bdrv_qcow2.

Right now we do, right.

>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>>   block.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/block.c b/block.c
>> index 866c8b4..b31fb67 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -1320,6 +1320,12 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
>>       }
>>   
>>       bdrv_qcow2 = bdrv_find_format("qcow2");
>> +    if (!bdrv_qcow2) {
>> +        error_setg(errp, "Failed to locate qcow2 driver");
>> +        ret = -ENOENT;
>> +        goto out;
>> +    }
>> +
>>       opts = qemu_opts_create(bdrv_qcow2->create_opts, NULL, 0,
>>                               &error_abort);
>>       qemu_opt_set_number(opts, BLOCK_OPT_SIZE, total_size);
> This dynamic qcow2 driver lookup business is silly.  Compiling without
> qcow2 would be a massive loss of functionality, and I wouldn't bet a
> nickel on the error paths it would pring to live.

True.

> Even sillier lookups: "file" in bdrv_find_protocol(), and "raw" in
> find_image_format().
>
> Statically linking to them would be simpler and more honest.
>
> Aside: similar silliness exists around QemuOpts.
>
> Patch looks correct.

Well, at least it will silence Coverity...

Max

  reply	other threads:[~2014-11-26  9:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 14:07 [Qemu-devel] [PATCH 00/12] block: Various Coverity-spotted fixes Max Reitz
2014-11-25 14:07 ` [Qemu-devel] [PATCH 01/12] block: qcow2 driver may not be found Max Reitz
2014-11-26  7:23   ` Markus Armbruster
2014-11-26  9:13     ` Max Reitz [this message]
2014-11-26 15:19       ` Eric Blake
2014-11-26 15:20         ` Max Reitz
2014-11-26 15:24           ` Kevin Wolf
2014-11-27  9:02             ` Markus Armbruster
2014-11-25 14:07 ` [Qemu-devel] [PATCH 02/12] block/vvfat: qcow " Max Reitz
2014-11-25 14:07 ` [Qemu-devel] [PATCH 03/12] block/nfs: Add create_opts Max Reitz
2014-11-25 14:41   ` Kevin Wolf
2014-11-25 14:49     ` Max Reitz
2014-11-27 13:24       ` Max Reitz
2014-11-25 14:07 ` [Qemu-devel] [PATCH 04/12] block: Check create_opts before image creation Max Reitz
2014-11-25 14:07 ` [Qemu-devel] [PATCH 05/12] qemu-img: " Max Reitz
2014-11-25 14:07 ` [Qemu-devel] [PATCH 06/12] qemu-img: Check create_opts before image amendment Max Reitz
2014-11-25 14:08 ` [Qemu-devel] [PATCH 07/12] iotests: Only kill NBD server if it runs Max Reitz
2014-11-25 14:08 ` [Qemu-devel] [PATCH 08/12] iotests: Add test for unsupported image creation Max Reitz
2014-11-25 14:08 ` [Qemu-devel] [PATCH 09/12] qcow2: Prevent numerical overflow Max Reitz
2014-11-25 14:08 ` [Qemu-devel] [PATCH 10/12] qcow2: Flushing the caches in qcow2_close may fail Max Reitz
2014-11-25 14:22   ` Max Reitz
2014-11-25 14:49     ` Kevin Wolf
2014-11-25 14:08 ` [Qemu-devel] [PATCH 11/12] qcow2: Respect bdrv_truncate() error Max Reitz
2014-11-25 14:08 ` [Qemu-devel] [PATCH 12/12] block/raw-posix: Fix ret in raw_open_common() Max Reitz

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=547599A1.5080100@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.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.