[libvirt] [PATCH] xen: Avoid double free of virDomainDef in xenDaemonCreateXML

Beside dumpxml still being broken with the xen driver (hint [1] ;) ) there is also a quite annoying problem of creating new definitions now failing. Using virt-manager this even disrupts the connection to the host and the guest is not created persistent although it does come up. -Stefan [1] https://www.redhat.com/archives/libvir-list/2013-July/msg01183.html
From 0e90fac9004996a6517ce1bd4d7b9c6ebef6c45c Mon Sep 17 00:00:00 2001 From: Stefan Bader <stefan.bader@canonical.com> Date: Tue, 30 Jul 2013 20:48:33 +0200 Subject: [PATCH] xen: Avoid double free of virDomainDef in xenDaemonCreateXML
The virDomainDef is allocated by the caller and also used after calling to xenDaemonCreateXML. So it must not get freed by the callee. Signed-off-by: Stefan Bader <stefan.bader@canonical.com> --- src/xen/xend_internal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 9d61fca..1ce36e6 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -2171,7 +2171,6 @@ xenDaemonCreateXML(virConnectPtr conn, virDomainDefPtr def) if (xenDaemonDomainResume(conn, def) < 0) goto error; - virDomainDefFree(def); return 0; error: -- 1.8.1.2

Stefan Bader wrote:
Beside dumpxml still being broken with the xen driver (hint [1] ;) )
Hmm, not sure how I overlooked that, sorry. My day is nearing a close, so might not get to it until tomorrow.
there is also a quite annoying problem of creating new definitions now failing. Using virt-manager this even disrupts the connection to the host and the guest is not created persistent although it does come up.
-Stefan
[1] https://www.redhat.com/archives/libvir-list/2013-July/msg01183.html
From 0e90fac9004996a6517ce1bd4d7b9c6ebef6c45c Mon Sep 17 00:00:00 2001 From: Stefan Bader <stefan.bader@canonical.com> Date: Tue, 30 Jul 2013 20:48:33 +0200 Subject: [PATCH] xen: Avoid double free of virDomainDef in xenDaemonCreateXML
The virDomainDef is allocated by the caller and also used after calling to xenDaemonCreateXML. So it must not get freed by the callee.
Yep, freeing the virDomainDef in xenDaemonCreateXML should have been removed in commit 18b14012. ACK and pushed. Thanks! Regards, Jim
Signed-off-by: Stefan Bader <stefan.bader@canonical.com> --- src/xen/xend_internal.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 9d61fca..1ce36e6 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -2171,7 +2171,6 @@ xenDaemonCreateXML(virConnectPtr conn, virDomainDefPtr def) if (xenDaemonDomainResume(conn, def) < 0) goto error;
- virDomainDefFree(def); return 0;
error:
participants (2)
-
Jim Fehlig
-
Stefan Bader