[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/7] ccid: add ccid-card-emulated device
From: |
Jes Sorensen |
Subject: |
Re: [Qemu-devel] [PATCH 5/7] ccid: add ccid-card-emulated device |
Date: |
Mon, 14 Mar 2011 18:11:48 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 |
On 03/14/11 17:44, Alon Levy wrote:
> On Mon, Mar 14, 2011 at 04:41:02PM +0100, Jes Sorensen wrote:
>>> +#define MAX_ATR_SIZE 40
>>> +struct EmulatedState {
>>> + CCIDCardState base;
>>> + uint8_t debug;
>>> + char *backend_str;
>>> + uint32_t backend;
>>> + char *cert1;
>>> + char *cert2;
>>> + char *cert3;
>>> + char *db;
>>> + uint8_t atr[MAX_ATR_SIZE];
>>> + uint8_t atr_length;
>>> + QSIMPLEQ_HEAD(event_list, EmulEvent) event_list;
>>> + pthread_mutex_t event_list_mutex;
>>> + VReader *reader;
>>> + QSIMPLEQ_HEAD(guest_apdu_list, EmulEvent) guest_apdu_list;
>>> + pthread_mutex_t vreader_mutex; /* and guest_apdu_list mutex */
>>> + pthread_mutex_t handle_apdu_mutex;
>>> + pthread_cond_t handle_apdu_cond;
>>> + int pipe[2];
>>> + int quit_apdu_thread;
>>> + pthread_mutex_t apdu_thread_quit_mutex;
>>> + pthread_cond_t apdu_thread_quit_cond;
>>> +};
>>
>> Bad struct packing and wrong thread types.
> Will fix.
>
> Aside: Why do we care about packing something that has a single instance per
> device?
> isn't logical readable order more important in this case?
We don't care too much - use your own judgement for what makes sense in
this case. I am used to spotting those so I mention them, but I didn't
actually check how often the struct was used.
Cheers,
Jes