[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, wheezy, updated. debian/0.9.12-11-5-gce7ef48
Guido Günther
agx at sigxcpu.org
Sat Jun 8 14:06:49 UTC 2013
The following commit has been merged in the wheezy branch:
commit ce7ef48b717acd5404ec801041cc79ead5341161
Author: Ferenc Wagner <wferi at niif.hu>
Date: Sat Jun 8 15:31:08 2013 +0200
Fix libvirtd crash when destroying a domain with attached console
Closes: #710517
diff --git a/debian/patches/series b/debian/patches/series
index 5e1cbe7..8ab62fe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,4 @@ rpc-Fix-crash-on-error-paths-of-message-dispatching.patch
qemu-Add-support-for-no-user-config.patch
debian/Allow-xen-toolstack-to-find-it-s-binaries.patch
fix-leak-virStorageBackendLogicalMakeVol.patch
+upstream/Fix-libvirtd-crash-when-destroying-a-domain-with-att.patch
diff --git a/debian/patches/upstream/Fix-libvirtd-crash-when-destroying-a-domain-with-att.patch b/debian/patches/upstream/Fix-libvirtd-crash-when-destroying-a-domain-with-att.patch
new file mode 100644
index 0000000..62899fa
--- /dev/null
+++ b/debian/patches/upstream/Fix-libvirtd-crash-when-destroying-a-domain-with-att.patch
@@ -0,0 +1,72 @@
+From: Peter Krempa <pkrempa at redhat.com>
+Date: Sat, 8 Jun 2013 15:20:45 +0200
+Subject: Fix libvirtd crash when destroying a domain with attached console
+
+Origin: upstream
+Bug: https://bugzilla.redhat.com/show_bug.cgi?id=969497
+Applied-Upstream: ba226d334acbc49f6751b430e0c4e00f69eef6bf and 45edefc7a7bcbec988f54331ff37fc32e4bc2718
+Last-Update: 2013-06-07
+
+This is two upstream commits squashed:
+
+commit ba226d334acbc49f6751b430e0c4e00f69eef6bf
+Author: Peter Krempa <pkrempa at redhat.com>
+Date: Fri Jul 27 14:50:54 2012 +0200
+
+ conf: Remove callback from stream when freeing entries in console hash
+
+ When a domain has a active console connection and is destroyed the
+ callback is called on private data that no longer exist causing a
+ segfault.
+
+commit 45edefc7a7bcbec988f54331ff37fc32e4bc2718
+Author: Peter Krempa <pkrempa at redhat.com>
+Date: Fri Aug 3 11:20:29 2012 +0200
+
+ conf: Remove console stream callback only when freeing console helper
+
+ Commit ba226d334acbc49f6751b430e0c4e00f69eef6bf tried to fix crash of
+ the daemon when a domain with an open console was destroyed. The fix was
+ wrong as it tried to remove the callback also when the stream was
+ aborted, where at that point the fd stream driver was already freed and
+ removed.
+
+ This patch clears the callbacks with a helper right before the hash is
+ freed, so that it doesn't interfere with other codepaths where the
+ stream object is freed.
+
+---
+ src/conf/virconsole.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
+index 443d80d..01f1c84 100644
+--- a/src/conf/virconsole.c
++++ b/src/conf/virconsole.c
+@@ -290,6 +290,18 @@ error:
+ }
+
+ /**
++ * Helper to clear stream callbacks when freeing the hash
++ */
++static void virConsoleFreeClearCallbacks(void *payload,
++ const void *name ATTRIBUTE_UNUSED,
++ void *data ATTRIBUTE_UNUSED)
++{
++ virStreamPtr st = payload;
++
++ virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
++}
++
++/**
+ * Free structures for handling open console streams.
+ *
+ * @cons Pointer to the private structure.
+@@ -300,6 +312,7 @@ void virConsoleFree(virConsolesPtr cons)
+ return;
+
+ virMutexLock(&cons->lock);
++ virHashForEach(cons->hash, virConsoleFreeClearCallbacks, NULL);
+ virHashFree(cons->hash);
+ virMutexUnlock(&cons->lock);
+ virMutexDestroy(&cons->lock);
--
Libvirt Debian packaging
More information about the Pkg-libvirt-commits
mailing list