]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Prepare xm_internal driver for new domain XML apis
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 25 Jul 2008 13:39:02 +0000 (13:39 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 25 Jul 2008 13:39:02 +0000 (13:39 +0000)
48 files changed:
ChangeLog
src/xm_internal.c
src/xm_internal.h
tests/Makefile.am
tests/xmconfigdata/test-escape-paths.cfg
tests/xmconfigdata/test-escape-paths.xml
tests/xmconfigdata/test-fullvirt-localtime.cfg
tests/xmconfigdata/test-fullvirt-localtime.xml
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg
tests/xmconfigdata/test-fullvirt-new-cdrom.xml
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg
tests/xmconfigdata/test-fullvirt-old-cdrom.xml
tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg
tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
tests/xmconfigdata/test-fullvirt-serial-file.cfg
tests/xmconfigdata/test-fullvirt-serial-file.xml
tests/xmconfigdata/test-fullvirt-serial-null.cfg
tests/xmconfigdata/test-fullvirt-serial-null.xml
tests/xmconfigdata/test-fullvirt-serial-pipe.cfg
tests/xmconfigdata/test-fullvirt-serial-pipe.xml
tests/xmconfigdata/test-fullvirt-serial-pty.cfg
tests/xmconfigdata/test-fullvirt-serial-pty.xml
tests/xmconfigdata/test-fullvirt-serial-stdio.cfg
tests/xmconfigdata/test-fullvirt-serial-stdio.xml
tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.cfg
tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
tests/xmconfigdata/test-fullvirt-serial-tcp.cfg
tests/xmconfigdata/test-fullvirt-serial-tcp.xml
tests/xmconfigdata/test-fullvirt-serial-udp.cfg
tests/xmconfigdata/test-fullvirt-serial-udp.xml
tests/xmconfigdata/test-fullvirt-serial-unix.cfg
tests/xmconfigdata/test-fullvirt-serial-unix.xml
tests/xmconfigdata/test-fullvirt-sound.cfg
tests/xmconfigdata/test-fullvirt-sound.xml
tests/xmconfigdata/test-fullvirt-usbmouse.cfg
tests/xmconfigdata/test-fullvirt-usbmouse.xml
tests/xmconfigdata/test-fullvirt-usbtablet-no-bus.xml
tests/xmconfigdata/test-fullvirt-usbtablet.cfg
tests/xmconfigdata/test-fullvirt-usbtablet.xml
tests/xmconfigdata/test-fullvirt-utc.cfg
tests/xmconfigdata/test-fullvirt-utc.xml
tests/xmconfigdata/test-paravirt-net-e1000.cfg
tests/xmconfigdata/test-paravirt-net-e1000.xml
tests/xmconfigdata/test-paravirt-new-pvfb.cfg
tests/xmconfigdata/test-paravirt-new-pvfb.xml
tests/xmconfigdata/test-paravirt-old-pvfb.cfg
tests/xmconfigdata/test-paravirt-old-pvfb.xml
tests/xmconfigtest.c

index c858137ad45098455b5e0ba0d58de5a7adbee163..2b82349c8913827c25904e565d1efe8e0738cc1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Fri Jul 25 14:29:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
+
+       Prepare xm_internal driver for new domain XML apis.
+
+       * src/xm_internal.c, src/xm_internal.h: Track internal
+       domain objects as virDomainDefPtr instead of virConfPtr
+       objects, and start to use generic domain APIs
+       * tests/xmconfigdata/*: Update to follow XML ordering
+       for new APIs
+       * tests/xmconfigtest.c: Fixup to comply with new internal
+       APIs.
+
 Fri Jul 25 14:00:27 BST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        * src/test.c: Increment dom ID tracker when setting up
index 8590e2aea6b934ae6592690b1cafc15614c80401..47caec3a44947a06ba737480f64a6db24d75378e 100644 (file)
@@ -47,7 +47,6 @@
 #include "xen_unified.h"
 #include "xm_internal.h"
 #include "xend_internal.h"
-#include "conf.h"
 #include "hash.h"
 #include "internal.h"
 #include "xml.h"
 #include "util.h"
 #include "memory.h"
 
+/* The true Xen limit varies but so far is always way
+   less than 1024, which is the Linux kernel limit according
+   to sched.h, so we'll match that for now */
+#define XEN_MAX_PHYSICAL_CPU 1024
+
 static int xenXMConfigSetString(virConfPtr conf, const char *setting,
                                 const char *str);
 
@@ -63,7 +67,7 @@ typedef struct xenXMConfCache *xenXMConfCachePtr;
 typedef struct xenXMConfCache {
     time_t refreshedAt;
     char filename[PATH_MAX];
-    virConfPtr conf;
+    virDomainDefPtr def;
 } xenXMConfCache;
 
 static char configDir[PATH_MAX];
@@ -75,10 +79,6 @@ static int nconnections = 0;
 static time_t lastRefresh = 0;
 
 char * xenXMAutoAssignMac(void);
-static int xenXMAttachDisk(virDomainPtr domain, xmlXPathContextPtr ctxt, int hvm,
-                            xmlNodePtr node, xenXMConfCachePtr entry);
-static int xenXMAttachInterface(virDomainPtr domain, xmlXPathContextPtr ctxt, int hvm,
-                                xmlNodePtr node, xenXMConfCachePtr entry);
 static int xenXMDomainAttachDevice(virDomainPtr domain, const char *xml);
 static int xenXMDomainDetachDevice(virDomainPtr domain, const char *xml);
 
@@ -233,59 +233,10 @@ static int xenXMConfigGetUUID(virConfPtr conf, const char *name, unsigned char *
 }
 
 
-/* Ensure that a config object has a valid UUID in it,
-   if it doesn't then (re-)generate one */
-static int xenXMConfigEnsureIdentity(virConfPtr conf, const char *filename) {
-    unsigned char uuid[VIR_UUID_BUFLEN];
-    const char *name;
-
-    /* Had better have a name...*/
-    if (xenXMConfigGetString(conf, "name", &name) < 0) {
-        virConfValuePtr value;
-        if (VIR_ALLOC(value) < 0)
-            return (-1);
-
-        /* Set name based on filename */
-        value->type = VIR_CONF_STRING;
-        value->str = strdup(filename);
-        if (!value->str) {
-            VIR_FREE(value);
-            return (-1);
-        }
-        if (virConfSetValue(conf, "name", value) < 0)
-            return (-1);
-    }
-
-    /* If there is no uuid...*/
-    if (xenXMConfigGetUUID(conf, "uuid", uuid) < 0) {
-        virConfValuePtr value;
-        char uuidstr[VIR_UUID_STRING_BUFLEN];
-
-        if (VIR_ALLOC(value) < 0)
-            return (-1);
-
-        /* ... then generate one */
-        virUUIDGenerate(uuid);
-        virUUIDFormat(uuid, uuidstr);
-
-        value->type = VIR_CONF_STRING;
-        value->str = strdup(uuidstr);
-        if (!value->str) {
-            VIR_FREE(value);
-            return (-1);
-        }
-
-        /* And stuff the UUID back into the config file */
-        if (virConfSetValue(conf, "uuid", value) < 0)
-            return (-1);
-    }
-    return (0);
-}
-
 /* Release memory associated with a cached config object */
 static void xenXMConfigFree(void *payload, const char *key ATTRIBUTE_UNUSED) {
     xenXMConfCachePtr entry = (xenXMConfCachePtr)payload;
-    virConfFree(entry->conf);
+    virDomainDefFree(entry->def);
     VIR_FREE(entry);
 }
 
@@ -295,21 +246,48 @@ static int xenXMConfigReaper(const void *payload, const char *key ATTRIBUTE_UNUS
     time_t now = *(const time_t *)data;
     xenXMConfCachePtr entry = (xenXMConfCachePtr)payload;
 
+    /* We're going to purge this config file, so check if it
+       is currently mapped as owner of a named domain. */
     if (entry->refreshedAt != now) {
-        const char *olddomname;
-        /* We're going to pure this config file, so check if it
-           is currently mapped as owner of a named domain. */
-        if (xenXMConfigGetString(entry->conf, "name", &olddomname) != -1) {
-            char *nameowner = (char *)virHashLookup(nameConfigMap, olddomname);
-            if (nameowner && STREQ(nameowner, key)) {
-                virHashRemoveEntry(nameConfigMap, olddomname, NULL);
-            }
+        const char *olddomname = entry->def->name;
+        char *nameowner = (char *)virHashLookup(nameConfigMap, olddomname);
+        if (nameowner && STREQ(nameowner, key)) {
+            virHashRemoveEntry(nameConfigMap, olddomname, NULL);
         }
         return (1);
     }
     return (0);
 }
 
+
+static virDomainDefPtr
+xenXMConfigReadFile(virConnectPtr conn, const char *filename) {
+    virConfPtr conf;
+    virDomainDefPtr def;
+
+    if (!(conf = virConfReadFile(filename)))
+        return NULL;
+
+    def = xenXMDomainConfigParse(conn, conf);
+    virConfFree(conf);
+
+    return def;
+}
+
+static int
+xenXMConfigSaveFile(virConnectPtr conn, const char *filename, virDomainDefPtr def) {
+    virConfPtr conf;
+    int ret;
+
+    if (!(conf = xenXMDomainConfigFormat(conn, def)))
+        return -1;
+
+    ret = virConfWriteFile(filename, conf);
+    virConfFree(conf);
+    return ret;
+}
+
+
 /* This method is called by various methods to scan /etc/xen
    (or whatever directory was set by  LIBVIRT_XM_CONFIG_DIR
    environment variable) and process any domain configs. It
@@ -343,7 +321,6 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
         struct stat st;
         int newborn = 0;
         char path[PATH_MAX];
-        const char *domname = NULL;
 
         /*
          * Skip a bunch of crufty files that clearly aren't config files
@@ -387,7 +364,7 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
         /* If we already have a matching entry and it is not
            modified, then carry on to next one*/
         if ((entry = virHashLookup(configCache, path))) {
-            const char *olddomname = NULL;
+            char *nameowner;
 
             if (entry->refreshedAt >= st.st_mtime) {
                 entry->refreshedAt = now;
@@ -396,16 +373,14 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
 
             /* If we currently own the name, then release it and
                re-acquire it later - just in case it was renamed */
-            if (xenXMConfigGetString(entry->conf, "name", &olddomname) != -1) {
-                char *nameowner = (char *)virHashLookup(nameConfigMap, olddomname);
-                if (nameowner && STREQ(nameowner, path)) {
-                    virHashRemoveEntry(nameConfigMap, olddomname, NULL);
-                }
+            nameowner = (char *)virHashLookup(nameConfigMap, entry->def->name);
+            if (nameowner && STREQ(nameowner, path)) {
+                virHashRemoveEntry(nameConfigMap, entry->def->name, NULL);
             }
 
             /* Clear existing config entry which needs refresh */
-            virConfFree(entry->conf);
-            entry->conf = NULL;
+            virDomainDefFree(entry->def);
+            entry->def = NULL;
         } else { /* Completely new entry */
             newborn = 1;
             if (VIR_ALLOC(entry) < 0) {
@@ -416,31 +391,18 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
         }
         entry->refreshedAt = now;
 
-        if (!(entry->conf = virConfReadFile(entry->filename)) ||
-            xenXMConfigEnsureIdentity(entry->conf, ent->d_name) < 0) {
-            if (!newborn) {
+        if (!(entry->def = xenXMConfigReadFile(conn, entry->filename))) {
+            if (!newborn)
                 virHashRemoveEntry(configCache, path, NULL);
-            }
             VIR_FREE(entry);
             continue;
         }
 
-        /* Lookup what domain name the conf contains */
-        if (xenXMConfigGetString(entry->conf, "name", &domname) < 0) {
-            if (!newborn) {
-                virHashRemoveEntry(configCache, path, NULL);
-            }
-            VIR_FREE(entry);
-            xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
-                        _("xenXMConfigCacheRefresh: name"));
-            goto cleanup;
-        }
-
         /* If its a completely new entry, it must be stuck into
            the cache (refresh'd entries are already registered) */
         if (newborn) {
             if (virHashAddEntry(configCache, entry->filename, entry) < 0) {
-                virConfFree(entry->conf);
+                virDomainDefFree(entry->def);
                 VIR_FREE(entry);
                 xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
                             _("xenXMConfigCacheRefresh: virHashAddEntry"));
@@ -451,10 +413,10 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
         /* See if we need to map this config file in as the primary owner
          * of the domain in question
          */
-        if (!virHashLookup(nameConfigMap, domname)) {
-            if (virHashAddEntry(nameConfigMap, domname, entry->filename) < 0) {
+        if (!virHashLookup(nameConfigMap, entry->def->name)) {
+            if (virHashAddEntry(nameConfigMap, entry->def->name, entry->filename) < 0) {
                 virHashRemoveEntry(configCache, ent->d_name, NULL);
-                virConfFree(entry->conf);
+                virDomainDefFree(entry->def);
                 VIR_FREE(entry);
             }
         }
@@ -529,8 +491,6 @@ int xenXMClose(virConnectPtr conn ATTRIBUTE_UNUSED) {
 int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
     const char *filename;
     xenXMConfCachePtr entry;
-    long vcpus;
-    long mem;
     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
                    __FUNCTION__);
@@ -547,22 +507,9 @@ int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
         return (-1);
 
     memset(info, 0, sizeof(virDomainInfo));
-    if (xenXMConfigGetInt(entry->conf, "memory", &mem) < 0 ||
-        mem < 0)
-        info->memory = MIN_XEN_GUEST_SIZE * 1024 * 2;
-    else
-        info->memory = (unsigned long)mem * 1024;
-    if (xenXMConfigGetInt(entry->conf, "maxmem", &mem) < 0 ||
-        mem < 0)
-        info->maxMem = info->memory;
-    else
-        info->maxMem = (unsigned long)mem * 1024;
-
-    if (xenXMConfigGetInt(entry->conf, "vcpus", &vcpus) < 0 ||
-        vcpus < 0)
-        info->nrVirtCpu = 1;
-    else
-        info->nrVirtCpu = (unsigned short)vcpus;
+    info->maxMem = entry->def->maxmem;
+    info->memory = entry->def->memory;
+    info->nrVirtCpu = entry->def->vcpus;
     info->state = VIR_DOMAIN_SHUTOFF;
     info->cpuTime = 0;
 
@@ -575,7 +522,8 @@ int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
  * Turn a config record into a lump of XML describing the
  * domain, suitable for later feeding for virDomainCreateLinux
  */
-char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
+virDomainDefPtr
+xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     const char *name;
     unsigned char uuid[VIR_UUID_BUFLEN];
@@ -592,6 +540,8 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
     const char *vncpasswd = NULL;
     const char *keymap = NULL;
     xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
+    virDomainDefPtr def = NULL;
+    char *xml;
 
     if (xenXMConfigGetString(conf, "name", &name) < 0)
         return (NULL);
@@ -1080,7 +1030,15 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
         goto error;
     }
 
-    return virBufferContentAndReset(&buf);
+    xml = virBufferContentAndReset(&buf);
+
+    if (!(def = virDomainDefParseString(conn, priv->caps, xml))) {
+        VIR_FREE(xml);
+        return NULL;
+    }
+
+    VIR_FREE(xml);
+    return def;
 
   error:
     str = virBufferContentAndReset(&buf);
@@ -1093,7 +1051,7 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) {
  * Turn a config record into a lump of XML describing the
  * domain, suitable for later feeding for virDomainCreateLinux
  */
-char *xenXMDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) {
+char *xenXMDomainDumpXML(virDomainPtr domain, int flags) {
     const char *filename;
     xenXMConfCachePtr entry;
 
@@ -1111,7 +1069,7 @@ char *xenXMDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) {
     if (!(entry = virHashLookup(configCache, filename)))
         return (NULL);
 
-    return xenXMDomainFormatXML(domain->conn, entry->conf);
+    return virDomainDefFormat(domain->conn, entry->def, flags);
 }
 
 
@@ -1121,7 +1079,6 @@ char *xenXMDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) {
 int xenXMDomainSetMemory(virDomainPtr domain, unsigned long memory) {
     const char *filename;
     xenXMConfCachePtr entry;
-    virConfValuePtr value;
 
     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
@@ -1139,19 +1096,14 @@ int xenXMDomainSetMemory(virDomainPtr domain, unsigned long memory) {
     if (!(entry = virHashLookup(configCache, filename)))
         return (-1);
 
-    if (VIR_ALLOC(value) < 0)
-        return (-1);
-
-    value->type = VIR_CONF_LONG;
-    value->l = (memory/1024);
-
-    if (virConfSetValue(entry->conf, "memory", value) < 0)
-        return (-1);
+    entry->def->memory = memory;
+    if (entry->def->memory > entry->def->maxmem)
+        entry->def->memory = entry->def->maxmem;
 
     /* If this fails, should we try to undo our changes to the
      * in-memory representation of the config file. I say not!
      */
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         return (-1);
 
     return (0);
@@ -1163,7 +1115,6 @@ int xenXMDomainSetMemory(virDomainPtr domain, unsigned long memory) {
 int xenXMDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) {
     const char *filename;
     xenXMConfCachePtr entry;
-    virConfValuePtr value;
 
     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
@@ -1181,19 +1132,14 @@ int xenXMDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) {
     if (!(entry = virHashLookup(configCache, filename)))
         return (-1);
 
-    if (VIR_ALLOC(value) < 0)
-        return (-1);
-
-    value->type = VIR_CONF_LONG;
-    value->l = (memory/1024);
-
-    if (virConfSetValue(entry->conf, "maxmem", value) < 0)
-        return (-1);
+    entry->def->maxmem = memory;
+    if (entry->def->memory > entry->def->maxmem)
+        entry->def->memory = entry->def->maxmem;
 
     /* If this fails, should we try to undo our changes to the
      * in-memory representation of the config file. I say not!
      */
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         return (-1);
 
     return (0);
@@ -1205,7 +1151,6 @@ int xenXMDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) {
 unsigned long xenXMDomainGetMaxMemory(virDomainPtr domain) {
     const char *filename;
     xenXMConfCachePtr entry;
-    long val;
 
     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
@@ -1221,13 +1166,7 @@ unsigned long xenXMDomainGetMaxMemory(virDomainPtr domain) {
     if (!(entry = virHashLookup(configCache, filename)))
         return (-1);
 
-    if (xenXMConfigGetInt(entry->conf, "maxmem", &val) < 0 ||
-        val < 0)
-        if (xenXMConfigGetInt(entry->conf, "memory", &val) < 0 ||
-            val < 0)
-            val = MIN_XEN_GUEST_SIZE * 2;
-
-    return (val * 1024);
+    return entry->def->maxmem;
 }
 
 /*
@@ -1236,7 +1175,6 @@ unsigned long xenXMDomainGetMaxMemory(virDomainPtr domain) {
 int xenXMDomainSetVcpus(virDomainPtr domain, unsigned int vcpus) {
     const char *filename;
     xenXMConfCachePtr entry;
-    virConfValuePtr value;
 
     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
@@ -1254,19 +1192,12 @@ int xenXMDomainSetVcpus(virDomainPtr domain, unsigned int vcpus) {
     if (!(entry = virHashLookup(configCache, filename)))
         return (-1);
 
-    if (VIR_ALLOC(value) < 0)
-        return (-1);
-
-    value->type = VIR_CONF_LONG;
-    value->l = vcpus;
-
-    if (virConfSetValue(entry->conf, "vcpus", value) < 0)
-        return (-1);
+    entry->def->vcpus = vcpus;
 
     /* If this fails, should we try to undo our changes to the
      * in-memory representation of the config file. I say not!
      */
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         return (-1);
 
     return (0);
@@ -1291,9 +1222,10 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
     xenXMConfCachePtr entry;
     virBuffer mapbuf = VIR_BUFFER_INITIALIZER;
     char *mapstr = NULL;
-    char *ranges = NULL;
     int i, j, n, comma = 0;
     int ret = -1;
+    char *cpuset = NULL;
+    int maxcpu = XEN_MAX_PHYSICAL_CPU;
 
     if (domain == NULL || domain->conn == NULL || domain->name == NULL
         || cpumap == NULL || maplen < 1 || maplen > (int)sizeof(cpumap_t)) {
@@ -1342,24 +1274,28 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
 
     mapstr = virBufferContentAndReset(&mapbuf);
 
-    /* convert the mapstr to a range based string */
-    ranges = virConvertCpuSet(domain->conn, mapstr, 0);
+    if (VIR_ALLOC_N(cpuset, maxcpu) < 0) {
+        xenXMError(domain->conn, VIR_ERR_NO_MEMORY, _("allocate buffer"));
+        goto cleanup;
+    }
+    if (virDomainCpuSetParse(domain->conn,
+                             (const char **)&mapstr, 0,
+                             cpuset, maxcpu) < 0)
+        goto cleanup;
 
-    if (ranges != NULL) {
-        if (xenXMConfigSetString(entry->conf, "cpus", ranges) < 0)
-            goto cleanup;
-    } else
-        if (xenXMConfigSetString(entry->conf, "cpus", mapstr) < 0)
-            goto cleanup;
+    VIR_FREE(entry->def->cpumask);
+    entry->def->cpumask = cpuset;
+    entry->def->cpumasklen = maxcpu;
+    cpuset = NULL;
 
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         goto cleanup;
 
     ret = 0;
 
  cleanup:
     VIR_FREE(mapstr);
-    VIR_FREE(ranges);
+    VIR_FREE(cpuset);
     return (ret);
 }
 
@@ -1370,7 +1306,7 @@ virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char *domname) {
     const char *filename;
     xenXMConfCachePtr entry;
     virDomainPtr ret;
-    unsigned char uuid[VIR_UUID_BUFLEN];
+
     if (!VIR_IS_CONNECT(conn)) {
         xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
         return (NULL);
@@ -1390,12 +1326,7 @@ virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char *domname) {
         return (NULL);
     }
 
-
-    if (xenXMConfigGetUUID(entry->conf, "uuid", uuid) < 0) {
-        return (NULL);
-    }
-
-    if (!(ret = virGetDomain(conn, domname, uuid))) {
+    if (!(ret = virGetDomain(conn, domname, entry->def->uuid))) {
         return (NULL);
     }
 
@@ -1411,15 +1342,10 @@ virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char *domname) {
  * Hash table iterator to search for a domain based on UUID
  */
 static int xenXMDomainSearchForUUID(const void *payload, const char *name ATTRIBUTE_UNUSED, const void *data) {
-    unsigned char uuid[VIR_UUID_BUFLEN];
     const unsigned char *wantuuid = (const unsigned char *)data;
     const xenXMConfCachePtr entry = (const xenXMConfCachePtr)payload;
 
-    if (xenXMConfigGetUUID(entry->conf, "uuid", uuid) < 0) {
-        return (0);
-    }
-
-    if (!memcmp(uuid, wantuuid, VIR_UUID_BUFLEN))
+    if (!memcmp(entry->def->uuid, wantuuid, VIR_UUID_BUFLEN))
         return (1);
 
     return (0);
@@ -1432,7 +1358,6 @@ virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn,
                                      const unsigned char *uuid) {
     xenXMConfCachePtr entry;
     virDomainPtr ret;
-    const char *domname;
 
     if (!VIR_IS_CONNECT(conn)) {
         xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
@@ -1450,11 +1375,7 @@ virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn,
         return (NULL);
     }
 
-    if (xenXMConfigGetString(entry->conf, "name", &domname) < 0) {
-        return (NULL);
-    }
-
-    if (!(ret = virGetDomain(conn, domname, uuid))) {
+    if (!(ret = virGetDomain(conn, entry->def->name, uuid))) {
         return (NULL);
     }
 
@@ -1470,35 +1391,28 @@ virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn,
  * Start a domain from an existing defined config file
  */
 int xenXMDomainCreate(virDomainPtr domain) {
-    char *xml;
     char *sexpr;
     int ret;
-    unsigned char uuid[VIR_UUID_BUFLEN];
     xenUnifiedPrivatePtr priv;
-    virDomainDefPtr def;
+    const char *filename;
+    xenXMConfCachePtr entry;
+
+    priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
 
     if (domain->id != -1)
         return (-1);
 
-    if (!(xml = xenXMDomainDumpXML(domain, 0)))
+    if (!(filename = virHashLookup(nameConfigMap, domain->name)))
         return (-1);
 
-    priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
-
-    if (!(def = virDomainDefParseString(domain->conn, priv->caps, xml))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR,
-                   _("failed to parse domain description"));
+    if (!(entry = virHashLookup(configCache, filename)))
         return (-1);
-    }
-    VIR_FREE(xml);
 
-    if (!(sexpr = xenDaemonFormatSxpr(domain->conn, def, priv->xendConfigVersion))) {
-        virDomainDefFree(def);
+    if (!(sexpr = xenDaemonFormatSxpr(domain->conn, entry->def, priv->xendConfigVersion))) {
         xenXMError(domain->conn, VIR_ERR_XML_ERROR,
                    _("failed to build sexpr"));
         return (-1);
     }
-    virDomainDefFree(def);
 
     ret = xenDaemonDomainCreateLinux(domain->conn, sexpr);
     VIR_FREE(sexpr);
@@ -1506,7 +1420,8 @@ int xenXMDomainCreate(virDomainPtr domain) {
         return (-1);
     }
 
-    if ((ret = xenDaemonDomainLookupByName_ids(domain->conn, domain->name, uuid)) < 0) {
+    if ((ret = xenDaemonDomainLookupByName_ids(domain->conn, domain->name,
+                                               entry->def->uuid)) < 0) {
         return (-1);
     }
     domain->id = ret;
@@ -1930,7 +1845,8 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) {
 }
 
 
-virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
+virConfPtr xenXMDomainConfigFormat(virConnectPtr conn,
+                                   virDomainDefPtr def) {
     xmlDocPtr doc = NULL;
     xmlNodePtr node;
     xmlXPathObjectPtr obj = NULL;
@@ -1940,10 +1856,17 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
     int hvm = 0, i;
     xenUnifiedPrivatePtr priv;
     char *cpus;
+    char *xml;
+
+    priv = (xenUnifiedPrivatePtr) conn->privateData;
+
+    if (!(xml = virDomainDefFormat(conn, def, VIR_DOMAIN_XML_SECURE)))
+        return NULL;
 
     doc = xmlReadDoc((const xmlChar *) xml, "domain.xml", NULL,
                      XML_PARSE_NOENT | XML_PARSE_NONET |
                      XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
+    VIR_FREE(xml);
     if (doc == NULL) {
         xenXMError(conn, VIR_ERR_XML_ERROR,
                    _("cannot read XML domain definition"));
@@ -2025,8 +1948,6 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
     xmlXPathFreeObject(obj);
     obj = NULL;
 
-    priv = (xenUnifiedPrivatePtr) conn->privateData;
-
     if (hvm) {
         const char *boot = "c";
         int clockLocal = 0;
@@ -2390,10 +2311,9 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
     virDomainPtr olddomain;
     char filename[PATH_MAX];
     const char * oldfilename;
-    unsigned char uuid[VIR_UUID_BUFLEN];
-    virConfPtr conf = NULL;
+    virDomainDefPtr def = NULL;
     xenXMConfCachePtr entry = NULL;
-    virConfValuePtr value;
+    xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
 
     if (!VIR_IS_CONNECT(conn)) {
         xenXMError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
@@ -2409,21 +2329,13 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
     if (xenXMConfigCacheRefresh (conn) < 0)
         return (NULL);
 
-    if (!(conf = xenXMParseXMLToConfig(conn, xml)))
-        goto error;
-
-    if (!(value = virConfGetValue(conf, "name")) ||
-        value->type != VIR_CONF_STRING ||
-        value->str == NULL) {
-        xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
-                   _("name config parameter is missing"));
-        goto error;
-    }
+    if (!(def = virDomainDefParseString(conn, priv->caps, xml)))
+        return (NULL);
 
-    if (virHashLookup(nameConfigMap, value->str)) {
+    if (virHashLookup(nameConfigMap, def->name)) {
         /* domain exists, we will overwrite it */
 
-        if (!(oldfilename = (char *)virHashLookup(nameConfigMap, value->str))) {
+        if (!(oldfilename = (char *)virHashLookup(nameConfigMap, def->name))) {
             xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
                        _("can't retrieve config filename for domain to overwrite"));
             goto error;
@@ -2435,17 +2347,12 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
             goto error;
         }
 
-        if (xenXMConfigGetUUID(entry->conf, "uuid", uuid) < 0) {
-            xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
-                       _("uuid config parameter is missing"));
-            goto error;
-        }
-
-        if (!(olddomain = virGetDomain(conn, value->str, uuid)))
+        /* 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(nameConfigMap, value->str, NULL) < 0) {
+        if (virHashRemoveEntry(nameConfigMap, def->name, NULL) < 0) {
             xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
                        _("failed to remove old domain from config map"));
             goto error;
@@ -2461,7 +2368,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
         entry = NULL;
     }
 
-    if ((strlen(configDir) + 1 + strlen(value->str) + 1) > PATH_MAX) {
+    if ((strlen(configDir) + 1 + strlen(def->name) + 1) > PATH_MAX) {
         xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
                    _("config file name is too long"));
         goto error;
@@ -2469,13 +2376,10 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
 
     strcpy(filename, configDir);
     strcat(filename, "/");
-    strcat(filename, value->str);
+    strcat(filename, def->name);
 
-    if (virConfWriteFile(filename, conf) < 0) {
-        xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
-                   _("unable to write config file"));
+    if (xenXMConfigSaveFile(conn, filename, def) < 0)
         goto error;
-    }
 
     if (VIR_ALLOC(entry) < 0) {
         xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
@@ -2489,13 +2393,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
     }
 
     memmove(entry->filename, filename, PATH_MAX);
-    entry->conf = conf;
-
-    if (xenXMConfigGetUUID(conf, "uuid", uuid) < 0) {
-        xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
-                   _("uuid config parameter is missing"));
-        goto error;
-    }
+    entry->def = def;
 
     if (virHashAddEntry(configCache, filename, entry) < 0) {
         xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
@@ -2503,25 +2401,23 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
         goto error;
     }
 
-    if (virHashAddEntry(nameConfigMap, value->str, entry->filename) < 0) {
+    if (virHashAddEntry(nameConfigMap, def->name, entry->filename) < 0) {
         virHashRemoveEntry(configCache, filename, NULL);
         xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
                    _("unable to store config file handle"));
         goto error;
     }
 
-    entry = NULL;
+    if (!(ret = virGetDomain(conn, def->name, def->uuid)))
+        return NULL;
 
-    if (!(ret = virGetDomain(conn, value->str, uuid)))
-        goto error;
     ret->id = -1;
 
     return (ret);
 
  error:
     VIR_FREE(entry);
-    if (conf)
-        virConfFree(conf);
+    virDomainDefFree(def);
     return (NULL);
 }
 
@@ -2629,6 +2525,15 @@ int xenXMNumOfDefinedDomains(virConnectPtr conn) {
     return virHashSize(nameConfigMap);
 }
 
+static int xenXMDiskCompare(virDomainDiskDefPtr a,
+                            virDomainDiskDefPtr b) {
+    if (a->bus == b->bus)
+        return virDiskNameToIndex(a->dst) - virDiskNameToIndex(b->dst);
+    else
+        return a->bus - b->bus;
+}
+
+
 /**
  * xenXMDomainAttachDevice:
  * @domain: pointer to domain object
@@ -2643,75 +2548,65 @@ static int
 xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
     const char *filename = NULL;
     xenXMConfCachePtr entry = NULL;
-    xmlDocPtr doc = NULL;
-    xmlNodePtr node = NULL;
-    xmlXPathContextPtr ctxt = NULL;
-    xmlXPathObjectPtr obj = NULL;
-    char *domxml = NULL;
-    int ret = -1, hvm = 0;
+    int ret = -1;
+    virDomainDeviceDefPtr dev = NULL;
 
     if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
                    __FUNCTION__);
-        goto cleanup;
+        return -1;
     }
     if (domain->conn->flags & VIR_CONNECT_RO)
-        goto cleanup;
+        return -1;
     if (domain->id != -1)
-        goto cleanup;
+        return -1;
+
     if (!(filename = virHashLookup(nameConfigMap, domain->name)))
-        goto cleanup;
+        return -1;
     if (!(entry = virHashLookup(configCache, filename)))
-        goto cleanup;
-    if (!(entry->conf))
-        goto cleanup;
+        return -1;
 
-    if (!(domxml = xenXMDomainDumpXML(domain, 0)))
-        goto cleanup;
+    if (!(dev = virDomainDeviceDefParse(domain->conn,
+                                        entry->def,
+                                        xml)))
+        return -1;
 
-    doc = xmlReadDoc((const xmlChar *) domxml, "domain.xml", NULL,
-                     XML_PARSE_NOENT | XML_PARSE_NONET |
-                     XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
-    if (!doc) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR,
-                   _("cannot read XML domain definition"));
-        goto cleanup;
-    }
-    if (!(ctxt = xmlXPathNewContext(doc))) {
-        xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
-                   _("cannot create XPath context"));
-        goto cleanup;
+    switch (dev->type) {
+    case VIR_DOMAIN_DEVICE_DISK:
+    {
+        /* Maintain list in sorted order according to target device name */
+        if (entry->def->disks == NULL) {
+            dev->data.disk->next = entry->def->disks;
+            entry->def->disks = dev->data.disk;
+        } else {
+            virDomainDiskDefPtr ptr = entry->def->disks;
+            while (ptr) {
+                if (!ptr->next || xenXMDiskCompare(dev->data.disk, ptr->next) < 0) {
+                    dev->data.disk->next = ptr->next;
+                    ptr->next = dev->data.disk;
+                    break;
+                }
+                ptr = ptr->next;
+            }
+        }
+        dev->data.disk = NULL;
     }
-    obj = xmlXPathEval(BAD_CAST "string(/domain/os/type)", ctxt);
-    if ((obj != NULL) && (obj->type == XPATH_STRING) &&
-        (obj->stringval) && (STREQ((char *)obj->stringval, "hvm")))
-        hvm = 1;
+    break;
 
-    xmlXPathFreeContext(ctxt);
-    ctxt = NULL;
-    if (doc)
-        xmlFreeDoc(doc);
-    doc = xmlReadDoc((const xmlChar *) xml, "device.xml", NULL,
-                     XML_PARSE_NOENT | XML_PARSE_NONET |
-                     XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
-    if (!doc) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR,
-                   _("cannot read XML domain definition"));
-        goto cleanup;
-    }
-    if (!(ctxt = xmlXPathNewContext(doc))) {
-        xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
-                   _("cannot create XPath context"));
-        goto cleanup;
+    case VIR_DOMAIN_DEVICE_NET:
+    {
+        virDomainNetDefPtr net = entry->def->nets;
+        while (net && net->next)
+            net = net->next;
+        if (net)
+            net->next = dev->data.net;
+        else
+            entry->def->nets = dev->data.net;
+        dev->data.net = NULL;
+        break;
     }
 
-    if ((node = virXPathNode("/disk", ctxt))) {
-        if (xenXMAttachDisk(domain, ctxt, hvm, node, entry))
-            goto cleanup;
-    } else if ((node = virXPathNode("/interface", ctxt))) {
-        if (xenXMAttachInterface(domain, ctxt, hvm, node, entry))
-            goto cleanup;
-    } else {
+    default:
         xenXMError(domain->conn, VIR_ERR_XML_ERROR,
                    _("unknown device"));
         goto cleanup;
@@ -2720,318 +2615,17 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
     /* If this fails, should we try to undo our changes to the
      * in-memory representation of the config file. I say not!
      */
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         goto cleanup;
 
     ret = 0;
 
  cleanup:
-    VIR_FREE(domxml);
-    xmlXPathFreeObject(obj);
-    xmlXPathFreeContext(ctxt);
-    if (doc)
-        xmlFreeDoc(doc);
+    virDomainDeviceDefFree(dev);
 
     return ret;
 }
 
-static int
-xenXMAttachDisk(virDomainPtr domain, xmlXPathContextPtr ctxt, int hvm,
-                xmlNodePtr node, xenXMConfCachePtr entry) {
-    virConfValuePtr list_item = NULL, list_val = NULL, prev = NULL;
-    xenUnifiedPrivatePtr priv = NULL;
-    xmlChar *type = NULL, *source = NULL, *target = NULL;
-    int ret = -1;
-    char *dev;
-
-    priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
-    xenXMParseXMLDisk(node, hvm, ((xenUnifiedPrivatePtr) domain->conn->privateData)->xendConfigVersion, &dev);
-    if (!dev)
-        goto cleanup;
-
-    if (!(type = xmlGetProp(node, BAD_CAST "type"))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-    if (!(node = virXPathNode("/disk/source", ctxt))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-    if (STREQ((const char *) type, "block"))
-        source = xmlGetProp(node, BAD_CAST "dev");
-    else if (STREQ((const char *) type, "file"))
-        source = xmlGetProp(node, BAD_CAST "file");
-    else {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-    if (!(node = virXPathNode("/disk/target", ctxt))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-    target = xmlGetProp(node, BAD_CAST "dev");
-
-    list_item = virConfGetValue(entry->conf, "disk");
-    if (list_item && list_item->type == VIR_CONF_LIST) {
-        prev = list_item;
-        list_val = list_item->list;
-        while (list_val) {
-            if ((list_val->type != VIR_CONF_STRING) || (!list_val->str))
-                goto skip;
-            char domdev[NAME_MAX];
-            char *head;
-            char *offset;
-            char *tmp;
-
-            head = list_val->str;
-
-            /* Extract the source */
-            if (!(offset = strchr(head, ',')) || offset[0] == '\0')
-                goto skip;
-            if ((offset - head) >= (PATH_MAX-1))
-                goto skip;
-            head = offset + 1;
-
-            /* Extract the dest */
-            if (!(offset = strchr(head, ',')) || offset[0] == '\0')
-                goto skip;
-            if ((offset - head) >= (PATH_MAX-1))
-                goto skip;
-            strncpy(domdev, head, (offset - head));
-            domdev[(offset-head)] = '\0';
-            head = offset + 1;
-
-            /* Remove legacy ioemu: junk */
-            if (STRPREFIX(domdev, "ioemu:")) {
-                memmove(domdev, domdev+6, strlen(domdev)-5);
-            }
-
-            /* Check for a :cdrom/:disk postfix */
-            if ((tmp = strchr(domdev, ':')))
-                tmp[0] = '\0';
-
-            if (STREQ(domdev, (const char *) target))
-                break;
-         skip:
-            prev = list_val;
-            list_val = list_val->next;
-        }
-    } else if (!list_item) {
-        if (VIR_ALLOC(list_item) < 0)
-            goto cleanup;
-        list_item->type = VIR_CONF_LIST;
-        if(virConfSetValue(entry->conf, "disk", list_item)) {
-            VIR_FREE(list_item);
-            goto cleanup;
-        }
-        list_val = NULL;
-        prev = list_item;
-    } else
-        goto cleanup;
-
-    if (!list_val) {
-        /* insert */
-        if (VIR_ALLOC(list_val) < 0)
-            goto cleanup;
-        list_val->type = VIR_CONF_STRING;
-        list_val->next = NULL;
-        list_val->str = dev;
-        if (prev->type == VIR_CONF_LIST)
-            prev->list = list_val;
-        else
-            prev->next = list_val;
-    } else {
-        /* configure */
-        VIR_FREE(list_val->str);
-        list_val->str = dev;
-    }
-
-    ret = 0;
-    goto cleanup;
-
- cleanup:
-    VIR_FREE(type);
-    VIR_FREE(source);
-    VIR_FREE(target);
-
-    return (ret);
-}
-
-static int
-xenXMAttachInterface(virDomainPtr domain, xmlXPathContextPtr ctxt, int hvm,
-                    xmlNodePtr node, xenXMConfCachePtr entry) {
-    virConfValuePtr list_item = NULL, list_val = NULL, prev = NULL;
-    xmlChar *type = NULL, *source = NULL, *mac = NULL;
-    int ret = -1, autoassign = 0;
-    char *dev;
-
-    xmlNodePtr node_cur = NULL, node_tmp = NULL;
-    xmlAttrPtr attr_node = NULL;
-    xmlNodePtr text_node = NULL;
-
-    if(!(type = xmlGetProp(node, BAD_CAST "type"))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-
-    if (!(node = virXPathNode("/interface/source", ctxt))) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR, XM_XML_ERROR);
-        goto cleanup;
-    }
-    source = xmlGetProp(node, BAD_CAST type);
-
-    if ((node = virXPathNode("/interface/mac", ctxt)))
-        mac = xmlGetProp(node, BAD_CAST "address");
-    if (!node || !mac) {
-        if (!(mac = (xmlChar *)xenXMAutoAssignMac()))
-            goto cleanup;
-        autoassign = 1;
-    }
-
-    list_item = virConfGetValue(entry->conf, "vif");
-    if (list_item && list_item->type == VIR_CONF_LIST) {
-        prev = list_item;
-        list_val = list_item->list;
-        while (list_val) {
-            if ((list_val->type != VIR_CONF_STRING) || (!list_val->str))
-                goto skip;
-            char dommac[18];
-            char *key;
-
-            dommac[0] = '\0';
-
-            key = list_val->str;
-            while (key) {
-                char *data;
-                char *nextkey = strchr(key, ',');
-
-                if (!(data = strchr(key, '=')) || (data[0] == '\0'))
-                    goto skip;
-                data++;
-
-                if (STRPREFIX(key, "mac=")) {
-                    int len = nextkey ? (nextkey - data) : 17;
-                    if (len > 17)
-                        len = 17;
-                    strncpy(dommac, data, len);
-                    dommac[len] = '\0';
-                }
-
-                while (nextkey && (nextkey[0] == ',' ||
-                                   nextkey[0] == ' ' ||
-                                   nextkey[0] == '\t'))
-                    nextkey++;
-                key = nextkey;
-            }
-
-            if (virMacAddrCompare (dommac, (const char *) mac) == 0) {
-                if (autoassign) {
-                    VIR_FREE(mac);
-                    mac = NULL;
-                    if (!(mac = (xmlChar *)xenXMAutoAssignMac()))
-                        goto cleanup;
-                    /* initialize the list */
-                    list_item = virConfGetValue(entry->conf, "vif");
-                    prev = list_item;
-                    list_val = list_item->list;
-                    continue;
-                } else
-                    break;
-            }
-        skip:
-            prev = list_val;
-            list_val = list_val->next;
-        }
-    } else if (!list_item) {
-        if (VIR_ALLOC(list_item) < 0)
-            goto cleanup;
-        list_item->type = VIR_CONF_LIST;
-        if(virConfSetValue(entry->conf, "vif", list_item)) {
-            VIR_FREE(list_item);
-            goto cleanup;
-        }
-        list_val = NULL;
-        prev = list_item;
-    } else
-        goto cleanup;
-
-    if ((node = virXPathNode("/interface", ctxt))) {
-        if (autoassign) {
-            node_cur = node->children;
-
-            while (node_cur->next)
-                node_cur = node_cur->next;
-
-            if (VIR_ALLOC(node_tmp) < 0)
-                goto node_cleanup;
-            node_tmp->type = XML_ELEMENT_NODE;
-            if (VIR_ALLOC_N(node_tmp->name, 4) < 0)
-                goto node_cleanup;
-            strcpy((char *)node_tmp->name, "mac");
-            node_tmp->children = NULL;
-
-            if (VIR_ALLOC(attr_node) < 0)
-                goto node_cleanup;
-            attr_node->type = XML_ATTRIBUTE_NODE;
-            attr_node->ns = NULL;
-            if (VIR_ALLOC_N(attr_node->name, 8) < 0)
-                goto node_cleanup;
-            strcpy((char *) attr_node->name, "address");
-            node_tmp->properties = attr_node;
-
-            if (VIR_ALLOC(text_node) < 0)
-                goto node_cleanup;
-            text_node->type = XML_TEXT_NODE;
-            text_node->_private = NULL;
-            if (VIR_ALLOC_N(text_node->name, 5) < 0)
-                goto node_cleanup;
-            strcpy((char *) text_node->name, "text");
-            text_node->children = NULL;
-            text_node->parent = (xmlNodePtr)attr_node;
-            text_node->content = mac;
-            mac = NULL;
-            attr_node->children = text_node;
-            attr_node->last = text_node;
-            attr_node->parent = node_tmp;
-
-            node_cur->next = node_tmp;
-        }
-        if (!(dev = xenXMParseXMLVif(domain->conn, node, hvm)))
-            goto cleanup;
-    } else
-        goto cleanup;
-
-    if (!list_val) {
-        /* insert */
-        if (VIR_ALLOC(list_val) < 0)
-            goto cleanup;
-        list_val->type = VIR_CONF_STRING;
-        list_val->next = NULL;
-        list_val->str = dev;
-        if (prev->type == VIR_CONF_LIST)
-            prev->list = list_val;
-        else
-            prev->next = list_val;
-    } else {
-        /* configure */
-        VIR_FREE(list_val->str);
-        list_val->str = dev;
-    }
-
-    ret = 0;
-    goto cleanup;
-
- node_cleanup:
-    xmlFree(node_tmp);
-    xmlFree(attr_node);
-    xmlFree(text_node);
- cleanup:
-    VIR_FREE(type);
-    VIR_FREE(source);
-    VIR_FREE(mac);
-
-    return (ret);
-}
 
 /**
  * xenXMAutoAssignMac:
@@ -3067,180 +2661,87 @@ xenXMAutoAssignMac() {
 static int
 xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
     const char *filename = NULL;
-    char device[8], *domdevice = NULL;
     xenXMConfCachePtr entry = NULL;
-    virConfValuePtr prev = NULL, list_ptr = NULL, list_val = NULL;
-    xmlDocPtr doc = NULL;
-    xmlNodePtr node = NULL;
-    xmlXPathContextPtr ctxt = NULL;
-    xmlChar *key = NULL;
+    virDomainDeviceDefPtr dev = NULL;
     int ret = -1;
 
     if ((!domain) || (!domain->conn) || (!domain->name) || (!xml)) {
         xenXMError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
                    __FUNCTION__);
-        goto cleanup;
+        return -1;
     }
     if (domain->conn->flags & VIR_CONNECT_RO)
-        goto cleanup;
+        return -1;
     if (domain->id != -1)
-        goto cleanup;
+        return -1;
     if (!(filename = virHashLookup(nameConfigMap, domain->name)))
-        goto cleanup;
-
-    doc = xmlReadDoc((const xmlChar *) xml, "device.xml", NULL,
-                     XML_PARSE_NOENT | XML_PARSE_NONET |
-                     XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
-    if (!doc) {
-        xenXMError(domain->conn, VIR_ERR_XML_ERROR,
-                   _("cannot read XML domain definition"));
-        goto cleanup;
-    }
-    if (!(ctxt = xmlXPathNewContext(doc))) {
-        xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
-                   _("cannot create XPath context"));
-        goto cleanup;
-    }
-
-    if ((node = virXPathNode("/disk", ctxt))) {
-        strcpy(device, "disk");
-        if (!(node = virXPathNode("/disk/target", ctxt)))
-            goto cleanup;
-        key = xmlGetProp(node, BAD_CAST "dev");
-    } else if ((node = virXPathNode("/interface", ctxt))) {
-        strcpy(device, "vif");
-        if (!(node = virXPathNode("/interface/mac", ctxt)))
-            goto cleanup;
-        key = xmlGetProp(node, BAD_CAST "address");
-    } else
-        goto cleanup;
-    if (!key || (strlen((char *)key) == 0))
-        goto cleanup;
-
+        return -1;
     if (!(entry = virHashLookup(configCache, filename)))
-        goto cleanup;
-    if (!entry->conf)
-        goto cleanup;
-
-    list_ptr = virConfGetValue(entry->conf, device);
-    if (!list_ptr)
-        goto cleanup;
-    else if (list_ptr && list_ptr->type == VIR_CONF_LIST) {
-        list_val = list_ptr->list;
-        while (list_val) {
-            if (STREQ(device, "disk")) {
-                char domdev[NAME_MAX];
-                char *head;
-                char *offset;
-                char *tmp;
-
-                if ((list_val->type != VIR_CONF_STRING) || (!list_val->str))
-                    goto skip;
-                head = list_val->str;
-
-                /* Extract the source */
-                if (!(offset = strchr(head, ',')) || offset[0] == '\0')
-                    goto skip;
-                if ((offset - head) >= (PATH_MAX-1))
-                    goto skip;
-                head = offset + 1;
-
-                /* Extract the dest */
-                if (!(offset = strchr(head, ',')) || offset[0] == '\0')
-                    goto skip;
-                if ((offset - head) >= (PATH_MAX-1))
-                    goto skip;
-                strncpy(domdev, head, (offset - head));
-                domdev[(offset-head)] = '\0';
-                head = offset + 1;
-
-                /* Remove legacy ioemu: junk */
-                if (STRPREFIX(domdev, "ioemu:")) {
-                    memmove(domdev, domdev+6, strlen(domdev)-5);
-                }
-
-                /* Check for a :cdrom/:disk postfix */
-                if ((tmp = strchr(domdev, ':')))
-                    tmp[0] = '\0';
-
-                if (STREQ(domdev, (const char *) key))
-                    break;
-            } else {
-                char dommac[18];
-                char *mac;
-
-                dommac[0] = '\0';
-
-                if ((list_val->type != VIR_CONF_STRING) || (!list_val->str))
-                    goto skip;
-
-                mac = list_val->str;
-                while (mac) {
-                    char *data;
-                    char *nextmac = strchr(mac, ',');
-
-                    if (!(data = strchr(mac, '=')) || (data[0] == '\0'))
-                        goto skip;
-                    data++;
+        return -1;
 
-                    if (STRPREFIX(mac, "mac=")) {
-                        int len = nextmac ? (nextmac - data) : 17;
-                        if (len > 17)
-                            len = 17;
-                        strncpy(dommac, data, len);
-                        dommac[len] = '\0';
-                    }
+    if (!(dev = virDomainDeviceDefParse(domain->conn,
+                                        entry->def,
+                                        xml)))
+        return -1;
 
-                    while (nextmac && (nextmac[0] == ',' ||
-                                       nextmac[0] == ' ' ||
-                                       nextmac[0] == '\t'))
-                        nextmac++;
-                    mac = nextmac;
+    switch (dev->type) {
+    case VIR_DOMAIN_DEVICE_DISK:
+    {
+        virDomainDiskDefPtr disk = entry->def->disks;
+        virDomainDiskDefPtr prev = NULL;
+        while (disk) {
+            if (disk->dst &&
+                dev->data.disk->dst &&
+                STREQ(disk->dst, dev->data.disk->dst)) {
+                if (prev) {
+                    prev->next = disk->next;
+                } else {
+                    entry->def->disks = disk->next;
                 }
-
-                if (virMacAddrCompare (dommac, (const char *) key) == 0)
-                    break;
+                virDomainDiskDefFree(disk);
+                break;
             }
-        skip:
-            prev = list_val;
-            list_val = list_val->next;
+            prev = disk;
+            disk = disk->next;
         }
+        break;
+    }
+
+    case VIR_DOMAIN_DEVICE_NET:
+    {
+        virDomainNetDefPtr net = entry->def->nets;
+        virDomainNetDefPtr prev = NULL;
+        while (net) {
+            if (!memcmp(net->mac, dev->data.net->mac, VIR_DOMAIN_NET_MAC_SIZE)) {
+                if (prev) {
+                    prev->next = net->next;
+                } else {
+                    entry->def->nets = net->next;
+                }
+                virDomainNetDefFree(net);
+                break;
+            }
+            prev = net;
+            net = net->next;
+        }
+        break;
     }
-
-    if (!list_val)
+    default:
+        xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+                   _("unknown device"));
         goto cleanup;
-    else {
-        if (!prev) {
-            virConfValuePtr value;
-            if (VIR_ALLOC(value) < 0)
-                goto cleanup;
-            value->type = VIR_CONF_LIST;
-            value->list = list_val->next;
-            list_val->next = NULL;
-            if (virConfSetValue(entry->conf, device, value)) {
-                VIR_FREE(value);
-                goto cleanup;
-            }
-        } else
-            prev->next = list_val->next;
     }
 
     /* If this fails, should we try to undo our changes to the
      * in-memory representation of the config file. I say not!
      */
-    if (virConfWriteFile(entry->filename, entry->conf) < 0)
+    if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
         goto cleanup;
 
     ret = 0;
 
  cleanup:
-    xmlXPathFreeContext(ctxt);
-    if (doc)
-        xmlFreeDoc(doc);
-    VIR_FREE(domdevice);
-    VIR_FREE(key);
-    VIR_FREE(list_val);
-
+    virDomainDeviceDefFree(dev);
     return (ret);
 }
 
index 7b1f6aae5d22a05447c3aa705f337024d047c73a..2aa818a8c1d1f92fb0cb34c531532d7de89d114f 100644 (file)
 #include "libvirt/libvirt.h"
 #include "conf.h"
 #include "internal.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "domain_conf.h"
 
 extern struct xenUnifiedDriver xenXMDriver;
 int xenXMInit (void);
@@ -58,11 +55,9 @@ int xenXMDomainCreate(virDomainPtr domain);
 virDomainPtr xenXMDomainDefineXML(virConnectPtr con, const char *xml);
 int xenXMDomainUndefine(virDomainPtr domain);
 
-virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml);
-char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf);
+virConfPtr xenXMDomainConfigFormat(virConnectPtr conn, virDomainDefPtr def);
+virDomainDefPtr xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf);
+
 int xenXMDomainBlockPeek (virDomainPtr dom, const char *path, unsigned long long offset, size_t size, void *buffer);
 
-#ifdef __cplusplus
-}
-#endif
 #endif
index da4c2473e777186f62cc6186e5a751c0da9058da..11cf3be900c6166b6f3cb67477c17d7400feff48 100644 (file)
@@ -101,7 +101,7 @@ sexpr2xmltest_SOURCES = \
 sexpr2xmltest_LDADD = $(LDADDS)
 
 xmconfigtest_SOURCES = \
-       xmconfigtest.c \
+       xmconfigtest.c testutilsxen.c testutilsxen.h \
        testutils.c testutils.h
 xmconfigtest_LDADD = $(LDADDS)
 
index b50c99366bb6bb85e1667abf50c333468742ceda..6e2611b9f385cbe5e34e36c12761eda566c938b9 100644 (file)
@@ -20,7 +20,7 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso&test,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
 soundhw = "sb16,es1370"
index 2ed6668e8312dc25125477b4e30172b0856df9cc..7a534baaffdbaa91a6743663855913bd7c626e37 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2&amp;test</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader&amp;test</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm&amp;test</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
     <sound model='sb16'/>
     <sound model='es1370'/>
   </devices>
index f0acaf652f1a376e8e2ec7e2d67c9db3c4cfd37e..9fe2721d55acd65f2ef5cea756d50d2b08ded52b 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
index 79d0e8a75d1dd18718433002e6a675b8f3f5d7fd..d4fa7e5bdeb6c686693862ad5c7a56dee7856ba8 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='localtime'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 01bb7cc52868c0bf425ff5c268e2a1479e1c4efb..6574ee8cfdd4199d70cc502ed8ba5393ce459157 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
index d6da1162e76b947e8939093e4343042d3ac6c2fb..ab789791cb6e7afdc1ed0a7ea1c968312c73b345 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index c6eee8fa43c9c3abac0296323e6113a8b85edb43..9f1c34c9f8881bcf7508d4d02825988080a4ef78 100755 (executable)
@@ -21,6 +21,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,ioemu:hda,w" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr0,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr0,type=ioemu" ]
 parallel = "none"
 serial = "none"
index 439a38f478370a30e99aee5c399ec7b3979c2466..764157255a3fbbf8a7de7510a0b26bf825b809bc 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr0'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index a03fdc7fc0592df72cafc5595be38ff8e219d88c..598275e53c6cacc2c545b8bd8e4421d5a78a1700 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "tcp:127.0.0.1:7777"
 serial = "none"
index cbe7dfd0642de2fb8cb12664eebfa8ef3ed9e3da..125d4921e7c1875b60873ccf7bc856434e218278 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <parallel type='tcp'>
       <source mode='connect' host='127.0.0.1' service='7777'/>
       <protocol type='raw'/>
       <target port='0'/>
     </parallel>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index aed248153bb905a9bc00bdd3833760f4cc1a6f5a..6467b40d3e3594385898f2949f24003656bdad7e 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "file:/tmp/serial.log"
index addf4ffe26ec3657fbd3f1c0dc75f36fb21edaf1..167241969969d529bd0ab7d4825fad15178c3839 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='file'>
       <source path='/tmp/serial.log'/>
       <target port='0'/>
@@ -45,5 +43,7 @@
       <source path='/tmp/serial.log'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index eb37471426d63482c09609f56b7ecee49b0cdb43..698f9bc6a15677843bc403e28c644ac8bfbca7cf 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "null"
index cc54659a9a670593910f666d0dc5b19192f8bdfc..b2726aeebde526f40151ed1bede95dc59603a480 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='null'>
       <target port='0'/>
     </serial>
     <console type='null'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 2d50feea39f836354e5dbffdcc29e755443509df..76b8b97dbd8da908d4314bba8c17e8a438368f55 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "pipe:/tmp/serial.pipe"
index 7ecc3446710237074fe0ba635eec9581c1d480ff..aa8bbca2d1daa25249136e0823042ef672e99baf 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='pipe'>
       <source path='/tmp/serial.pipe'/>
       <target port='0'/>
@@ -45,5 +43,7 @@
       <source path='/tmp/serial.pipe'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 509a7f2f4978810689da92a9a0bd0de6f26e1ea8..713af5a99d73abe67f5bec4cd5679da3185b73e1 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "pty"
index 9c776cd722a5732ba0a2ad0734e80df0df08a508..da62122c23131261a26a4a908fb98b6a610453f0 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='pty'>
       <target port='0'/>
     </serial>
     <console type='pty'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 3bab00a48af52efc40f2c35723f0b4cd23e9c880..ff3989b4b3582fd36a749090936607371e5aa0ac 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "stdio"
index 90e6d33016976df0410ec88d08d3aaae1b433681..af562386ebbb69abe88a049398503095120e7f66 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='stdio'>
       <target port='0'/>
     </serial>
     <console type='stdio'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index ffe7f15155dbe548a14881351a6de3f7bfe7a5dd..d87a02e41a43328935a7d7aef666ccdda0c13fa3 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "telnet:127.0.0.1:9999,listen"
index 87461b922bbdf5ce698556cf6c221a1f052160f0..3c528d19eb578a9151810bb4d8c8f8d0d63d298a 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='tcp'>
       <source mode='bind' host='127.0.0.1' service='9999'/>
       <protocol type='telnet'/>
@@ -47,5 +45,7 @@
       <protocol type='telnet'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 00a4cfdfec3f7bc9b4f547729f09d9b4748517c1..4f8e6c61e74041ad0aed7d26f9c4b65038ef34b4 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "tcp:127.0.0.1:7777"
index 162b59995d4342c1b711db2c0cbd867165df39d4..adfbe9234c5aaa79c755f759866dca7765228226 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='tcp'>
       <source mode='connect' host='127.0.0.1' service='7777'/>
       <protocol type='raw'/>
@@ -47,5 +45,7 @@
       <protocol type='raw'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 8110e8698b52f8a4682ba0d558ab880d84f07ff1..719aafcd619f7b305b189e54063361a672e103a0 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "udp:127.0.0.1:9999@0.0.0.0:99998"
index 48843b2bb5df7068a6c21aec29d48b64ea370037..15b91547128ebe0661ad836178ee72a9d111b6e3 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='udp'>
-      <source mode='connect' host='127.0.0.1' service='9999'/>
       <source mode='bind' host='0.0.0.0' service='99998'/>
+      <source mode='connect' host='127.0.0.1' service='9999'/>
       <target port='0'/>
     </serial>
     <console type='udp'>
-      <source mode='connect' host='127.0.0.1' service='9999'/>
       <source mode='bind' host='0.0.0.0' service='99998'/>
+      <source mode='connect' host='127.0.0.1' service='9999'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 17cb628311b646c26692df721f7b4bd4a3bb5cb7..fa8d988c8231186621952bb25b109c7cc753a05d 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "unix:/tmp/serial.sock,listen"
index f5d8d84e3ae10207fe4c7cdb9c6c69790eb293e9..85bf245cd11d162938f85af38d08d8445ab9d561 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
-    <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <serial type='unix'>
       <source mode='bind' path='/tmp/serial.sock'/>
       <target port='0'/>
@@ -45,5 +43,7 @@
       <source mode='bind' path='/tmp/serial.sock'/>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='ps2'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 7d77f94d258f46eb7086ad9096494b653985d1b5..66b7da765c3221c7c3a707cef9bb9eea211458ef 100644 (file)
@@ -20,7 +20,7 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
 soundhw = "sb16,es1370"
index 4c70a1ddb2123e8a0aaa707c586afc23e78342fb..01dd65d21b7706259d04dd0c5800b87bf61f2665 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
     <sound model='sb16'/>
     <sound model='es1370'/>
   </devices>
index 96bba6edcbd90ddf259dec6656513861a337fd73..9079734879360a4e596c88dceb34f8b97de52244 100755 (executable)
@@ -21,6 +21,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
index c46b1356d0e473449b176d7d32409f6c1f4ff318..3d051e6672acd31b89395f4fd3d0d4be0d3a07cd 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='usb'/>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index bb2710b2fe06ca5326a7f0852b00edb59a9a9673..5a0cb69460c0e93a55218cd2f4001496f1dbff78 100644 (file)
@@ -32,7 +32,7 @@
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='tablet'/>
index ed90a04ffdf9df6afbd6a770b47b1c39206f9242..f90f0876edb0b713efcfb87d64a417d92a308150 100755 (executable)
@@ -21,6 +21,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
index d307f9fd92199677231fbb1405b3774f1fd0c417..52979bdf9009210b79a252c22a3f84b5ed9e7dc6 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='tablet' bus='usb'/>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 01bb7cc52868c0bf425ff5c268e2a1479e1c4efb..6574ee8cfdd4199d70cc502ed8ba5393ce459157 100755 (executable)
@@ -20,6 +20,6 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]
-vif = [ "mac=00:16:3E:66:92:9C,bridge=xenbr1,type=ioemu" ]
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,type=ioemu" ]
 parallel = "none"
 serial = "none"
index d6da1162e76b947e8939093e4343042d3ac6c2fb..ab789791cb6e7afdc1ed0a7ea1c968312c73b345 100644 (file)
@@ -1,23 +1,23 @@
 <domain type='xen'>
   <name>XenGuest2</name>
   <uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
+  <vcpu>1</vcpu>
   <os>
-    <type>hvm</type>
+    <type arch='i686' machine='xenfv'>hvm</type>
     <loader>/usr/lib/xen/boot/hvmloader</loader>
     <boot dev='cdrom'/>
   </os>
-  <currentMemory>403456</currentMemory>
-  <memory>592896</memory>
-  <vcpu>1</vcpu>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
   <features>
-    <pae/>
     <acpi/>
     <apic/>
+    <pae/>
   </features>
   <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <readonly/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:92:9C'/>
+      <mac address='00:16:3e:66:92:9c'/>
       <source bridge='xenbr1'/>
     </interface>
     <input type='mouse' bus='ps2'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 7b01e8f238dec24f3dbee4b0a0b35c9f988e5b9f..39a28f4d9ff31a1621856a6bedd50190ba45418e 100755 (executable)
@@ -9,4 +9,4 @@ on_reboot = "restart"
 on_crash = "restart"
 vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
 disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
-vif = [ "mac=00:16:3E:66:94:9C,model=e1000,ip=192.168.0.9" ]
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,model=e1000" ]
index fc0ff8536226b9eeab5eea7ac827a1e14618a97d..8efab5871e903f389065e25aa1b69d95cd5a283a 100644 (file)
@@ -1,28 +1,33 @@
 <domain type='xen'>
   <name>XenGuest1</name>
   <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
-  <bootloader>/usr/bin/pygrub</bootloader>
-  <currentMemory>403456</currentMemory>
   <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
   <vcpu>1</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='i686' machine='xenpv'>linux</type>
+  </os>
+  <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
+    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <driver name='phy'/>
       <source dev='/dev/HostVG/XenGuest1'/>
       <target dev='xvda' bus='xen'/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:94:9C'/>
-      <ip address='192.168.0.9'/>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
       <model type='e1000'/>
     </interface>
-    <input type='mouse' bus='xen'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <console type='pty'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='xen'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 76a6eae1ad321645efd55ef083fab1d60b3440cc..b47a4ad6389f7cdcf8d57576782b9b454aab9a17 100755 (executable)
@@ -9,4 +9,4 @@ on_reboot = "restart"
 on_crash = "restart"
 vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
 disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
-vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ]
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0" ]
index b82cee646ac2b4187c65fa52e9053e28c6f4de80..620f701e0ab385000c9d96dcb6382368580776e0 100644 (file)
@@ -1,27 +1,32 @@
 <domain type='xen'>
   <name>XenGuest1</name>
   <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
-  <bootloader>/usr/bin/pygrub</bootloader>
-  <currentMemory>403456</currentMemory>
   <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
   <vcpu>1</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='i686' machine='xenpv'>linux</type>
+  </os>
+  <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
+    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <driver name='phy'/>
       <source dev='/dev/HostVG/XenGuest1'/>
       <target dev='xvda' bus='xen'/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:94:9C'/>
-      <ip address='192.168.0.9'/>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
     </interface>
-    <input type='mouse' bus='xen'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <console type='pty'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='xen'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index f37b28680d57751b8509fd8c9f18732433e63bf8..c60a3ea2d2e4b94aa9c7713eb871f5fcc99af2a5 100755 (executable)
@@ -13,4 +13,4 @@ vncunused = 1
 vnclisten = "127.0.0.1"
 vncpasswd = "123poi"
 disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
-vif = [ "mac=00:16:3E:66:94:9C,ip=192.168.0.9" ]
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0" ]
index b82cee646ac2b4187c65fa52e9053e28c6f4de80..620f701e0ab385000c9d96dcb6382368580776e0 100644 (file)
@@ -1,27 +1,32 @@
 <domain type='xen'>
   <name>XenGuest1</name>
   <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
-  <bootloader>/usr/bin/pygrub</bootloader>
-  <currentMemory>403456</currentMemory>
   <memory>592896</memory>
+  <currentMemory>403456</currentMemory>
   <vcpu>1</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='i686' machine='xenpv'>linux</type>
+  </os>
+  <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
+    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
     <disk type='block' device='disk'>
       <driver name='phy'/>
       <source dev='/dev/HostVG/XenGuest1'/>
       <target dev='xvda' bus='xen'/>
     </disk>
     <interface type='bridge'>
-      <mac address='00:16:3E:66:94:9C'/>
-      <ip address='192.168.0.9'/>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
     </interface>
-    <input type='mouse' bus='xen'/>
-    <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/>
     <console type='pty'>
       <target port='0'/>
     </console>
+    <input type='mouse' bus='xen'/>
+    <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
   </devices>
 </domain>
index 389bf287d7715c48c2e5f3af538a14f769ff17b9..5c2eeb1c598362056bd53e672a667476ad116e98 100644 (file)
 #include "xen_unified.h"
 #include "xm_internal.h"
 #include "testutils.h"
-#include "conf.h"
+#include "testutilsxen.h"
+#include "memory.h"
 
 static char *progname;
 static char *abs_srcdir;
+static virCapsPtr caps;
 
 #define MAX_FILE 4096
 
@@ -54,6 +56,7 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
     int wrote = MAX_FILE;
     void *old_priv = NULL;
     struct _xenUnifiedPrivate priv;
+    virDomainDefPtr def = NULL;
 
     conn = virConnectOpenReadOnly("test:///default");
     if (!conn) goto fail;
@@ -67,9 +70,13 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
 
     /* Many puppies died to bring you this code. */
     priv.xendConfigVersion = xendConfigVersion;
+    priv.caps = caps;
     conn->privateData = &priv;
 
-    if (!(conf = xenXMParseXMLToConfig(conn, xmlPtr)))
+    if (!(def = virDomainDefParseString(NULL, caps, xmlPtr)))
+        goto fail;
+
+    if (!(conf = xenXMDomainConfigFormat(conn, def)))
         goto fail;
 
     if (virConfWriteMem(gotxmcfgPtr, &wrote, conf) < 0)
@@ -86,7 +93,7 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
  fail:
     if (conf)
         virConfFree(conf);
-
+    virDomainDefFree(def);
     if (conn) {
         conn->privateData = old_priv;
         virConnectClose(conn);
@@ -107,6 +114,7 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
     virConnectPtr conn;
     void *old_priv;
     struct _xenUnifiedPrivate priv;
+    virDomainDefPtr def = NULL;
 
     conn = virConnectOpenReadOnly("test:///default");
     if (!conn) goto fail;
@@ -120,12 +128,16 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
 
     /* Many puppies died to bring you this code. */
     priv.xendConfigVersion = xendConfigVersion;
+    priv.caps = caps;
     conn->privateData = &priv;
 
     if (!(conf = virConfReadMem(xmcfgPtr, strlen(xmcfgPtr))))
         goto fail;
 
-    if (!(gotxml = xenXMDomainFormatXML(conn, conf)))
+    if (!(def = xenXMDomainConfigParse(conn, conf)))
+        goto fail;
+
+    if (!(gotxml = virDomainDefFormat(conn, def, VIR_DOMAIN_XML_SECURE)))
         goto fail;
 
     if (STRNEQ(xmlData, gotxml)) {
@@ -138,8 +150,8 @@ static int testCompareFormatXML(const char *xmcfg, const char *xml,
  fail:
     if (conf)
         virConfFree(conf);
-    free(gotxml);
-
+    VIR_FREE(gotxml);
+    virDomainDefFree(def);
     if (conn) {
         conn->privateData = old_priv;
         virConnectClose(conn);
@@ -187,6 +199,8 @@ mymain(int argc, char **argv)
     if (!abs_srcdir)
         abs_srcdir = getcwd(cwd, sizeof(cwd));
 
+    if (!(caps = testXenCapsInit()))
+        return(EXIT_FAILURE);
 
 #define DO_TEST(name, version)                                          \
     do {                                                                \
@@ -224,6 +238,9 @@ mymain(int argc, char **argv)
     DO_TEST("fullvirt-sound", 2);
 
     DO_TEST("escape-paths", 2);
+
+    virCapabilitiesFree(caps);
+
     return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }