From 5ab873730199fd05012b29de5a6fb993b51841c5 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Fri, 30 Jan 2015 16:57:16 -0600 Subject: Add RedsState arg to smartcard_device_connect() --- server/reds.c | 3 +-- server/smartcard.c | 9 +++++---- server/smartcard.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/reds.c b/server/reds.c index 6241c174..6ba65a0c 100644 --- a/server/reds.c +++ b/server/reds.c @@ -2984,7 +2984,7 @@ static int spice_server_char_device_add_interface(SpiceServer *s, } #ifdef USE_SMARTCARD else if (strcmp(char_device->subtype, SUBTYPE_SMARTCARD) == 0) { - if (!(dev_state = smartcard_device_connect(char_device))) { + if (!(dev_state = smartcard_device_connect(s, char_device))) { return -1; } } @@ -3007,7 +3007,6 @@ static int spice_server_char_device_add_interface(SpiceServer *s, if (s->vm_running) { spice_char_device_start(char_device->st); } - spice_char_device_set_server(char_device->st, reds); reds_char_device_add_state(s, char_device->st); } else { spice_warning("failed to create device state for %s", char_device->subtype); diff --git a/server/smartcard.c b/server/smartcard.c index 928e27b8..8927fb1e 100644 --- a/server/smartcard.c +++ b/server/smartcard.c @@ -108,7 +108,7 @@ static void smartcard_channel_write_to_reader(SpiceCharDeviceWriteBuffer *write_ static MsgItem *smartcard_char_device_on_message_from_device( SmartCardDeviceState *state, VSCMsgHeader *header); -static SmartCardDeviceState *smartcard_device_state_new(SpiceCharDeviceInstance *sin); +static SmartCardDeviceState *smartcard_device_state_new(RedsState *reds, SpiceCharDeviceInstance *sin); static void smartcard_device_state_free(SmartCardDeviceState* st); static void smartcard_init(void); @@ -260,7 +260,7 @@ static SpiceCharDeviceInstance *smartcard_readers_get_unattached(void) return NULL; } -static SmartCardDeviceState *smartcard_device_state_new(SpiceCharDeviceInstance *sin) +static SmartCardDeviceState *smartcard_device_state_new(RedsState *reds, SpiceCharDeviceInstance *sin) { SmartCardDeviceState *st; SpiceCharDeviceCallbacks chardev_cbs = { NULL, }; @@ -274,6 +274,7 @@ static SmartCardDeviceState *smartcard_device_state_new(SpiceCharDeviceInstance st = spice_new0(SmartCardDeviceState, 1); st->chardev_st = spice_char_device_state_create(sin, + reds, 0, /* tokens interval */ ~0, /* self tokens */ &chardev_cbs, @@ -305,11 +306,11 @@ void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device) smartcard_device_state_free(st); } -SpiceCharDeviceState *smartcard_device_connect(SpiceCharDeviceInstance *char_device) +SpiceCharDeviceState *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device) { SmartCardDeviceState *st; - st = smartcard_device_state_new(char_device); + st = smartcard_device_state_new(reds, char_device); if (smartcard_char_device_add_to_readers(char_device) == -1) { smartcard_device_state_free(st); return NULL; diff --git a/server/smartcard.h b/server/smartcard.h index 221c777e..ca2c13f1 100644 --- a/server/smartcard.h +++ b/server/smartcard.h @@ -26,7 +26,7 @@ /* * connect to smartcard interface, used by smartcard channel */ -SpiceCharDeviceState *smartcard_device_connect(SpiceCharDeviceInstance *char_device); +SpiceCharDeviceState *smartcard_device_connect(RedsState *reds, SpiceCharDeviceInstance *char_device); void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device); #endif // __SMART_CARD_H__ -- cgit