1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-30 18:50:18 +03:00

rpc: don't unconditionally quit after preserving state

The call to preserve state (ie running VMs) is triggered in response to
the desktop session dbus terminating (session daemon), or logind sending
a "PrepareForShutdown" signal. In the case of the latter, daemons
should only save their state, not actually exit yet. Other things on the
system may still expect the daemon to be running at this stage.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2025-01-07 10:27:21 +00:00
parent 1cad0a1c78
commit 4acd18b5b8
2 changed files with 3 additions and 2 deletions

View File

@ -526,8 +526,10 @@ handleSessionMessageFunc(GDBusConnection *connection G_GNUC_UNUSED,
if (virGDBusMessageIsSignal(message,
"org.freedesktop.DBus.Local",
"Disconnected"))
"Disconnected")) {
virNetDaemonStop(dmn);
virNetDaemonQuit(dmn);
}
return message;
}

View File

@ -840,7 +840,6 @@ virNetDaemonStopWorker(void *opaque)
VIR_DEBUG("Completed stop dmn=%p", dmn);
virNetDaemonQuit(dmn);
virObjectUnref(dmn);
}