qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Use error_is_set() only when necessary
Date: Tue, 11 Feb 2014 09:24:55 +0800	[thread overview]
Message-ID: <20140211012455.GA2923@T430.nay.redhat.com> (raw)
In-Reply-To: <20140210155441.5c403529@redhat.com>

On Mon, 02/10 15:54, Luiz Capitulino wrote:
> > @@ -875,13 +875,13 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
> >      /* Actual block device init: Functionality shared with blockdev-add */
> >      dinfo = blockdev_init(filename, bs_opts, type, &local_err);
> >      if (dinfo == NULL) {
> > -        if (error_is_set(&local_err)) {
> > +        if (local_err) {
> >              qerror_report_err(local_err);
> >              error_free(local_err);
> >          }
> >          goto fail;
> >      } else {
> > -        assert(!error_is_set(&local_err));
> > +        assert(!local_err);
> >      }
> 
> Not related to this patch, but this else clause is checking if
> dinfo != NULL and local_err != NULL, right? Shouldn't it be moved
> into blockdev_init() instead?

This is just an caller checking that the output of blockdev_init is sane, so I
think it's OK to put an assertion here.

Fam

  reply	other threads:[~2014-02-11  1:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30 14:07 [Qemu-devel] [PATCH] Use error_is_set() only when necessary Markus Armbruster
2014-01-30 15:45 ` Eric Blake
2014-01-30 16:02   ` Markus Armbruster
2014-01-30 17:14 ` Andreas Färber
2014-01-31  7:42   ` Markus Armbruster
2014-02-10 20:54 ` Luiz Capitulino
2014-02-11  1:24   ` Fam Zheng [this message]
2014-02-11  8:25     ` Markus Armbruster
2014-02-21 11:01 ` 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=20140211012455.GA2923@T430.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@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).