diff --git a/server/char-device.h b/server/char-device.h index b70ffae4..b787855d 100644 --- a/server/char-device.h +++ b/server/char-device.h @@ -214,8 +214,10 @@ void spice_char_device_write_buffer_release(SpiceCharDeviceState *dev, /* api for specific char devices */ -SpiceCharDeviceState *spicevmc_device_connect(SpiceCharDeviceInstance *sin, +SpiceCharDeviceState *spicevmc_device_connect(struct RedsState *reds, + SpiceCharDeviceInstance *sin, uint8_t channel_type); -void spicevmc_device_disconnect(SpiceCharDeviceInstance *char_device); +void spicevmc_device_disconnect(struct RedsState *reds, + SpiceCharDeviceInstance *char_device); #endif // CHAR_DEVICE_H_ diff --git a/server/reds.c b/server/reds.c index 800f7b3e..1c5d52b7 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3103,13 +3103,13 @@ static int spice_server_char_device_add_interface(SpiceServer *s, } #endif else if (strcmp(char_device->subtype, SUBTYPE_USBREDIR) == 0) { - dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_USBREDIR); + dev_state = spicevmc_device_connect(reds, char_device, SPICE_CHANNEL_USBREDIR); } else if (strcmp(char_device->subtype, SUBTYPE_PORT) == 0) { if (strcmp(char_device->portname, "org.spice-space.webdav.0") == 0) { - dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_WEBDAV); + dev_state = spicevmc_device_connect(reds, char_device, SPICE_CHANNEL_WEBDAV); } else { - dev_state = spicevmc_device_connect(char_device, SPICE_CHANNEL_PORT); + dev_state = spicevmc_device_connect(reds, char_device, SPICE_CHANNEL_PORT); } } @@ -3147,7 +3147,7 @@ static void spice_server_char_device_remove_interface(RedsState *reds, SpiceBase #endif else if (strcmp(char_device->subtype, SUBTYPE_USBREDIR) == 0 || strcmp(char_device->subtype, SUBTYPE_PORT) == 0) { - spicevmc_device_disconnect(char_device); + spicevmc_device_disconnect(reds, char_device); } else { spice_warning("failed to remove char device %s", char_device->subtype); } diff --git a/server/spicevmc.c b/server/spicevmc.c index 4460eabc..4fc95e38 100644 --- a/server/spicevmc.c +++ b/server/spicevmc.c @@ -504,7 +504,8 @@ static void spicevmc_connect(RedChannel *channel, RedClient *client, } } -SpiceCharDeviceState *spicevmc_device_connect(SpiceCharDeviceInstance *sin, +SpiceCharDeviceState *spicevmc_device_connect(RedsState *reds, + SpiceCharDeviceInstance *sin, uint8_t channel_type) { static uint8_t id[256] = { 0, }; @@ -554,7 +555,7 @@ SpiceCharDeviceState *spicevmc_device_connect(SpiceCharDeviceInstance *sin, } /* Must be called from RedClient handling thread. */ -void spicevmc_device_disconnect(SpiceCharDeviceInstance *sin) +void spicevmc_device_disconnect(RedsState *reds, SpiceCharDeviceInstance *sin) { SpiceVmcState *state;