提交 e1424a97 编写于 作者: D Daniel P. Berrange

Fix memory leak of monitor character device

* src/qemu_driver.c: Free the vm->monitor_chr field at VM shutdown.
  Unlink the UNIX domain socket at VM shutdown to avoid littering
  FS with old sockets
上级 2a6825c3
......@@ -2285,6 +2285,13 @@ static void qemudShutdownVMDaemon(virConnectPtr conn,
close(vm->monitor);
vm->monitor = -1;
if (vm->monitor_chr) {
if (vm->monitor_chr->type == VIR_DOMAIN_CHR_TYPE_UNIX)
unlink(vm->monitor_chr->data.nix.path);
virDomainChrDefFree(vm->monitor_chr);
vm->monitor_chr = NULL;
}
/* shut it off for sure */
virKillProcess(vm->pid, SIGKILL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册