summaryrefslogtreecommitdiffstats
path: root/libcacard/vscclient.c
Commit message (Collapse)AuthorAgeFilesLines
* vscclient: do not add a socket watch if there is not data to sendMarc-André Lureau2013-12-161-4/+6
| | | | | | | | | Fixes the following error: ** (process:780): CRITICAL **: do_socket_send: assertion `socket_to_send->len != 0' failed Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* libcacard: Fix compilation for older versions of glib (bug #1258168)Stefan Weil2013-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://bugs.launchpad.net/bugs/1258168 libcacard/vscclient.c: In function 'do_socket_read': libcacard/vscclient.c:410: warning: implicit declaration of function 'g_warn_if_reached' libcacard/vscclient.c:410: warning: nested extern declaration of 'g_warn_if_reached' libcacard/vscclient.c: In function 'main': libcacard/vscclient.c:763: warning: implicit declaration of function 'g_byte_array_unref' libcacard/vscclient.c:763: warning: nested extern declaration of 'g_byte_array_unref' ... libcacard/vscclient.o: In function `do_socket_read': libcacard/vscclient.c:410: undefined reference to `g_warn_if_reached' libcacard/vscclient.o: In function `main': libcacard/vscclient.c:763: undefined reference to `g_byte_array_unref' g_warn_if_reached was added in glib 2.16, and g_byte_array_unref is supported since glib 2.22. QEMU requires glib 2.12, so both names must not be used. Instead of showing a warning for code which should not be reached, vscclient better stop running, so g_warn_if_reached is not useful for vscclient. In libcacard/vsclient.c, g_byte_array_unref can be replaced by g_byte_array_free. This is not generally true, so adding a compatibility layer in include/glib-compat.h is no option here. Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Reported-by: Don Slutz <dslutz@verizon.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
* vscclient: remove unnecessary use of uninitialized variableMichael Tokarev2013-09-201-2/+1
| | | | | | Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* libcacard/vscclient: fix leakage of socket on error pathsAlon Levy2013-06-121-2/+7
| | | | | | | | Spotted by Coverity. Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* libcacard: teach vscclient to use GMainLoop for portabilityMarc-André Lureau2013-04-241-145/+246
| | | | | | | | This version handles non-blocking sending and receiving from the socket. Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
* libcacard: vscclient to use QemuThread for portabilityMarc-André Lureau2013-04-241-7/+2
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
* libcacard: split vscclient main() from socket readingMarc-André Lureau2013-04-241-152/+162
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
* libcacard: Fix unchecked strdup() by converting to g_strdup()Markus Armbruster2013-01-301-2/+2
| | | | | | | | Note that we already free with g_free(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Spelling fixes in comments (it's -> its)Stefan Weil2012-03-081-1/+1
| | | | | | | | | | * it's -> its (fixed for all files) * dont -> don't (only fixed in a line which was touched by the previous fix) * distrub -> disturb (fixed in the same line) Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* libcacard: Use format specifier %u instead of %d for unsigned valuesStefan Weil2012-03-081-10/+10
| | | | | | | splint reported warnings for those code statements. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* libcacard/vscclient: fix error paths for socket creationAlon Levy2011-10-251-2/+7
| | | | Signed-off-by: Alon Levy <alevy@redhat.com>
* Fix spelling in comments and debug messages (recieve -> receive)Stefan Weil2011-08-291-1/+1
| | | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Reviewed-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-1/+1
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* libcacard: add vscclientRobert Relyea2011-04-011-0/+652
client to talk to ccid-card-passthru and use smartcard on client to perform actual operations. v23->v24 changes: (Jes Sorensen review 2) * use qemu_socket instead of socket * use fprintf(stderr,..) for errors * remove unneccessary includes since using qemu_common.h
OpenPOWER on IntegriCloud