提交 be6f9427 编写于 作者: M Marc-André Lureau 提交者: Michal Privoznik

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: NMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 fbc4e81a
......@@ -258,6 +258,7 @@ qemuSlirpStart(qemuSlirpPtr slirp,
int exitstatus = 0;
int cmdret = 0;
VIR_AUTOCLOSE errfd = -1;
bool killDBusDaemon = false;
if (incoming &&
!qemuSlirpHasFeature(slirp, QEMU_SLIRP_FEATURE_MIGRATE)) {
......@@ -306,6 +307,9 @@ qemuSlirpStart(qemuSlirpPtr slirp,
g_autofree char *id = qemuSlirpGetDBusVMStateId(net);
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)
return -1;
......@@ -355,6 +359,7 @@ qemuSlirpStart(qemuSlirpPtr slirp,
virProcessKillPainfully(pid, true);
if (pidfile)
unlink(pidfile);
qemuDBusStop(driver, vm);
if (killDBusDaemon)
qemuDBusStop(driver, vm);
return -1;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册