qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device


From: Jes Sorensen
Subject: Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device
Date: Mon, 28 Mar 2011 15:45:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9

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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]