mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
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
This commit is contained in:
parent
2a6825c393
commit
e1424a97a9
@ -2285,6 +2285,13 @@ static void qemudShutdownVMDaemon(virConnectPtr conn,
|
|||||||
close(vm->monitor);
|
close(vm->monitor);
|
||||||
vm->monitor = -1;
|
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 */
|
/* shut it off for sure */
|
||||||
virKillProcess(vm->pid, SIGKILL);
|
virKillProcess(vm->pid, SIGKILL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user