Re: [libvirt] [PATCH]: pass flags to all virDomain*DefParse* functions

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

 



On Thu, Jan 08, 2009 at 05:02:14PM +0100, Jim Meyering wrote:
[..snip..] 
> Hi Guido,
> 
> libvirt doesn't build right now, because of this:
> 
> xm_internal.c:2288: error: too few arguments to function 'virDomainDefParseString'
> xm_internal.c:2530: error: too few arguments to function 'virDomainDeviceDefParse'
> xm_internal.c:2619: error: too few arguments to function 'virDomainDeviceDefParse'
> xend_internal.c:3860: error: too few arguments to function 'virDomainDeviceDefParse'
> xend_internal.c:3950: error: too few arguments to function 'virDomainDeviceDefParse'
Thought I had tested this with the Xen driver enabled, but seems I
didn't. Sorry! Attached patch fixes the build and passes "make check".
Thanks for pointing this out!
 -- Guido

>From 02b28e14c9ed5d8ccb687675638005fee121b143 Mon Sep 17 00:00:00 2001
From: Guido Guenther <agx@xxxxxxxxxxx>
Date: Thu, 8 Jan 2009 18:09:12 +0100
Subject: [PATCH] add VIR_XML_DOMAIN_INACTIVE for xen too

---
 src/xend_internal.c   |    4 ++--
 src/xm_internal.c     |    7 ++++---
 tests/xmconfigtest.c  |    3 ++-
 tests/xml2sexprtest.c |    3 ++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/xend_internal.c b/src/xend_internal.c
index 2b15592..c3ffd63 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -3857,7 +3857,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml)
 
     if (!(dev = virDomainDeviceDefParse(domain->conn,
                                         priv->caps,
-                                        def, xml)))
+                                        def, xml, VIR_DOMAIN_XML_INACTIVE)))
         goto cleanup;
 
 
@@ -3947,7 +3947,7 @@ xenDaemonDetachDevice(virDomainPtr domain, const char *xml)
 
     if (!(dev = virDomainDeviceDefParse(domain->conn,
                                         priv->caps,
-                                        def, xml)))
+                                        def, xml, VIR_DOMAIN_XML_INACTIVE)))
         goto cleanup;
 
     if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref)))
diff --git a/src/xm_internal.c b/src/xm_internal.c
index b6d5c01..bfa3ff2 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -2285,7 +2285,8 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
         return (NULL);
 #endif
 
-    if (!(def = virDomainDefParseString(conn, priv->caps, xml)))
+    if (!(def = virDomainDefParseString(conn, priv->caps, xml,
+                                        VIR_DOMAIN_XML_INACTIVE)))
         return (NULL);
 
     if (virHashLookup(nameConfigMap, def->name)) {
@@ -2527,7 +2528,7 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
     if (!(dev = virDomainDeviceDefParse(domain->conn,
                                         priv->caps,
                                         entry->def,
-                                        xml)))
+                                        xml, VIR_DOMAIN_XML_INACTIVE)))
         return -1;
 
     switch (dev->type) {
@@ -2616,7 +2617,7 @@ xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
     if (!(dev = virDomainDeviceDefParse(domain->conn,
                                         priv->caps,
                                         entry->def,
-                                        xml)))
+                                        xml, VIR_DOMAIN_XML_INACTIVE)))
         return -1;
 
     switch (dev->type) {
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 7ac5afb..bb2803f 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -70,7 +70,8 @@ static int testCompareParseXML(const char *xmcfg, const char *xml,
     priv.caps = caps;
     conn->privateData = &priv;
 
-    if (!(def = virDomainDefParseString(NULL, caps, xmlPtr)))
+    if (!(def = virDomainDefParseString(NULL, caps, xmlPtr,
+                                        VIR_DOMAIN_XML_INACTIVE)))
         goto fail;
 
     if (!(conf = xenXMDomainConfigFormat(conn, def)))
diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c
index b05e6c8..b06c3ac 100644
--- a/tests/xml2sexprtest.c
+++ b/tests/xml2sexprtest.c
@@ -35,7 +35,8 @@ static int testCompareFiles(const char *xml, const char *sexpr,
   if (virtTestLoadFile(sexpr, &sexprPtr, MAX_FILE) < 0)
       goto fail;
 
-  if (!(def = virDomainDefParseString(NULL, caps, xmlData)))
+  if (!(def = virDomainDefParseString(NULL, caps, xmlData,
+                                      VIR_DOMAIN_XML_INACTIVE)))
       goto fail;
 
   if (!(gotsexpr = xenDaemonFormatSxpr(NULL, def, xendConfigVersion)))
-- 
1.5.6.5

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