[libvirt] [PATCH] cygwin: fix abort of virsh on my system

Stefan Berger stefanb at us.ibm.com
Thu May 6 18:11:36 UTC 2010


This strange patch fixes aborts of virsh on my system. It seems that the
string returned by xmlSaveUri is owned by the xml library??

Signed-off-by: Stefan Berger <stefanb at us.ibm.com>

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 317125f..a916b86 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -542,6 +542,9 @@ doRemoteOpen (virConnectPtr conn,
                 }
 
                 name = (char *) xmlSaveUri (&tmpuri);
+#ifdef __CYGWIN__
+                name = strdup(name);
+#endif
 
 #ifdef HAVE_XMLURI_QUERY_RAW
                 VIR_FREE(tmpuri.query_raw);





More information about the libvir-list mailing list