qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new
Date: Fri, 8 Jan 2016 19:24:41 +0100	[thread overview]
Message-ID: <568FFEE9.9040303@redhat.com> (raw)
In-Reply-To: <20160108162428.GC24031@redhat.com>



On 08/01/2016 17:24, Daniel P. Berrange wrote:
>> >      if (nbd_send_negotiate(client)) {
>> > +        shutdown(csock, 2);
>> > +        close(csock);
>> >          g_free(client);
>> > -        return NULL;
>> > +        ret = -1;
>> > +        goto out;
> If you simply make this failure code branch call close_fn() then I
> think you can adding needing the new NBDClientNewCB entirely if....

Good idea, but note that close_fn will call nbd_client_put, so the
close/g_free must be removed.  It's probably cleanest to change csock to
client->sock in the shutdown call, too.

Paolo

  reply	other threads:[~2016-01-08 18:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  5:49 [Qemu-devel] [PATCH 0/2] nbd: Async built-in server negotiation Fam Zheng
2015-12-30  5:49 ` [Qemu-devel] [PATCH 1/2] nbd: Interface tweak of nbd_client_new Fam Zheng
2016-01-08 16:24   ` Daniel P. Berrange
2016-01-08 18:24     ` Paolo Bonzini [this message]
2016-01-11  3:20       ` Fam Zheng
2015-12-30  5:49 ` [Qemu-devel] [PATCH 2/2] nbd: Coroutine based nbd_send_negotiate Fam Zheng

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=568FFEE9.9040303@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).