Re: [libvirt] [libvirt-gconfig PATCHv2 03/32] Make some GVirConfigObject helpers private

2011-11-22 Thread Daniel P. Berrange
On Mon, Nov 21, 2011 at 07:04:00PM +0100, Christophe Fergeau wrote:
 At this point, I'm not sure how/if the library user should be able
 to directly manipulate the XML data wrapped by a GVirConfigObject.
 It's preferrable to hide this API from the user until we have a
 clearer idea how to expose it.
 ---
  libvirt-gconfig/Makefile.am  |3 +-
  libvirt-gconfig/libvirt-gconfig-domain.c |1 +
  libvirt-gconfig/libvirt-gconfig-object-private.h |   41 
 ++
  libvirt-gconfig/libvirt-gconfig-object.c |   28 +--
  libvirt-gconfig/libvirt-gconfig-object.h |   11 --
  libvirt-gconfig/libvirt-gconfig.sym  |1 -
  6 files changed, 61 insertions(+), 24 deletions(-)
  create mode 100644 libvirt-gconfig/libvirt-gconfig-object-private.h

ACK

Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

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


[libvirt] [libvirt-gconfig PATCHv2 03/32] Make some GVirConfigObject helpers private

2011-11-21 Thread Christophe Fergeau
At this point, I'm not sure how/if the library user should be able
to directly manipulate the XML data wrapped by a GVirConfigObject.
It's preferrable to hide this API from the user until we have a
clearer idea how to expose it.
---
 libvirt-gconfig/Makefile.am  |3 +-
 libvirt-gconfig/libvirt-gconfig-domain.c |1 +
 libvirt-gconfig/libvirt-gconfig-object-private.h |   41 ++
 libvirt-gconfig/libvirt-gconfig-object.c |   28 +--
 libvirt-gconfig/libvirt-gconfig-object.h |   11 --
 libvirt-gconfig/libvirt-gconfig.sym  |1 -
 6 files changed, 61 insertions(+), 24 deletions(-)
 create mode 100644 libvirt-gconfig/libvirt-gconfig-object-private.h

diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
index 0d15e78..52eff79 100644
--- a/libvirt-gconfig/Makefile.am
+++ b/libvirt-gconfig/Makefile.am
@@ -19,7 +19,8 @@ GCONFIG_HEADER_FILES = \
libvirt-gconfig-storage-pool.h \
libvirt-gconfig-storage-vol.h
 noinst_HEADERS = \
-   libvirt-gconfig-helpers-private.h
+   libvirt-gconfig-helpers-private.h \
+   libvirt-gconfig-object-private.h
 GCONFIG_SOURCE_FILES = \
libvirt-gconfig-object.c \
libvirt-gconfig-capabilities.c \
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c 
b/libvirt-gconfig/libvirt-gconfig-domain.c
index 3290389..d971a95 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -27,6 +27,7 @@
 
 #include libvirt-gconfig/libvirt-gconfig.h
 #include libvirt-gconfig/libvirt-gconfig-helpers-private.h
+#include libvirt-gconfig/libvirt-gconfig-object-private.h
 
 extern gboolean debugFlag;
 
diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h 
b/libvirt-gconfig/libvirt-gconfig-object-private.h
new file mode 100644
index 000..aec88bf
--- /dev/null
+++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
@@ -0,0 +1,41 @@
+/*
+ * libvirt-gconfig-config-object-private.h: base object for XML configuration
+ *
+ * Copyright (C) 2011 Red Hat
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ *
+ * Author: Christophe Fergeau cferg...@redhat.com
+ */
+#ifndef __LIBVIRT_GCONFIG_OBJECT_PRIVATE_H__
+#define __LIBVIRT_GCONFIG_OBJECT_PRIVATE_H__
+
+G_BEGIN_DECLS
+
+xmlNodePtr gvir_config_object_get_xml_node(GVirConfigObject *config);
+char *gvir_config_object_get_node_content(GVirConfigObject *object,
+  const char *node_name);
+guint64 gvir_config_object_get_node_content_uint64(GVirConfigObject *object,
+   const char *node_name);
+void gvir_config_object_set_node_content(GVirConfigObject *object,
+ const char *node_name,
+ const char *value);
+void gvir_config_object_set_node_content_uint64(GVirConfigObject *object,
+const char *node_name,
+guint64 value);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GCONFIG_OBJECT_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c 
b/libvirt-gconfig/libvirt-gconfig-object.c
index fbdbedd..276be8c 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -29,6 +29,7 @@
 
 #include libvirt-gconfig/libvirt-gconfig.h
 #include libvirt-gconfig/libvirt-gconfig-helpers-private.h
+#include libvirt-gconfig/libvirt-gconfig-object-private.h
 
 
 //extern gboolean debugFlag;
@@ -277,13 +278,15 @@ const gchar 
*gvir_config_object_get_schema(GVirConfigObject *config)
 /* FIXME: will we always have one xmlNode per GConfig object? */
 /* FIXME: need to return the right node from subclasses */
 /* NB: the xmlNodePtr must not be freed by the caller */
-xmlNodePtr gvir_config_object_get_xml_node(GVirConfigObject *config)
+G_GNUC_INTERNAL xmlNodePtr
+gvir_config_object_get_xml_node(GVirConfigObject *config)
 {
 return config-priv-node;
 }
 
-char *gvir_config_object_get_node_content(GVirConfigObject *object,
-  const char *node_name)