[virt-tools-list] [virt-viewer][PATCH 3/6] Expose virt_viewer_get_domain interface.

lagarcia at linux.vnet.ibm.com lagarcia at linux.vnet.ibm.com
Fri Jan 18 17:27:35 UTC 2013


From: Leonardo Garcia <lagarcia at br.ibm.com>

Provide information on libvirt connection domain currently being viewed.

--

I understand this might not be the more correct way of doing this change and
the exposure of the domain information is definitely something that needs some
discussion if this patch series ended up being accepted in virt-viewer. I am
just putting it here this way because it was the simplest way I could find to
give a draft example of what I am trying to accomplish.
---
 src/virt-viewer.c |   11 +++++++++++
 src/virt-viewer.h |    3 +++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index aedbf73..3be0c49 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -718,6 +718,17 @@ virt_viewer_start(VirtViewerApp *app)
     return VIRT_VIEWER_APP_CLASS(virt_viewer_parent_class)->start(app);
 }
 
+const virDomainPtr *
+virt_viewer_get_domain(VirtViewer *self)
+{
+    VirtViewerPrivate *priv = self->priv;
+
+    return &(priv->dom);
+{
+
+}
+}
+
 VirtViewer *
 virt_viewer_new(const char *uri,
                 const char *name,
diff --git a/src/virt-viewer.h b/src/virt-viewer.h
index d136ade..de2485a 100644
--- a/src/virt-viewer.h
+++ b/src/virt-viewer.h
@@ -59,6 +59,9 @@ virt_viewer_new(const char *uri,
                 gboolean verbose,
                 GtkWidget *container);
 
+const virDomainPtr *
+virt_viewer_get_domain(VirtViewer *self);
+
 G_END_DECLS
 
 #endif /* VIRT_VIEWER_H */
-- 
1.7.1




More information about the virt-tools-list mailing list