Defining a xen domain will succeed, but report
error because we weren't properly passing the
domain's name to the post-define lookup.

Attached patch fixes this, and also adds a
debug statement to show the sexpr we create
from the passed xml.

Thanks,
Cole
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 2a687c3..124ee8b 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -4270,7 +4270,6 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
 virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) 
{
     int ret;
     char *sexpr;
-    char *name = NULL;
     virDomainPtr dom;
     xenUnifiedPrivatePtr priv;
     virDomainDefPtr def;
@@ -4292,15 +4291,17 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr 
conn, const char *xmlDesc) {
         goto error;
     }
 
+    DEBUG("Defining w/ sexpr: \n%s", sexpr);
+
     ret = xend_op(conn, "", "op", "new", "config", sexpr, NULL);
     VIR_FREE(sexpr);
     if (ret != 0) {
         virXendError(conn, VIR_ERR_XEN_CALL,
-                     _("Failed to create inactive domain %s\n"), name);
+                     _("Failed to create inactive domain %s\n"), def->name);
         goto error;
     }
 
-    dom = virDomainLookupByName(conn, name);
+    dom = virDomainLookupByName(conn, def->name);
     if (dom == NULL) {
         goto error;
     }
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to