[libvirt-glib 3/6] Add gvir_domain_device_get_domain()

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

 



From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>

Getter for the associated domain of a domain device.
---
 libvirt-gobject/libvirt-gobject-domain-device.c |   10 ++++++++++
 libvirt-gobject/libvirt-gobject-domain-device.h |    3 +++
 libvirt-gobject/libvirt-gobject.sym             |    1 +
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libvirt-gobject/libvirt-gobject-domain-device.c b/libvirt-gobject/libvirt-gobject-domain-device.c
index 528b513..6282d8b 100644
--- a/libvirt-gobject/libvirt-gobject-domain-device.c
+++ b/libvirt-gobject/libvirt-gobject-domain-device.c
@@ -134,3 +134,13 @@ virDomainPtr gvir_domain_device_get_domain_handle(GVirDomainDevice *self)
 
     return handle;
 }
+
+/**
+ * gvir_domain_device_get_domain:
+ * @device: the domain device
+ *
+ * Returns: (transfer full): the associate domain
+ */
+GVirDomain *gvir_domain_device_get_domain(GVirDomainDevice *device) {
+    return g_object_ref (device->priv->domain);
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain-device.h b/libvirt-gobject/libvirt-gobject-domain-device.h
index 96c0433..98acc2d 100644
--- a/libvirt-gobject/libvirt-gobject-domain-device.h
+++ b/libvirt-gobject/libvirt-gobject-domain-device.h
@@ -27,6 +27,8 @@
 #ifndef __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
 #define __LIBVIRT_GOBJECT_DOMAIN_DEVICE_H__
 
+#include <libvirt-gobject/libvirt-gobject-domain.h>
+
 G_BEGIN_DECLS
 
 #define GVIR_TYPE_DOMAIN_DEVICE            (gvir_domain_device_get_type ())
@@ -58,6 +60,7 @@ struct _GVirDomainDeviceClass
 
 
 GType gvir_domain_device_get_type(void);
+GVirDomain *gvir_domain_device_get_domain(GVirDomainDevice *device);
 
 G_END_DECLS
 
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 5081f41..0097692 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -33,6 +33,7 @@ LIBVIRT_GOBJECT_0.0.4 {
 	gvir_connection_get_node_info;
 
 	gvir_domain_device_get_type;
+	gvir_domain_device_get_domain;
 
 	gvir_domain_disk_get_type;
 	gvir_domain_disk_stats_get_type;
-- 
1.7.7.6

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