From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRMHk-0007wP-94 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:57:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRMHj-000879-AN for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:57:32 -0500 References: <1454543313-17505-1-git-send-email-jsnow@redhat.com> <56B32797.3060808@redhat.com> <56B37234.8000901@redhat.com> From: Paolo Bonzini Message-ID: <56B374E4.2030902@redhat.com> Date: Thu, 4 Feb 2016 16:57:24 +0100 MIME-Version: 1.0 In-Reply-To: <56B37234.8000901@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] nbd: avoid unaligned uint64_t store List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: famz@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com On 04/02/2016 16:45, John Snow wrote: > > > On 02/04/2016 05:27 AM, Paolo Bonzini wrote: >> >> >> On 04/02/2016 00:48, John Snow wrote: >>> cpu_to_be64w can't be used to make unaligned stores, but stq_be_p can. >>> The other stores in this routine are left alone, they're aligned already. >>> >>> Signed-off-by: John Snow >>> --- >>> nbd/server.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/nbd/server.c b/nbd/server.c >>> index 1ec79cf..5b65059 100644 >>> --- a/nbd/server.c >>> +++ b/nbd/server.c >>> @@ -441,7 +441,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) >>> } >>> >>> assert ((client->exp->nbdflags & ~65535) == 0); >>> - cpu_to_be64w((uint64_t*)(buf + 18), client->exp->size); >>> + stq_be_p((uint64_t *)(buf + 18), client->exp->size); >>> cpu_to_be16w((uint16_t*)(buf + 26), client->exp->nbdflags | myflags); >>> if (nbd_negotiate_write(csock, buf + 18, >>> sizeof(buf) - 18) != sizeof(buf) - 18) { >>> >> >> Let's change all of them. But no need to send another patch. >> >> Paolo >> > > Does that mean that you're going to re-write the patch? I will just make it bigger. :) Your one line change will still be there! Paolo