[Libosinfo] [PATCH v2 1/2] Add gvir_config_object_replace_child_with_attribute_enum()
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Thu Mar 14 13:51:41 UTC 2013
From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
Internal libvirt-gconfig helper to replace enum XML attributes.
---
libvirt-gconfig/libvirt-gconfig-object-private.h | 5 +++++
libvirt-gconfig/libvirt-gconfig-object.c | 14 ++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
index 830517c..91355fb 100644
--- a/libvirt-gconfig/libvirt-gconfig-object-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
@@ -74,6 +74,11 @@ void gvir_config_object_replace_child_with_attribute(GVirConfigObject *object,
const char *child_name,
const char *attr_name,
const char *attr_value);
+void gvir_config_object_replace_child_with_attribute_enum(GVirConfigObject *object,
+ const char *child_name,
+ const char *attr_name,
+ GType attr_type,
+ unsigned int attr_value);
void gvir_config_object_delete_child(GVirConfigObject *object,
const char *child_name,
const char *ns_href);
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index ac0545c..c4e4271 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -459,6 +459,20 @@ gvir_config_object_replace_child_with_attribute(GVirConfigObject *object,
g_object_unref(G_OBJECT(child));
}
+G_GNUC_INTERNAL void
+gvir_config_object_replace_child_with_attribute_enum(GVirConfigObject *object,
+ const char *child_name,
+ const char *attr_name,
+ GType attr_type,
+ unsigned int attr_value)
+{
+ GVirConfigObject *child;
+
+ child = gvir_config_object_replace_child(object, child_name);
+ gvir_config_object_set_attribute_with_type(child, attr_name, attr_type, attr_value, NULL);
+ g_object_unref(G_OBJECT(child));
+}
+
struct NodeMatch {
const char *name;
const char *ns;
--
1.8.1.4
More information about the Libosinfo
mailing list