[libvirt] [PATCH 2/2] conf: Remove callback from stream when freeing entries in console hash

Peter Krempa pkrempa at redhat.com
Fri Jul 27 13:44:36 UTC 2012


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.
---
 src/conf/virconsole.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/conf/virconsole.c b/src/conf/virconsole.c
index 3d12011..912aff6 100644
--- a/src/conf/virconsole.c
+++ b/src/conf/virconsole.c
@@ -219,6 +219,9 @@ static void virConsoleHashEntryFree(void *data,
     const char *pty = name;
     virStreamPtr st = data;

+    /* remove callback from stream */
+    virFDStreamSetInternalCloseCb(st, NULL, NULL, NULL);
+
     /* free stream reference */
     virStreamFree(st);

-- 
1.7.8.6




More information about the libvir-list mailing list