Add RedsState arg to spicevmc_device_connect|disconnect()

Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Jonathon Jongsma 2015-01-30 16:32:02 -06:00 committed by Frediano Ziglio
parent d576c76a70
commit a8dc9b0936
3 changed files with 11 additions and 8 deletions

View File

@ -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_

View File

@ -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);
}

View File

@ -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;