mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
char-device: Allow to more safely and quickly get device instance
This information is retrieved multiple time. Avoid to use just g_object_get which is dynamic so potentially unsafe and slow. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
8a8bd3e1c8
commit
8ec691f056
@ -1164,6 +1164,11 @@ SPICE_GNUC_VISIBLE void spice_server_port_event(SpiceCharDeviceInstance *sin, ui
|
||||
return klass->port_event(sin->st, event);
|
||||
}
|
||||
|
||||
SpiceCharDeviceInstance *red_char_device_get_device_instance(RedCharDevice *dev)
|
||||
{
|
||||
return dev->priv->sin;
|
||||
}
|
||||
|
||||
static void
|
||||
red_char_device_init(RedCharDevice *self)
|
||||
{
|
||||
|
||||
@ -243,6 +243,8 @@ RedCharDevice *spicevmc_device_connect(RedsState *reds,
|
||||
uint8_t channel_type);
|
||||
void spicevmc_device_disconnect(SpiceCharDeviceInstance *char_device);
|
||||
|
||||
SpiceCharDeviceInstance *red_char_device_get_device_instance(RedCharDevice *dev);
|
||||
|
||||
SpiceCharDeviceInterface *spice_char_device_get_interface(SpiceCharDeviceInstance *instance);
|
||||
|
||||
#endif /* CHAR_DEVICE_H_ */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user