qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Roman Kagan <rkagan@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu block <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] qcow2: insert assert into qcow2_get_specific_info()
Date: Thu, 10 Dec 2015 08:08:54 -0700	[thread overview]
Message-ID: <56699586.8010203@redhat.com> (raw)
In-Reply-To: <1449741348-7198-1-git-send-email-den@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

[adding qemu-block in cc, per MAINTAINERS]

On 12/10/2015 02:55 AM, Denis V. Lunev wrote:
> s->qcow_version is always set to 2 or 3. Let's assert if this is wrong.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Roman Kagan <rkagan@virtuozzo.com>
> CC: Max Reitz <mreitz@redhat.com>
> CC: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/qcow2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 88f56c8..b285014 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2757,6 +2757,10 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs)
>              .has_corrupt        = true,
>              .refcount_bits      = s->refcount_bits,
>          };
> +    } else {
> +        /* if this assertion fails, this probably means a new version was
> +         * added without having it covered here */
> +        assert(false);

Only covers us if we don't turn on NDEBUG during compile; but then
again, lots of spots in the code base assume assert() will never be
crippled.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-12-10 15:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10  9:55 [Qemu-devel] [PATCH 1/1] qcow2: insert assert into qcow2_get_specific_info() Denis V. Lunev
2015-12-10 15:08 ` Eric Blake [this message]
2015-12-10 15:15 ` Kevin Wolf

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=56699586.8010203@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.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 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).