[Libvirt-cim] [PATCH 1 of 4] Make get_node_content(), get_attr_value() non static

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Jul 22 00:11:21 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1248123211 25200
# Node ID 5eefe23b2be112a925b834931897e61b97d2cd06
# Parent  1f48bb4249af07d7598308b8ac7c1aad5e2e3743
Make get_node_content(), get_attr_value() non static

This makes these functions to be available for use in pool_parsing.c

Also, move XSTREQ() and STRPROP() to device_parsing.h so it can be used in
pool_parsing.c

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c	Tue Jul 14 22:13:01 2009 -0700
+++ b/libxkutil/device_parsing.c	Mon Jul 20 13:53:31 2009 -0700
@@ -27,9 +27,6 @@
 #include <stdbool.h>
 #include <inttypes.h>
 #include <sys/stat.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xpath.h>
 
 #include <libcmpiutil/libcmpiutil.h>
 
@@ -49,7 +46,6 @@
 #define DEFAULT_BRIDGE "xenbr0"
 #define DEFAULT_NETWORK "default"
 
-#define XSTREQ(x, y) (STREQ((char *)x, y))
 #define MAX(a,b) (((a)>(b))?(a):(b))
 
 static void cleanup_disk_device(struct disk_device *dev)
@@ -123,7 +119,7 @@
         *_devs = NULL;
 }
 
-static char *get_attr_value(xmlNode *node, char *attrname)
+char *get_attr_value(xmlNode *node, char *attrname)
 {
         char *buf = NULL;
         char *ret = NULL;
@@ -137,7 +133,7 @@
         return ret;
 }
 
-static char *get_node_content(xmlNode *node)
+char *get_node_content(xmlNode *node)
 {
         char *buf = NULL;
         xmlChar *ret = NULL;
@@ -809,8 +805,6 @@
         return 1;
 }
 
-#define STRPROP(d, p, n) (d->p = get_node_content(n))
-
 static int parse_os(struct domain *dominfo, xmlNode *os)
 {
         xmlNode *child;
diff -r 1f48bb4249af -r 5eefe23b2be1 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h	Tue Jul 14 22:13:01 2009 -0700
+++ b/libxkutil/device_parsing.h	Mon Jul 20 13:53:31 2009 -0700
@@ -27,6 +27,9 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <libvirt/libvirt.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
 
 #include "../src/svpc_types.h"
 
@@ -169,6 +172,9 @@
 void cleanup_virt_device(struct virt_device *dev);
 void cleanup_virt_devices(struct virt_device **devs, int count);
 
+char *get_node_content(xmlNode *node);
+char *get_attr_value(xmlNode *node, char *attrname);
+
 char *get_fq_devid(char *host, char *_devid);
 int parse_fq_devid(const char *devid, char **host, char **device);
 
@@ -176,6 +182,9 @@
 int detach_device(virDomainPtr dom, struct virt_device *dev);
 int change_device(virDomainPtr dom, struct virt_device *dev);
 
+#define XSTREQ(x, y) (STREQ((char *)x, y))
+#define STRPROP(d, p, n) (d->p = get_node_content(n))
+
 #endif
 
 /*




More information about the Libvirt-cim mailing list