From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPWOL-0001EC-4S for qemu-devel@nongnu.org; Tue, 19 Jul 2016 10:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPWOG-00079D-4M for qemu-devel@nongnu.org; Tue, 19 Jul 2016 10:53:00 -0400 References: <1468901281-22858-1-git-send-email-eblake@redhat.com> <1468901281-22858-6-git-send-email-eblake@redhat.com> <20160719051055.GD18103@ad.usersys.redhat.com> From: Eric Blake Message-ID: <578E3EBF.1040707@redhat.com> Date: Tue, 19 Jul 2016 08:52:47 -0600 MIME-Version: 1.0 In-Reply-To: <20160719051055.GD18103@ad.usersys.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x9SCTGkLxI16NsUXcXAMXgwmVlPR0iPJ4" Subject: Re: [Qemu-devel] [PATCH v5 05/14] nbd: Share common reply-sending code in server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --x9SCTGkLxI16NsUXcXAMXgwmVlPR0iPJ4 From: Eric Blake To: Fam Zheng Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-block@nongnu.org Message-ID: <578E3EBF.1040707@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 05/14] nbd: Share common reply-sending code in server References: <1468901281-22858-1-git-send-email-eblake@redhat.com> <1468901281-22858-6-git-send-email-eblake@redhat.com> <20160719051055.GD18103@ad.usersys.redhat.com> In-Reply-To: <20160719051055.GD18103@ad.usersys.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/18/2016 11:10 PM, Fam Zheng wrote: > On Mon, 07/18 22:07, Eric Blake wrote: >> Rather than open-coding NBD_REP_SERVER, reuse the code we >> already have by adding a length parameter. Additionally, >> the refactoring will make adding NBD_OPT_GO in a later patch >> easier. >> >> Signed-off-by: Eric Blake >> >> --- >> v4: no change >> v3: rebase to changes earlier in series >> --- >> nbd/server.c | 48 +++++++++++++++++++++++------------------------- >> 1 file changed, 23 insertions(+), 25 deletions(-) >> >> diff --git a/nbd/server.c b/nbd/server.c >> index 85c4f5d..c8716f1 100644 >> --- a/nbd/server.c >> +++ b/nbd/server.c >> @@ -195,12 +195,15 @@ static ssize_t nbd_negotiate_drop_sync(QIOChanne= l *ioc, size_t size) >> >> */ >> >> -static int nbd_negotiate_send_rep(QIOChannel *ioc, uint32_t type, uin= t32_t opt) >> +/* Send a reply header, including length, but no payload. >> + * Return -errno to kill connection, 0 to continue negotiation. */ >=20 > Not a show stopper but I'm not sure documenting the control logic of th= e > outermost caller a few layers away is a good idea, the same question ap= plies to > functions below as well. The documentation here accurately describes this function. Or is your complaint that the outermost caller is lacking documentation, and therefore I should first do a patch that uniformly adds documentation, before changing behavior, so that this function doesn't end up with details while the outermost caller remains undocumented? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --x9SCTGkLxI16NsUXcXAMXgwmVlPR0iPJ4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXjj6/AAoJEKeha0olJ0Nq4gkH/i1lYYmj9N9jH6HCjkXwZ4aG OxFTFKor5CCawYvseXGaU/H1xpZaCx/ro3XHnAnz97E6WR+aqZaLppa69Y9QIFee EfKQkC2SgLyfQphsRtsDpXxxXhE/uoSvTKr+Y0QkaXNO5nQknXpxn8ulIhtL5IMx opf58IqqTH0iONognpGnFikR1tyWxqP0SbNXTzwE6aCUpBA/BoODI/HCddA7qnLN a/dFr7ahHOEVuehwBW7HPUp3ovuUvjvivx4/xXSxPNN5vaPFfWtiS3PGX/y7pc9P 2U1vCQGZjt3Rl4cei20s9xZN2oJINtc8niTgUt3ulwWhdb4t6PJy6SFGcCx5PVk= =gtSN -----END PGP SIGNATURE----- --x9SCTGkLxI16NsUXcXAMXgwmVlPR0iPJ4--