mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-27 13:52:20 +00:00
slirp: leave the dbus daemon running on error
Don't stop the DBus daemon if a slirp helper failed to start, as it may be shared with other helpers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
fbc4e81a36
commit
be6f94277e
@ -258,6 +258,7 @@ qemuSlirpStart(qemuSlirpPtr slirp,
|
|||||||
int exitstatus = 0;
|
int exitstatus = 0;
|
||||||
int cmdret = 0;
|
int cmdret = 0;
|
||||||
VIR_AUTOCLOSE errfd = -1;
|
VIR_AUTOCLOSE errfd = -1;
|
||||||
|
bool killDBusDaemon = false;
|
||||||
|
|
||||||
if (incoming &&
|
if (incoming &&
|
||||||
!qemuSlirpHasFeature(slirp, QEMU_SLIRP_FEATURE_MIGRATE)) {
|
!qemuSlirpHasFeature(slirp, QEMU_SLIRP_FEATURE_MIGRATE)) {
|
||||||
@ -306,6 +307,9 @@ qemuSlirpStart(qemuSlirpPtr slirp,
|
|||||||
g_autofree char *id = qemuSlirpGetDBusVMStateId(net);
|
g_autofree char *id = qemuSlirpGetDBusVMStateId(net);
|
||||||
g_autofree char *dbus_addr = qemuDBusGetAddress(driver, vm);
|
g_autofree char *dbus_addr = qemuDBusGetAddress(driver, vm);
|
||||||
|
|
||||||
|
/* If per VM DBus daemon is not running yet, start it
|
||||||
|
* now. But if we fail later on, make sure to kill it. */
|
||||||
|
killDBusDaemon = !QEMU_DOMAIN_PRIVATE(vm)->dbusDaemonRunning;
|
||||||
if (qemuDBusStart(driver, vm) < 0)
|
if (qemuDBusStart(driver, vm) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -355,6 +359,7 @@ qemuSlirpStart(qemuSlirpPtr slirp,
|
|||||||
virProcessKillPainfully(pid, true);
|
virProcessKillPainfully(pid, true);
|
||||||
if (pidfile)
|
if (pidfile)
|
||||||
unlink(pidfile);
|
unlink(pidfile);
|
||||||
|
if (killDBusDaemon)
|
||||||
qemuDBusStop(driver, vm);
|
qemuDBusStop(driver, vm);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user