]> xenbits.xensource.com Git - libvirt.git/commitdiff
xenconfig: rm format/parse multi serial for xen-xm
authorBob Liu <bob.liu@oracle.com>
Thu, 18 Aug 2016 02:20:49 +0000 (10:20 +0800)
committerJim Fehlig <jfehlig@suse.com>
Fri, 2 Sep 2016 18:46:02 +0000 (12:46 -0600)
xen-xm doesn't support multi serial at all, this patch drop the
domXML <-> xl.cfg conversions.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
src/xenconfig/xen_common.c

index 844799098be9bada887d5d2991e28a74cc210bcd..7968d40acca055089346a29cb871cd47b540ec5c 100644 (file)
@@ -723,7 +723,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def)
 
 
 static int
-xenParseCharDev(virConfPtr conf, virDomainDefPtr def)
+xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat)
 {
     const char *str;
     virConfValuePtr value = NULL;
@@ -751,6 +751,12 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def)
         if (value && value->type == VIR_CONF_LIST) {
             int portnum = -1;
 
+            if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("Multiple serial devices are not supported by xen-xm"));
+                goto cleanup;
+            }
+
             value = value->list;
             while (value) {
                 char *port = NULL;
@@ -1095,7 +1101,7 @@ xenParseConfigCommon(virConfPtr conf,
     if (xenParseVfb(conf, def) < 0)
         return -1;
 
-    if (xenParseCharDev(conf, def) < 0)
+    if (xenParseCharDev(conf, def, nativeFormat) < 0)
         return -1;
 
     return 0;
@@ -1453,7 +1459,8 @@ xenFormatEventActions(virConfPtr conf, virDomainDefPtr def)
 
 
 static int
-xenFormatCharDev(virConfPtr conf, virDomainDefPtr def)
+xenFormatCharDev(virConfPtr conf, virDomainDefPtr def,
+                 const char *nativeFormat)
 {
     size_t i;
 
@@ -1493,6 +1500,12 @@ xenFormatCharDev(virConfPtr conf, virDomainDefPtr def)
                 int maxport = -1, port;
                 virConfValuePtr serialVal = NULL;
 
+                if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) {
+                    virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                                   _("Multiple serial devices are not supported by xen-xm"));
+                    return -1;
+                }
+
                 if (VIR_ALLOC(serialVal) < 0)
                     return -1;
 
@@ -1849,7 +1862,7 @@ xenFormatConfigCommon(virConfPtr conf,
     if (xenFormatPCI(conf, def) < 0)
         return -1;
 
-    if (xenFormatCharDev(conf, def) < 0)
+    if (xenFormatCharDev(conf, def, nativeFormat) < 0)
         return -1;
 
     if (xenFormatSound(conf, def) < 0)