SHA256
1
0
forked from pool/libvirt
libvirt/67c56f6e-libxl-logfd-leak-fix.patch
James Fehlig 4d2c547eb1 Accepting request 614408 from home:jfehlig:branches:Virtualization
- spec: use wireshark plugin directory from pkg-config

- virt-aa-helper: add SUSE path to OVMF and AAVMF images
  Adjusted suse-ovmf-paths.patch
  boo#1095556

- Update to libvirt 4.4.0
  - Many incremental improvements and bug fixes, see
    http://libvirt.org/news.html
  - CVE-2018-3639
  - Dropped patches:
    1dbca2ec-CVE-2018-3639.patch, 92673422-CVE-2018-3639.patch
- libxl: fix leaking logfile fds
  67c56f6e-libxl-logfd-leak-fix.patch
  bsc#1094480

OBS-URL: https://build.opensuse.org/request/show/614408
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=691
2018-06-05 23:59:32 +00:00

43 lines
1.6 KiB
Diff

commit 67c56f6e65b9cd2681ef1bc61d8b51cbc543fa42
Author: Jim Fehlig <jfehlig@suse.com>
Date: Thu May 31 15:41:37 2018 -0600
libxl: fix leaking logfile fds
Per-domain log files were introduced in commit a30b08b7179. The FILE
objects associated with these log files are stored in a hash table
using domid as a key. When a domain is shutdown, destroyed, or
otherwise powered-off, the FILE object is removed from the hash table,
where the free function will close the FILE.
Unfortunately the call to remove the FILE from the hash table occurs
after setting domid=-1 in the libxlDomainCleanup() function. The
object is never removed from the hash table, the free function is
never called, and the underlying fd is leaked. Fix by removing the
FILE object from the hash table before setting domid=-1.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index d4859d6707..d12b1b1b4b 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -769,6 +769,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
VIR_WARN("Unable to release lease on %s", vm->def->name);
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
+ libxlLoggerCloseFile(cfg->logger, vm->def->id);
vm->def->id = -1;
if (priv->deathW) {
@@ -822,8 +823,6 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
VIR_FREE(xml);
}
- libxlLoggerCloseFile(cfg->logger, vm->def->id);
-
virDomainObjRemoveTransientDef(vm);
virObjectUnref(cfg);
}