clang complained about the dead store.
Dan Berrange confirmed that this code has been useless-looking for ages.
From e6315e0b0d4b83b744cff86529b6b9e3144e2012 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 7 Apr 2010 20:17:44 +0200
Subject: [PATCH] xenXMDomainDefineXML: remove dead store and useless/leaky virGetDomain
* src/xen/xm_internal.c (xenXMDomainDefineXML): Remove useless and
leak-inducing call to virGetDomain, as well as decl of now-unused local.
---
src/xen/xm_internal.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index d1265ba..a7a09a0 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -2622,7 +2622,6 @@ cleanup:
*/
virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
virDomainPtr ret;
- virDomainPtr olddomain;
char filename[PATH_MAX];
const char * oldfilename;
virDomainDefPtr def = NULL;
@@ -2688,10 +2687,6 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char
*xml) {
goto error;
}
- /* XXX
wtf.com is this line for - it appears to be amemory leak */
- if (!(olddomain = virGetDomain(conn, def->name, entry->def->uuid)))
- goto error;
-
/* Remove the name -> filename mapping */
if (virHashRemoveEntry(priv->nameConfigMap, def->name, NULL) < 0) {
xenXMError(VIR_ERR_INTERNAL_ERROR,
--
1.7.1.rc0.212.gbd88f