[libvirt-glib 4/4] config: Add GVirConfigDomainChannel getters

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

 



---
 libvirt-gconfig/libvirt-gconfig-domain-channel.c | 18 ++++++++++++++++++
 libvirt-gconfig/libvirt-gconfig-domain-channel.h |  3 +++
 libvirt-gconfig/libvirt-gconfig.sym              |  3 +++
 3 files changed, 24 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-channel.c b/libvirt-gconfig/libvirt-gconfig-domain-channel.c
index 92dd674..9578bf3 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-channel.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-channel.c
@@ -71,6 +71,17 @@ GVirConfigDomainChannel *gvir_config_domain_channel_new_from_xml(const gchar *xm
 }
 
 
+GVirConfigDomainChannelTargetType gvir_config_domain_channel_get_target_type(GVirConfigDomainChannel *channel)
+{
+    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_CHANNEL(channel),
+                         GVIR_CONFIG_DOMAIN_CHANNEL_TARGET_GUESTFWD);
+
+    return gvir_config_object_get_attribute_genum(GVIR_CONFIG_OBJECT(channel),
+                                                  "target", "type",
+                                                  GVIR_CONFIG_TYPE_DOMAIN_CHANNEL_TARGET_TYPE,
+                                                  GVIR_CONFIG_DOMAIN_CHANNEL_TARGET_GUESTFWD);
+}
+
 void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel,
                                                 GVirConfigDomainChannelTargetType type)
 {
@@ -82,6 +93,13 @@ void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel
                                                      type);
 }
 
+const gchar *gvir_config_domain_channel_get_target_name(GVirConfigDomainChannel *channel)
+{
+    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_CHANNEL(channel), NULL);
+
+    return gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(channel),
+                                            "target", "name");
+}
 
 void gvir_config_domain_channel_set_target_name(GVirConfigDomainChannel *channel,
                                                 const gchar *name)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-channel.h b/libvirt-gconfig/libvirt-gconfig-domain-channel.h
index 3f3558b..889b09a 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-channel.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-channel.h
@@ -67,8 +67,11 @@ GVirConfigDomainChannel *gvir_config_domain_channel_new(void);
 GVirConfigDomainChannel *gvir_config_domain_channel_new_from_xml(const gchar *xml,
                                                                  GError **error);
 
+GVirConfigDomainChannelTargetType gvir_config_domain_channel_get_target_type(GVirConfigDomainChannel *channel);
 void gvir_config_domain_channel_set_target_type(GVirConfigDomainChannel *channel,
                                                 GVirConfigDomainChannelTargetType type);
+
+const gchar *gvir_config_domain_channel_get_target_name(GVirConfigDomainChannel *channel);
 void gvir_config_domain_channel_set_target_name(GVirConfigDomainChannel *channel,
                                                 const gchar *name);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 886da2f..553d4fc 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -514,6 +514,9 @@ LIBVIRT_GCONFIG_0.1.6 {
 
 LIBVIRT_GCONFIG_0.1.7 {
   global:
+	gvir_config_domain_channel_get_target_name;
+	gvir_config_domain_channel_get_target_type;
+
 	gvir_config_domain_graphics_desktop_get_type;
 	gvir_config_domain_graphics_desktop_new;
 	gvir_config_domain_graphics_desktop_new_from_xml;
-- 
1.8.1.4

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