提交 205010c4 编写于 作者: J Ján Tomko

Clean up chardev sockets on QEMU shutdown

https://bugzilla.redhat.com/show_bug.cgi?id=1088787

Clean up unix socket files for chardevs using mode='bind',
like we clean up the monitor socket.
They are created by QEMU on startup and not really useful
after shutting it down.
上级 cde8ca2d
......@@ -2659,6 +2659,19 @@ qemuProcessPrepareChardevDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
}
static int
qemuProcessCleanupChardevDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
virDomainChrDefPtr dev,
void *opaque ATTRIBUTE_UNUSED)
{
if (dev->source.type == VIR_DOMAIN_CHR_TYPE_UNIX &&
dev->source.data.nix.listen)
unlink(dev->source.data.nix.path);
return 0;
}
struct qemuProcessHookData {
virConnectPtr conn;
virDomainObjPtr vm;
......@@ -4353,6 +4366,12 @@ void qemuProcessStop(virQEMUDriverPtr driver,
priv->monConfig = NULL;
}
ignore_value(virDomainChrDefForeach(vm->def,
false,
qemuProcessCleanupChardevDevice,
NULL));
/* shut it off for sure */
ignore_value(qemuProcessKill(vm,
VIR_QEMU_PROCESS_KILL_FORCE|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册