[libvirt] Patch for BUG ID 994657

Hi All, Here is the change I made to address the SIGSEGV we were seeing in libvirtd when attempting to create a new VM via virt-install: - We call virDomainDefFree after xenDaemonCreateXML returns to xenUnifiedDomainCreateXML. - xenUnifiedDomainCreateXML passes def to virGetDomain after XenDaemonCreateXML returns and before it calls virGetDomain. - xenUnifiedDomainCreateXML calls virDomainDefFree(def) when it's done with def, so no need to free inside xenUnifiedDomainCreateXML. ------------------------ patch ------------------------- --- /tmp/xend_internal.c 2013-08-07 12:03:03.000000000 -0600 +++ src/xen/xend_internal.c 2013-08-07 08:51:49.000000000 -0600 @@ -2171,7 +2171,9 @@ if (xenDaemonDomainResume(conn, def) < 0) goto error; - virDomainDefFree(def); + // We call this a little later and still want to use def, so + // don't free it just yet. + //virDomainDefFree(def); return 0;

On 08/07/2013 12:07 PM, Schmaus, John M. (John) wrote:
Hi All,
Here is the change I made to address the SIGSEGV we were seeing in libvirtd when attempting to create a new VM via virt-install:
Thanks for taking time to identify a problem and propose a patch. Your patch didn't apply via 'git am' (see HACKING for details on how to submit a patch that is friendlier to reviewers). Also, your patch uses C99 // comments, which we prefer not to have in our code base. Finally, Stefan Bader beat you to the punch: commit 9d0557b9655fe4a3f31af2e1cc2f33de8acfaa7d Author: Stefan Bader <stefan.bader@canonical.com> Date: Wed Jul 31 11:59:21 2013 +0200 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> As such, I've gone ahead and closed bug 994657. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Schmaus, John M. (John)