mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-06 20:27:43 +00:00
Remove core parameter from main_dispatcher_new
This was added in bd8771adbc.
There's no reason to not use reds function instead.
MainDispatcher needs to listen in the main thread that is the
one provided by reds_core_* functions.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
b9e24dba58
commit
a7a8487d0f
@ -48,7 +48,6 @@
|
||||
*/
|
||||
struct MainDispatcherPrivate
|
||||
{
|
||||
SpiceCoreInterfaceInternal *core; /* weak */
|
||||
RedsState *reds; /* weak */
|
||||
SpiceWatch *watch;
|
||||
};
|
||||
@ -58,7 +57,6 @@ G_DEFINE_TYPE_WITH_PRIVATE(MainDispatcher, main_dispatcher, TYPE_DISPATCHER)
|
||||
enum {
|
||||
PROP0,
|
||||
PROP_SPICE_SERVER,
|
||||
PROP_CORE_INTERFACE
|
||||
};
|
||||
|
||||
static void
|
||||
@ -73,9 +71,6 @@ main_dispatcher_get_property(GObject *object,
|
||||
case PROP_SPICE_SERVER:
|
||||
g_value_set_pointer(value, self->priv->reds);
|
||||
break;
|
||||
case PROP_CORE_INTERFACE:
|
||||
g_value_set_pointer(value, self->priv->core);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
@ -93,9 +88,6 @@ main_dispatcher_set_property(GObject *object,
|
||||
case PROP_SPICE_SERVER:
|
||||
self->priv->reds = g_value_get_pointer(value);
|
||||
break;
|
||||
case PROP_CORE_INTERFACE:
|
||||
self->priv->core = g_value_get_pointer(value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
|
||||
}
|
||||
@ -121,14 +113,6 @@ main_dispatcher_class_init(MainDispatcherClass *klass)
|
||||
"The spice server associated with this dispatcher",
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY));
|
||||
|
||||
g_object_class_install_property(object_class,
|
||||
PROP_CORE_INTERFACE,
|
||||
g_param_spec_pointer("core-interface",
|
||||
"core-interface",
|
||||
"The SpiceCoreInterface server associated with this dispatcher",
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -284,11 +268,10 @@ static void dispatcher_handle_read(int fd, int event, void *opaque)
|
||||
* Reds routines shouldn't be exposed. Instead reds.c should register the callbacks,
|
||||
* and the corresponding operations should be made only via main_dispatcher.
|
||||
*/
|
||||
MainDispatcher* main_dispatcher_new(RedsState *reds, SpiceCoreInterfaceInternal *core)
|
||||
MainDispatcher* main_dispatcher_new(RedsState *reds)
|
||||
{
|
||||
MainDispatcher *self = g_object_new(TYPE_MAIN_DISPATCHER,
|
||||
"spice-server", reds,
|
||||
"core-interface", core,
|
||||
"max-message-type", MAIN_DISPATCHER_NUM_MESSAGES,
|
||||
NULL);
|
||||
return self;
|
||||
@ -302,10 +285,10 @@ void main_dispatcher_constructed(GObject *object)
|
||||
dispatcher_set_opaque(DISPATCHER(self), self);
|
||||
|
||||
self->priv->watch =
|
||||
self->priv->core->watch_add(self->priv->core,
|
||||
dispatcher_get_recv_fd(DISPATCHER(self)),
|
||||
SPICE_WATCH_EVENT_READ, dispatcher_handle_read,
|
||||
DISPATCHER(self));
|
||||
reds_core_watch_add(self->priv->reds,
|
||||
dispatcher_get_recv_fd(DISPATCHER(self)),
|
||||
SPICE_WATCH_EVENT_READ, dispatcher_handle_read,
|
||||
DISPATCHER(self));
|
||||
dispatcher_register_handler(DISPATCHER(self), MAIN_DISPATCHER_CHANNEL_EVENT,
|
||||
main_dispatcher_handle_channel_event,
|
||||
sizeof(MainDispatcherChannelEventMessage), false);
|
||||
@ -324,7 +307,7 @@ static void main_dispatcher_finalize(GObject *object)
|
||||
{
|
||||
MainDispatcher *self = MAIN_DISPATCHER(object);
|
||||
|
||||
self->priv->core->watch_remove(self->priv->core, self->priv->watch);
|
||||
reds_core_watch_remove(self->priv->reds, self->priv->watch);
|
||||
self->priv->watch = NULL;
|
||||
G_OBJECT_CLASS(main_dispatcher_parent_class)->finalize(object);
|
||||
}
|
||||
|
||||
@ -59,6 +59,6 @@ void main_dispatcher_set_mm_time_latency(MainDispatcher *self, RedClient *client
|
||||
*/
|
||||
void main_dispatcher_client_disconnect(MainDispatcher *self, RedClient *client);
|
||||
|
||||
MainDispatcher* main_dispatcher_new(RedsState *reds, SpiceCoreInterfaceInternal *core);
|
||||
MainDispatcher* main_dispatcher_new(RedsState *reds);
|
||||
|
||||
#endif /* MAIN_DISPATCHER_H_ */
|
||||
|
||||
@ -3504,7 +3504,7 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
|
||||
reds->agent_dev = red_char_device_vdi_port_new(reds);
|
||||
reds_update_agent_properties(reds);
|
||||
reds->clients = NULL;
|
||||
reds->main_dispatcher = main_dispatcher_new(reds, &reds->core);
|
||||
reds->main_dispatcher = main_dispatcher_new(reds);
|
||||
reds->channels = NULL;
|
||||
reds->mig_target_clients = NULL;
|
||||
reds->char_devices = NULL;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user