qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Use error_is_set() only when necessary


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH] Use error_is_set() only when necessary
Date: Tue, 11 Feb 2014 09:24:55 +0800
User-agent: Mutt/1.5.22 (2013-10-16)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]