Re: [Qemu-devel] [PATCH v24 00/10] usb-ccid

2011-04-01 Thread Anthony Liguori

On 03/28/2011 11:11 AM, Alon Levy wrote:

This patchset adds three new devices, usb-ccid, ccid-card-passthru and
ccid-card-emulated, providing a CCID bus, a simple passthru protocol
implementing card requiring a client, and a standalone emulated card.

It also introduces a new directory libcaccard with CAC card emulation,
CAC is a type of ISO 7816 smart card.

Tree for pull: git://anongit.freedesktop.org/~alon/qemu usb_ccid.v23


CC libcacard/cac.o
In file included from /home/anthony/git/qemu/libcacard/cac.c:8:
/home/anthony/git/qemu/qemu-common.h:5:25: error: config-host.h: No such 
file or directory

In file included from /home/anthony/git/qemu/libcacard/cac.c:8:
/home/anthony/git/qemu/qemu-common.h:63: error: redefinition of ‘struct 
iovec’

make[1]: *** [cac.o] Error 1
make: *** [subdir-libcacard] Error 2

This is building from a separate directory. Let me know if you can't 
reproduce.


Regards,

Anthony Liguori


v23-v24 changes:
  * libcacard:
   = changed patches: (that need re-review)
* 6 - libcacard: initial commit
* 7 - libcacard: add vscclient
* 5 - ccid: add passthru card device
   * drop libcacard add passthru patch, not ready, not used.
   * remove unrequired includes
   * use stderr in vscclient for printing errors
   * cosmetic fixes

v22-v23 changes:
  * libcacard
   * configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
 - this doesn't really help since there are many other places
   that need similar fixes, not introduced by this patch.

v21-v22 changes:
  * libcacard:
   * fix configure to not link libcacard if nss not found
  (reported by Stefan Hajnoczi)
   * fix vscclient linkage with simpletrace backend
  (reported by Stefan Hajnoczi)
   * card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
  (reported by William van de Velde)

v20-v21 changes:
  * all: cosmetics
  * libcacard, ccid-card-passthru:
   * use qemu-{malloc,free} and qemu-thread, error_report
  * libcacard:
   * split to multiple patches

v19-v20 changes:
  * checkpatch.pl. Here are the remaining errors with explanation:
   * ignored 5 macro errors of the type
ERROR: Macros with complex values should be enclosed in parenthesis
because fixing them breaks current code, if it really bothers someone
I can fix it.
* four of them are in libcacard/card_7816t.h:
/* give the subfields a unified look */
..
#define a_cla a_header-ah_cla /* class */
#define a_ins a_header-ah_ins /* instruction */
#define a_p1 a_header-ah_p1   /* parameter 1 */
#define a_p2 a_header-ah_p2   /* parameter 2 */
* and the fifth:
#4946: FILE: libcacard/vcardt.h:31:
+#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
+   'V', 'C', 'A', 'R', 'D', '_'
   * Ignored this warning since I couldn't figure it out, and it's a test
file:
WARNING: externs should be avoided in .c files
#2343: FILE: libcacard/link_test.c:7:
+VCardStatus cac_card_init(const char *flags, VCard *card,

v18-v19 changes:
  * more merges, down to a single digit number of patches.
  * drop enumeration property, use string.
  * rebased (trivial)

v17-v18 changes:
  * merge vscard_common.h patches.
  * actually provide a tree to pull.

v16-v17 changes:
  * merged all the v15-v16 patches
  * merged some more wherever it was easy (all same file commits).
  * added signed off by to first four patches
  * ccid.h: added copyright, removed underscore in defines, and replaced
  non C89 comments

v15-v16 changes:
  * split vscard_common introducing patch for ease of review
  * sum of commit logs for the v15-v16 commits: (whitespace fixes
 removed for space, see original commit messages in later patches)
   * usb-ccid:
* fix abort on client answer after card remove
* enable migration
* remove side affect code from asserts
* return consistent self-powered state
* mask out reserved bits in ccid_set_parameters
* add missing abRFU in SetParameters (no affect on linux guest)
   * vscard_common.h protocol change:
* VSCMsgInit capabilities and magic
* removed ReaderResponse, will use Error instead with code==VSC_SUCCESS.
* added Flush and FlushComplete, remove Reconnect.
* define VSCARD_MAGIC
* added error code VSC_SUCCESS.
   * ccid-card-passthru
* return correct size
* return error instead of assert if client sent too large ATR
* don't assert if client sent too large a size, but add asserts for indices 
to buffer
* reset vscard_in indices on chardev disconnect
* handle init from client
* error if no chardev supplied
* use ntoh, hton
* eradicate reader_id_t
* remove Reconnect usage (removed from VSCARD protocol)
* send VSC_SUCCESS on card insert/remove and reader add/remove
   * ccid-card-emulated
* fix error reporting in initfn

v14-v15 changes:
  * add patch with --enable-smartcard and --disable-smartcard and 

Re: [Qemu-devel] [PATCH v24 00/10] usb-ccid

2011-03-29 Thread Jes Sorensen
On 03/28/11 18:11, Alon Levy wrote:
 This patchset adds three new devices, usb-ccid, ccid-card-passthru and
 ccid-card-emulated, providing a CCID bus, a simple passthru protocol
 implementing card requiring a client, and a standalone emulated card.
 
 It also introduces a new directory libcaccard with CAC card emulation,
 CAC is a type of ISO 7816 smart card.
 
 Tree for pull: git://anongit.freedesktop.org/~alon/qemu usb_ccid.v24

Hi Alon,

I looked through v24 and it seems to be addressing the issues that I
raised with v23, so:

Reviewed-by: Jes Sorensen jes.soren...@redhat.com

Cheers,
Jes



[Qemu-devel] [PATCH v24 00/10] usb-ccid

2011-03-28 Thread Alon Levy
This patchset adds three new devices, usb-ccid, ccid-card-passthru and
ccid-card-emulated, providing a CCID bus, a simple passthru protocol
implementing card requiring a client, and a standalone emulated card.

It also introduces a new directory libcaccard with CAC card emulation,
CAC is a type of ISO 7816 smart card.

Tree for pull: git://anongit.freedesktop.org/~alon/qemu usb_ccid.v24

v23-v24 changes:
 * libcacard:
  = changed patches: (that need re-review)
   * 6 - libcacard: initial commit
   * 7 - libcacard: add vscclient
  = changed but trust me don't need rereview:
   * 5 - ccid: add passthru card device (removed a duplicate line
in the header, had two licenses).
  * drop libcacard add passthru patch, not ready, not used.
  * remove unrequired includes
  * use stderr in vscclient for printing errors
  * cosmetic fixes

v22-v23 changes:
 * libcacard
  * configure fixes: (reported by Stefan Hajnoczi)
   * test a = b, not a == b (second isn't portable)
   * quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
  that need similar fixes, not introduced by this patch.

v21-v22 changes:
 * libcacard:
  * fix configure to not link libcacard if nss not found
 (reported by Stefan Hajnoczi)
  * fix vscclient linkage with simpletrace backend
 (reported by Stefan Hajnoczi)
  * card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
 (reported by William van de Velde)

v20-v21 changes:
 * all: cosmetics
 * libcacard, ccid-card-passthru:
  * use qemu-{malloc,free} and qemu-thread, error_report
 * libcacard:
  * split to multiple patches

v19-v20 changes:
 * checkpatch.pl. Here are the remaining errors with explanation:
  * ignored 5 macro errors of the type
   ERROR: Macros with complex values should be enclosed in parenthesis
   because fixing them breaks current code, if it really bothers someone
   I can fix it.
   * four of them are in libcacard/card_7816t.h:
   /* give the subfields a unified look */
   ..
#define a_cla a_header-ah_cla /* class */
#define a_ins a_header-ah_ins /* instruction */
#define a_p1 a_header-ah_p1   /* parameter 1 */
#define a_p2 a_header-ah_p2   /* parameter 2 */
   * and the fifth:
#4946: FILE: libcacard/vcardt.h:31:
+#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
+   'V', 'C', 'A', 'R', 'D', '_'
  * Ignored this warning since I couldn't figure it out, and it's a test
   file:
WARNING: externs should be avoided in .c files
#2343: FILE: libcacard/link_test.c:7:
+VCardStatus cac_card_init(const char *flags, VCard *card,

v18-v19 changes:
 * more merges, down to a single digit number of patches.
 * drop enumeration property, use string.
 * rebased (trivial)

v17-v18 changes:
 * merge vscard_common.h patches.
 * actually provide a tree to pull.

v16-v17 changes:
 * merged all the v15-v16 patches
 * merged some more wherever it was easy (all same file commits).
 * added signed off by to first four patches
 * ccid.h: added copyright, removed underscore in defines, and replaced
 non C89 comments

v15-v16 changes:
 * split vscard_common introducing patch for ease of review
 * sum of commit logs for the v15-v16 commits: (whitespace fixes
removed for space, see original commit messages in later patches)
  * usb-ccid:
   * fix abort on client answer after card remove
   * enable migration
   * remove side affect code from asserts
   * return consistent self-powered state
   * mask out reserved bits in ccid_set_parameters
   * add missing abRFU in SetParameters (no affect on linux guest)
  * vscard_common.h protocol change:
   * VSCMsgInit capabilities and magic
   * removed ReaderResponse, will use Error instead with code==VSC_SUCCESS.
   * added Flush and FlushComplete, remove Reconnect.
   * define VSCARD_MAGIC
   * added error code VSC_SUCCESS.
  * ccid-card-passthru
   * return correct size
   * return error instead of assert if client sent too large ATR
   * don't assert if client sent too large a size, but add asserts for indices 
to buffer
   * reset vscard_in indices on chardev disconnect
   * handle init from client
   * error if no chardev supplied
   * use ntoh, hton
   * eradicate reader_id_t
   * remove Reconnect usage (removed from VSCARD protocol)
   * send VSC_SUCCESS on card insert/remove and reader add/remove
  * ccid-card-emulated
   * fix error reporting in initfn

v14-v15 changes:
 * add patch with --enable-smartcard and --disable-smartcard and only
  disable ccid-card-emulated if nss not found.
 * add patch with description strings
 * s/libcaccard/libcacard/ in docs/ccid.txt

v13-v14 changes:
 - support device_del/device_add on ccid-card-* and usb-ccid
 * usb-ccid:
  * lose card reference when card device deleted
  * check slot number and deny adding a slot if one is already added.
 * ccid-card-*: use qdev_simple_unplug_cb in both emulated and passthru ccid 
cards,
   the exitfn already takes care of triggering card removal in the usb dev.
 * 

[Qemu-devel] [PATCH v24 00/10] usb-ccid

2011-03-28 Thread Alon Levy
This patchset adds three new devices, usb-ccid, ccid-card-passthru and
ccid-card-emulated, providing a CCID bus, a simple passthru protocol
implementing card requiring a client, and a standalone emulated card.

It also introduces a new directory libcaccard with CAC card emulation,
CAC is a type of ISO 7816 smart card.

Tree for pull: git://anongit.freedesktop.org/~alon/qemu usb_ccid.v23

v23-v24 changes:
 * libcacard:
  = changed patches: (that need re-review)
   * 6 - libcacard: initial commit
   * 7 - libcacard: add vscclient
   * 5 - ccid: add passthru card device
  * drop libcacard add passthru patch, not ready, not used.
  * remove unrequired includes
  * use stderr in vscclient for printing errors
  * cosmetic fixes

v22-v23 changes:
 * libcacard
  * configure fixes: (reported by Stefan Hajnoczi)
   * test a = b, not a == b (second isn't portable)
   * quote $source_path in case it contains spaces
- this doesn't really help since there are many other places
  that need similar fixes, not introduced by this patch.

v21-v22 changes:
 * libcacard:
  * fix configure to not link libcacard if nss not found
 (reported by Stefan Hajnoczi)
  * fix vscclient linkage with simpletrace backend
 (reported by Stefan Hajnoczi)
  * card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
 (reported by William van de Velde)

v20-v21 changes:
 * all: cosmetics
 * libcacard, ccid-card-passthru:
  * use qemu-{malloc,free} and qemu-thread, error_report
 * libcacard:
  * split to multiple patches

v19-v20 changes:
 * checkpatch.pl. Here are the remaining errors with explanation:
  * ignored 5 macro errors of the type
   ERROR: Macros with complex values should be enclosed in parenthesis
   because fixing them breaks current code, if it really bothers someone
   I can fix it.
   * four of them are in libcacard/card_7816t.h:
   /* give the subfields a unified look */
   ..
#define a_cla a_header-ah_cla /* class */
#define a_ins a_header-ah_ins /* instruction */
#define a_p1 a_header-ah_p1   /* parameter 1 */
#define a_p2 a_header-ah_p2   /* parameter 2 */
   * and the fifth:
#4946: FILE: libcacard/vcardt.h:31:
+#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
+   'V', 'C', 'A', 'R', 'D', '_'
  * Ignored this warning since I couldn't figure it out, and it's a test
   file:
WARNING: externs should be avoided in .c files
#2343: FILE: libcacard/link_test.c:7:
+VCardStatus cac_card_init(const char *flags, VCard *card,

v18-v19 changes:
 * more merges, down to a single digit number of patches.
 * drop enumeration property, use string.
 * rebased (trivial)

v17-v18 changes:
 * merge vscard_common.h patches.
 * actually provide a tree to pull.

v16-v17 changes:
 * merged all the v15-v16 patches
 * merged some more wherever it was easy (all same file commits).
 * added signed off by to first four patches
 * ccid.h: added copyright, removed underscore in defines, and replaced
 non C89 comments

v15-v16 changes:
 * split vscard_common introducing patch for ease of review
 * sum of commit logs for the v15-v16 commits: (whitespace fixes
removed for space, see original commit messages in later patches)
  * usb-ccid:
   * fix abort on client answer after card remove
   * enable migration
   * remove side affect code from asserts
   * return consistent self-powered state
   * mask out reserved bits in ccid_set_parameters
   * add missing abRFU in SetParameters (no affect on linux guest)
  * vscard_common.h protocol change:
   * VSCMsgInit capabilities and magic
   * removed ReaderResponse, will use Error instead with code==VSC_SUCCESS.
   * added Flush and FlushComplete, remove Reconnect.
   * define VSCARD_MAGIC
   * added error code VSC_SUCCESS.
  * ccid-card-passthru
   * return correct size
   * return error instead of assert if client sent too large ATR
   * don't assert if client sent too large a size, but add asserts for indices 
to buffer
   * reset vscard_in indices on chardev disconnect
   * handle init from client
   * error if no chardev supplied
   * use ntoh, hton
   * eradicate reader_id_t
   * remove Reconnect usage (removed from VSCARD protocol)
   * send VSC_SUCCESS on card insert/remove and reader add/remove
  * ccid-card-emulated
   * fix error reporting in initfn

v14-v15 changes:
 * add patch with --enable-smartcard and --disable-smartcard and only
  disable ccid-card-emulated if nss not found.
 * add patch with description strings
 * s/libcaccard/libcacard/ in docs/ccid.txt

v13-v14 changes:
 - support device_del/device_add on ccid-card-* and usb-ccid
 * usb-ccid:
  * lose card reference when card device deleted
  * check slot number and deny adding a slot if one is already added.
 * ccid-card-*: use qdev_simple_unplug_cb in both emulated and passthru ccid 
cards,
   the exitfn already takes care of triggering card removal in the usb dev.
 * libcacard:
  * remove double include of config-host.mak
  * add replay of card events to libcacard to support 

Re: [Qemu-devel] [PATCH v24 00/10] usb-ccid

2011-03-28 Thread Alon Levy
On Mon, Mar 28, 2011 at 06:11:04PM +0200, Alon Levy wrote:

Sorry, please ignore this mail.

 This patchset adds three new devices, usb-ccid, ccid-card-passthru and
 ccid-card-emulated, providing a CCID bus, a simple passthru protocol
 implementing card requiring a client, and a standalone emulated card.
 
 It also introduces a new directory libcaccard with CAC card emulation,
 CAC is a type of ISO 7816 smart card.
 
 Tree for pull: git://anongit.freedesktop.org/~alon/qemu usb_ccid.v23
 
 v23-v24 changes:
  * libcacard:
   = changed patches: (that need re-review)
* 6 - libcacard: initial commit
* 7 - libcacard: add vscclient
* 5 - ccid: add passthru card device
   * drop libcacard add passthru patch, not ready, not used.
   * remove unrequired includes
   * use stderr in vscclient for printing errors
   * cosmetic fixes
 
 v22-v23 changes:
  * libcacard
   * configure fixes: (reported by Stefan Hajnoczi)
* test a = b, not a == b (second isn't portable)
* quote $source_path in case it contains spaces
 - this doesn't really help since there are many other places
   that need similar fixes, not introduced by this patch.
 
 v21-v22 changes:
  * libcacard:
   * fix configure to not link libcacard if nss not found
  (reported by Stefan Hajnoczi)
   * fix vscclient linkage with simpletrace backend
  (reported by Stefan Hajnoczi)
   * card_7816.c: add missing break in ERROR_DATA_NOT_FOUND
  (reported by William van de Velde)
 
 v20-v21 changes:
  * all: cosmetics
  * libcacard, ccid-card-passthru:
   * use qemu-{malloc,free} and qemu-thread, error_report
  * libcacard:
   * split to multiple patches
 
 v19-v20 changes:
  * checkpatch.pl. Here are the remaining errors with explanation:
   * ignored 5 macro errors of the type
ERROR: Macros with complex values should be enclosed in parenthesis
because fixing them breaks current code, if it really bothers someone
I can fix it.
* four of them are in libcacard/card_7816t.h:
/* give the subfields a unified look */
..
 #define a_cla a_header-ah_cla /* class */
 #define a_ins a_header-ah_ins /* instruction */
 #define a_p1 a_header-ah_p1   /* parameter 1 */
 #define a_p2 a_header-ah_p2   /* parameter 2 */
* and the fifth:
 #4946: FILE: libcacard/vcardt.h:31:
 +#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
 +   'V', 'C', 'A', 'R', 'D', '_'
   * Ignored this warning since I couldn't figure it out, and it's a test
file:
 WARNING: externs should be avoided in .c files
 #2343: FILE: libcacard/link_test.c:7:
 +VCardStatus cac_card_init(const char *flags, VCard *card,
 
 v18-v19 changes:
  * more merges, down to a single digit number of patches.
  * drop enumeration property, use string.
  * rebased (trivial)
 
 v17-v18 changes:
  * merge vscard_common.h patches.
  * actually provide a tree to pull.
 
 v16-v17 changes:
  * merged all the v15-v16 patches
  * merged some more wherever it was easy (all same file commits).
  * added signed off by to first four patches
  * ccid.h: added copyright, removed underscore in defines, and replaced
  non C89 comments
 
 v15-v16 changes:
  * split vscard_common introducing patch for ease of review
  * sum of commit logs for the v15-v16 commits: (whitespace fixes
 removed for space, see original commit messages in later patches)
   * usb-ccid:
* fix abort on client answer after card remove
* enable migration
* remove side affect code from asserts
* return consistent self-powered state
* mask out reserved bits in ccid_set_parameters
* add missing abRFU in SetParameters (no affect on linux guest)
   * vscard_common.h protocol change:
* VSCMsgInit capabilities and magic
* removed ReaderResponse, will use Error instead with code==VSC_SUCCESS.
* added Flush and FlushComplete, remove Reconnect.
* define VSCARD_MAGIC
* added error code VSC_SUCCESS.
   * ccid-card-passthru
* return correct size
* return error instead of assert if client sent too large ATR
* don't assert if client sent too large a size, but add asserts for 
 indices to buffer
* reset vscard_in indices on chardev disconnect
* handle init from client
* error if no chardev supplied
* use ntoh, hton
* eradicate reader_id_t
* remove Reconnect usage (removed from VSCARD protocol)
* send VSC_SUCCESS on card insert/remove and reader add/remove
   * ccid-card-emulated
* fix error reporting in initfn
 
 v14-v15 changes:
  * add patch with --enable-smartcard and --disable-smartcard and only
   disable ccid-card-emulated if nss not found.
  * add patch with description strings
  * s/libcaccard/libcacard/ in docs/ccid.txt
 
 v13-v14 changes:
  - support device_del/device_add on ccid-card-* and usb-ccid
  * usb-ccid:
   * lose card reference when card device deleted
   * check slot number and deny adding a slot if one is already added.
  * ccid-card-*: use qdev_simple_unplug_cb in both