qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] mirror: drop local_err in mirror_compelte
Date: Tue, 15 Oct 2013 10:14:59 +0800	[thread overview]
Message-ID: <20131015021459.GA5598@T430s.nay.redhat.com> (raw)
In-Reply-To: <525BF72C.20700@redhat.com>

On Mon, 10/14 07:52, Eric Blake wrote:
> On 10/12/2013 12:33 AM, Fam Zheng wrote:
> > There is errp passed in, so no need for local_err and error_propagate.
> 
> s/compelte/complete/ in the subject
> 
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  block/mirror.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> > 
> > diff --git a/block/mirror.c b/block/mirror.c
> > index 7b95acf..f2e9558 100644
> > --- a/block/mirror.c
> > +++ b/block/mirror.c
> > @@ -505,15 +505,13 @@ static void mirror_iostatus_reset(BlockJob *job)
> >  static void mirror_complete(BlockJob *job, Error **errp)
> >  {
> >      MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
> > -    Error *local_err = NULL;
> >      int ret;
> >  
> > -    ret = bdrv_open_backing_file(s->target, NULL, &local_err);
> > +    ret = bdrv_open_backing_file(s->target, NULL, errp);
> >      if (ret < 0) {
> >          char backing_filename[PATH_MAX];
> >          bdrv_get_full_backing_filename(s->target, backing_filename,
> >                                         sizeof(backing_filename));
> > -        error_propagate(errp, local_err);
> >          return;
> 
> What purpose does backing_filename serve?  It looks like it was rendered
> dead code with the introduction of commit 34b5d2c, and that you could
> simplify further to:
> 
> if (bdrv_open_backing_file(s->target, NULL, errp) < 0) {
>     return;
> }
> 

Good idea, thanks!

Fam

      reply	other threads:[~2013-10-15  2:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  6:33 [Qemu-devel] [PATCH] mirror: drop local_err in mirror_compelte Fam Zheng
2013-10-14 13:52 ` Eric Blake
2013-10-15  2:14   ` Fam Zheng [this message]

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=20131015021459.GA5598@T430s.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@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 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).