[libvirt] [PATCH 2/4] xenconfig: rm format/parse multi serial for xen-xm

Bob Liu bob.liu at oracle.com
Wed Aug 17 01:23:22 UTC 2016


xen-xm doesn't support multi serial at all, this patch drop the
domXML <-> xl.cfg conversions.

Signed-off-by: Bob Liu <bob.liu at oracle.com>
---
 src/xenconfig/xen_common.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c
index 8447990..f532dd9 100644
--- a/src/xenconfig/xen_common.c
+++ b/src/xenconfig/xen_common.c
@@ -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",
+                               _("Multi serial is 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",
+                                   _("Multi serial is 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)
-- 
2.6.5




More information about the libvir-list mailing list