From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54420 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4ClD-0002KY-W5 for qemu-devel@nongnu.org; Mon, 28 Mar 2011 09:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4ClC-0005Aq-DX for qemu-devel@nongnu.org; Mon, 28 Mar 2011 09:45:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4ClC-0005Ai-3e for qemu-devel@nongnu.org; Mon, 28 Mar 2011 09:45:34 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2SDjXS0020224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Mar 2011 09:45:33 -0400 Received: from [10.3.113.75] (ovpn-113-75.phx2.redhat.com [10.3.113.75]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2SDjWM6009518 for ; Mon, 28 Mar 2011 09:45:32 -0400 Message-ID: <4D9090E8.1070208@redhat.com> Date: Mon, 28 Mar 2011 15:45:12 +0200 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device References: <1300886393-2799-1-git-send-email-alevy@redhat.com> <1300886393-2799-6-git-send-email-alevy@redhat.com> <4D907A4D.1000103@redhat.com> <20110328121453.GD28224@playa.redhat.com> In-Reply-To: <20110328121453.GD28224@playa.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 03/28/11 14:14, Alon Levy wrote: >>> +static void ccid_card_vscard_send_init(PassthruState *s) >>> > > +{ >>> > > + VSCMsgInit msg = { >>> > > + .version = htonl(VSCARD_VERSION), >>> > > + .magic = VSCARD_MAGIC, >>> > > + .capabilities = {0} >>> > > + }; >>> > > + >> > >> > If this goes over the wire, don't you need to htonl(VSCARD_MAGIC) here >> > if someone tries to run passthrough from a big endian system to a little >> > endian system, or vice versa? > The VSCARD_MAGIC definition is actually a cast of a string, so it is already > in the correct byte order: > > libcacard/vscard_common.h:#define VSCARD_MAGIC (*(uint32_t *)"VSCD") > Ah, I was staring at it for a bit and I wasn't quite sure, which is why I asked the question. Might be worth adding a comment about it. Otherwise it is good then, so.... Acked-by: Jes Sorensen