[virt-tools-list] [PATCH 2/3] Add inspection data to the domain object.
Richard W.M. Jones
rjones at redhat.com
Tue Apr 19 11:01:56 UTC 2011
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
-------------- next part --------------
>From 62beb3b3fd835b2e861d5584c9e71e1d1582d581 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Tue, 19 Apr 2011 10:44:30 +0100
Subject: [PATCH 2/3] Add inspection data to the domain object.
This adds the inspection data to the domain object, and passes the
data up from the inspection thread.
Also an inspection-changed signal has been added so that UI elements
can find out when inspection has finished for a particular VM and
update the UI.
---
src/virtManager/domain.py | 44 +++++++++++++++++++++++++++++++++++++++++
src/virtManager/inspection.py | 9 +++++++-
2 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index 837e1c9..ada7ca4 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -128,6 +128,9 @@ class vmmDomainBase(vmmLibvirtObject):
"resources-sampled": (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
[]),
+ "inspection-changed": (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ []),
}
def __init__(self, connection, backend, uuid):
@@ -163,6 +166,14 @@ class vmmDomainBase(vmmLibvirtObject):
self._stats_disk_supported = True
self._stats_disk_skip = []
+ self.inspection_type = None
+ self.inspection_distro = None
+ self.inspection_major_version = None
+ self.inspection_minor_version = None
+ self.inspection_product_variant = None
+ self.inspection_hostname = None
+ self.inspection_product_name = None
+
def change_name_backend(self, newbackend):
# Used for changing the domain object after a rename
self._backend = newbackend
@@ -950,6 +961,39 @@ class vmmDomainBase(vmmLibvirtObject):
return self.config.get_pervm(self.connection.get_uri(), self.uuid,
self.config.get_details_window_size)
+ # Information from libguestfs inspection.
+ def set_inspection_type(self, new):
+ self.inspection_type = str(new)
+ def set_inspection_distro(self, new):
+ self.inspection_distro = str(new)
+ def set_inspection_major_version(self, new):
+ self.inspection_major_version = int(new)
+ def set_inspection_minor_version(self, new):
+ self.inspection_minor_version = int(new)
+ def set_inspection_product_variant(self, new):
+ self.inspection_product_variant = str(new)
+ def set_inspection_hostname(self, new):
+ self.inspection_hostname = str(new)
+ def set_inspection_product_name(self, new):
+ self.inspection_product_name = str(new)
+
+ def inspection_data_updated(self):
+ self.idle_emit("inspection-changed")
+
+ def get_inspection_type(self):
+ return self.inspection_type
+ def get_inspection_distro(self):
+ return self.inspection_distro
+ def get_inspection_major_version(self):
+ return self.inspection_major_version
+ def get_inspection_minor_version(self):
+ return self.inspection_minor_version
+ def get_inspection_product_variant(self):
+ return self.inspection_product_variant
+ def get_inspection_hostname(self):
+ return self.inspection_hostname
+ def get_inspection_product_name(self):
+ return self.inspection_product_name
########################
diff --git a/src/virtManager/inspection.py b/src/virtManager/inspection.py
index b5d150d..5d91e97 100644
--- a/src/virtManager/inspection.py
+++ b/src/virtManager/inspection.py
@@ -117,4 +117,11 @@ class vmmInspection(Thread):
self._vmseen[vmuuid] = True
- pass
+ vm.set_inspection_type(typ)
+ vm.set_inspection_distro(distro)
+ vm.set_inspection_major_version(major_version)
+ vm.set_inspection_minor_version(minor_version)
+ vm.set_inspection_product_variant(product_variant)
+ vm.set_inspection_hostname(hostname)
+ vm.set_inspection_product_name(product_name)
+ vm.inspection_data_updated()
--
1.7.4.4
More information about the virt-tools-list
mailing list