Re: [PATCH 1/3] conf: Extend virDomainDeviceDefParse handled types

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

 



I'd reword the subject line as:

conf: Extend device types handled by virDomainDeviceDefParse


On 07/11/13 13:29, Michal Privoznik wrote:
Not all device types are parsed in virDomainDeviceDefParse, currently.

s/are/are currently/
s/, currently//

Since all functions needed do exist, nothing hold us back to make the

s/hold/holds/

implementation complete. Similarly, the virDomainDeviceDefFree needs to
be updated as well.
---
  src/conf/domain_conf.c | 37 +++++++++++++++++++++++++++++++++++--
  1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4013267..d0c87b2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c

...


@@ -9388,6 +9398,29 @@ virDomainDeviceDefParse(const char *xmlStr,
          dev->type = VIR_DOMAIN_DEVICE_RNG;
          if (!(dev->data.rng = virDomainRNGDefParseXML(node, ctxt, flags)))
              goto error;
+    } else if (xmlStrEqual(node->name, BAD_CAST "channel") ||
+               xmlStrEqual(node->name, BAD_CAST "console") ||
+               xmlStrEqual(node->name, BAD_CAST "parallel") ||
+               xmlStrEqual(node->name, BAD_CAST "serial")) {

hmm, right, those elements map into a single internal structure type

+        dev->type = VIR_DOMAIN_DEVICE_CHR;
+        if (!(dev->data.chr = virDomainChrDefParseXML(ctxt,
+                                                      node,
+                                                      def->seclabels,
+                                                      def->nseclabels,
+                                                      flags)))
+            goto error;

ACK with the commit message updated.

Peter

--
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]