mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-26 08:50:33 +01:00
ovsdb: register a shutdown objects for in-flight calls
Once the shutdown logic is in place, we don't want to shut down until the OVSDB calls are serviced.
This commit is contained in:
parent
47ff99515f
commit
be414f1ce7
1 changed files with 10 additions and 5 deletions
|
|
@ -104,6 +104,7 @@ typedef struct {
|
|||
OvsdbMethodCallback callback;
|
||||
gpointer user_data;
|
||||
OvsdbMethodPayload payload;
|
||||
GObject *shutdown_wait_obj;
|
||||
} OvsdbMethodCall;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
@ -245,6 +246,8 @@ static NM_UTILS_LOOKUP_STR_DEFINE(_device_type_to_table,
|
|||
static void
|
||||
_call_complete(OvsdbMethodCall *call, json_t *response, GError *error)
|
||||
{
|
||||
g_clear_object(&call->shutdown_wait_obj);
|
||||
|
||||
if (response) {
|
||||
gs_free char *str = NULL;
|
||||
|
||||
|
|
@ -378,12 +381,14 @@ ovsdb_call_method(NMOvsdb *self,
|
|||
|
||||
call = g_slice_new(OvsdbMethodCall);
|
||||
*call = (OvsdbMethodCall){
|
||||
.self = self,
|
||||
.call_id = CALL_ID_UNSPEC,
|
||||
.command = command,
|
||||
.callback = callback,
|
||||
.user_data = user_data,
|
||||
.self = self,
|
||||
.call_id = CALL_ID_UNSPEC,
|
||||
.command = command,
|
||||
.callback = callback,
|
||||
.user_data = user_data,
|
||||
.shutdown_wait_obj = g_object_new(G_TYPE_OBJECT, NULL),
|
||||
};
|
||||
nm_shutdown_wait_obj_register_object(call->shutdown_wait_obj, "ovsdb-call");
|
||||
|
||||
if (add_first)
|
||||
c_list_link_front(&priv->calls_lst_head, &call->calls_lst);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue