Re: [libvirt] [libvirt-gconfig PATCHv2 06/32] Add gobject boilerplate for GVirConfigClock and GVirConfigTimer

2011-11-22 Thread Daniel P. Berrange
On Mon, Nov 21, 2011 at 07:04:03PM +0100, Christophe Fergeau wrote:
 ---
  libvirt-gconfig/Makefile.am |4 ++
  libvirt-gconfig/libvirt-gconfig-clock.c |   81 
 +++
  libvirt-gconfig/libvirt-gconfig-clock.h |   68 ++
  libvirt-gconfig/libvirt-gconfig-timer.c |   81 
 +++
  libvirt-gconfig/libvirt-gconfig-timer.h |   68 ++
  libvirt-gconfig/libvirt-gconfig.h   |2 +
  libvirt-gconfig/libvirt-gconfig.sym |8 +++
  7 files changed, 312 insertions(+), 0 deletions(-)
  create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.c
  create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.h
  create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.c
  create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.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


Re: [libvirt] [libvirt-gconfig PATCHv2 06/32] Add gobject boilerplate for GVirConfigClock and GVirConfigTimer

2011-11-22 Thread Daniel P. Berrange
On Tue, Nov 22, 2011 at 12:48:54PM +, Daniel P. Berrange wrote:
 On Mon, Nov 21, 2011 at 07:04:03PM +0100, Christophe Fergeau wrote:
  ---
   libvirt-gconfig/Makefile.am |4 ++
   libvirt-gconfig/libvirt-gconfig-clock.c |   81 
  +++
   libvirt-gconfig/libvirt-gconfig-clock.h |   68 ++
   libvirt-gconfig/libvirt-gconfig-timer.c |   81 
  +++
   libvirt-gconfig/libvirt-gconfig-timer.h |   68 ++
   libvirt-gconfig/libvirt-gconfig.h   |2 +
   libvirt-gconfig/libvirt-gconfig.sym |8 +++
   7 files changed, 312 insertions(+), 0 deletions(-)
   create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.c
   create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.h
   create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.c
   create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.h
 
 ACK

Actually, I'm afraid these classes need renaming to

  GVirConfigDomainClock and GVirConfigDomainTimer.


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 06/32] Add gobject boilerplate for GVirConfigClock and GVirConfigTimer

2011-11-21 Thread Christophe Fergeau
---
 libvirt-gconfig/Makefile.am |4 ++
 libvirt-gconfig/libvirt-gconfig-clock.c |   81 +++
 libvirt-gconfig/libvirt-gconfig-clock.h |   68 ++
 libvirt-gconfig/libvirt-gconfig-timer.c |   81 +++
 libvirt-gconfig/libvirt-gconfig-timer.h |   68 ++
 libvirt-gconfig/libvirt-gconfig.h   |2 +
 libvirt-gconfig/libvirt-gconfig.sym |8 +++
 7 files changed, 312 insertions(+), 0 deletions(-)
 create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.c
 create mode 100644 libvirt-gconfig/libvirt-gconfig-clock.h
 create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.c
 create mode 100644 libvirt-gconfig/libvirt-gconfig-timer.h

diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
index 52eff79..a2f01fd 100644
--- a/libvirt-gconfig/Makefile.am
+++ b/libvirt-gconfig/Makefile.am
@@ -8,6 +8,7 @@ GCONFIG_HEADER_FILES = \
libvirt-gconfig.h \
libvirt-gconfig-object.h \
libvirt-gconfig-capabilities.h \
+   libvirt-gconfig-clock.h \
libvirt-gconfig-domain.h \
libvirt-gconfig-domain-snapshot.h \
libvirt-gconfig-helpers.h \
@@ -16,6 +17,7 @@ GCONFIG_HEADER_FILES = \
libvirt-gconfig-network-filter.h \
libvirt-gconfig-node-device.h \
libvirt-gconfig-secret.h \
+   libvirt-gconfig-timer.h \
libvirt-gconfig-storage-pool.h \
libvirt-gconfig-storage-vol.h
 noinst_HEADERS = \
@@ -24,6 +26,7 @@ noinst_HEADERS = \
 GCONFIG_SOURCE_FILES = \
libvirt-gconfig-object.c \
libvirt-gconfig-capabilities.c \
+   libvirt-gconfig-clock.c \
libvirt-gconfig-domain.c \
libvirt-gconfig-domain-snapshot.c \
libvirt-gconfig-helpers.c \
@@ -32,6 +35,7 @@ GCONFIG_SOURCE_FILES = \
libvirt-gconfig-network-filter.c \
libvirt-gconfig-node-device.c \
libvirt-gconfig-secret.c \
+   libvirt-gconfig-timer.c \
libvirt-gconfig-storage-pool.c \
libvirt-gconfig-storage-vol.c
 
diff --git a/libvirt-gconfig/libvirt-gconfig-clock.c 
b/libvirt-gconfig/libvirt-gconfig-clock.c
new file mode 100644
index 000..1f28efb
--- /dev/null
+++ b/libvirt-gconfig/libvirt-gconfig-clock.c
@@ -0,0 +1,81 @@
+/*
+ * libvirt-gobject-config_clock.c: libvirt glib integration
+ *
+ * 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
+ */
+
+#include config.h
+
+#include string.h
+
+#include libxml/tree.h
+
+#include libvirt-gconfig/libvirt-gconfig.h
+
+extern gboolean debugFlag;
+
+#define DEBUG(fmt, ...) do { if (G_UNLIKELY(debugFlag)) g_debug(fmt, ## 
__VA_ARGS__); } while (0)
+
+#define GVIR_CONFIG_CLOCK_GET_PRIVATE(obj) \
+(G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_TYPE_CONFIG_CLOCK, 
GVirConfigClockPrivate))
+
+struct _GVirConfigClockPrivate
+{
+gboolean unused;
+};
+
+G_DEFINE_TYPE(GVirConfigClock, gvir_config_clock, GVIR_TYPE_CONFIG_OBJECT);
+
+
+static void gvir_config_clock_class_init(GVirConfigClockClass *klass)
+{
+g_type_class_add_private(klass, sizeof(GVirConfigClockPrivate));
+}
+
+
+static void gvir_config_clock_init(GVirConfigClock *klock)
+{
+GVirConfigClockPrivate *priv;
+
+DEBUG(Init GVirConfigClock=%p, klock);
+
+priv = klock-priv = GVIR_CONFIG_CLOCK_GET_PRIVATE(klock);
+
+memset(priv, 0, sizeof(*priv));
+}
+
+
+GVirConfigClock *gvir_config_clock_new(void)
+{
+GVirConfigObject *object;
+
+object = gvir_config_object_new(GVIR_TYPE_CONFIG_CLOCK,
+clock, NULL);
+return GVIR_CONFIG_CLOCK(object);
+}
+
+GVirConfigClock *gvir_config_clock_new_from_xml(const gchar *xml,
+GError **error)
+{
+GVirConfigObject *object;
+
+object =