From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPNNf-0008Fx-BW for qemu-devel@nongnu.org; Tue, 19 Jul 2016 01:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPNNe-0000Gp-9L for qemu-devel@nongnu.org; Tue, 19 Jul 2016 01:15:43 -0400 Date: Tue, 19 Jul 2016 13:15:33 +0800 From: Fam Zheng Message-ID: <20160719051533.GE18103@ad.usersys.redhat.com> References: <1468901281-22858-1-git-send-email-eblake@redhat.com> <1468901281-22858-7-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468901281-22858-7-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 06/14] nbd: Send message along with server NBD_REP_ERR errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-block@nongnu.org On Mon, 07/18 22:07, Eric Blake wrote: > nbd/server.c | 78 +++++++++++++++++++++++++++++++++++++++++++++--------------- > 1 file changed, 59 insertions(+), 19 deletions(-) > > diff --git a/nbd/server.c b/nbd/server.c > index c8716f1..ad31c4a 100644 > --- a/nbd/server.c > +++ b/nbd/server.c > @@ -235,6 +235,38 @@ static int nbd_negotiate_send_rep(QIOChannel *ioc, uint32_t type, uint32_t opt) > return nbd_negotiate_send_rep_len(ioc, type, opt, 0); > } > > +/* Send an error reply. > + * Return -errno to kill connection, 0 to continue negotiation. */ > +static int GCC_FMT_ATTR(4, 5) > + nbd_negotiate_send_rep_err(QIOChannel *ioc, uint32_t type, Isn't the function name supposed to be place at col 0? > + uint32_t opt, const char *fmt, ...)