summaryrefslogtreecommitdiffstats
path: root/server/reds.c
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-06-25 17:47:36 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-07-03 14:13:42 +0300
commitc514a1d903dc967dcb5f430098db410ed37b68e4 (patch)
tree791e13bc1357860fcd9399255216a1b6dfd240d8 /server/reds.c
parent7305a4b06f6e846bfecc70d79ac2cef99781cddd (diff)
downloadspice-c514a1d903dc967dcb5f430098db410ed37b68e4.tar.gz
spice-c514a1d903dc967dcb5f430098db410ed37b68e4.tar.xz
spice-c514a1d903dc967dcb5f430098db410ed37b68e4.zip
smartcard: use SpiceCharDeviceState for managing reading from the device
This patch and the following one do not introduce tokening to the smartcard channel. But this can be done easily later, by setting the appropriate variables in SpiceCharDeviceState (after adding the appropriate protocol messages, and implementing this in the client side).
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c
index 42fad0ce..911564b8 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3200,7 +3200,7 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
}
#ifdef USE_SMARTCARD
else if (strcmp(char_device->subtype, SUBTYPE_SMARTCARD) == 0) {
- if (smartcard_device_connect(char_device) == -1) {
+ if (!(dev_state = smartcard_device_connect(char_device))) {
return -1;
}
}
@@ -3213,6 +3213,8 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
/* setting the char_device state to "started" for backward compatibily with
* qemu releases that don't call spice api for start/stop (not implemented yet) */
spice_char_device_start(char_device->st);
+ } else {
+ spice_error("failed to create device state for %s", char_device->subtype);
}
return 0;
}