[PATCH 1/2 v3] Fix virDomainChrDefParseTargetXML() to parse the target port if available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
this is the patch to fix the virDomainChrDefParseTargetXML() functionality
to parse the target port from XML if available. This is necessary for
multiple serial port support which is the second part of this patch.

Michal

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>
---
 src/conf/domain_conf.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e7c3409..16a75f5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2973,7 +2973,8 @@ virDomainChrDefParseTargetXML(virCapsPtr caps,
     default:
         portStr = virXMLPropString(cur, "port");
         if (portStr == NULL) {
-            /* Not required. It will be assigned automatically later */
+            /* Set to negative value to indicate we should set it later */
+            def->target.port = -1;
             break;
         }
 
@@ -2983,6 +2984,7 @@ virDomainChrDefParseTargetXML(virCapsPtr caps,
                                  portStr);
             goto error;
         }
+        def->target.port = port;
         break;
     }
 
@@ -5566,7 +5568,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         if (!chr)
             goto error;
 
-        chr->target.port = i;
+        if (chr->target.port < 0)
+            chr->target.port = i;
         def->serials[def->nserials++] = chr;
     }
     VIR_FREE(nodes);
-- 
1.7.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]