[PATCH] Add nodeinfo call to virt module

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

 



Hi,

The attached patch adds a nodeinfo call to the virt module. It's
output is similar then that of "virsh nodeinfo".

Thanks for applying,
Tim

P.S. : I'll probably will be sending some more additions to the virt
module in the future.

-- 
Tim Verhoeven - tim.verhoeven.be@xxxxxxxxx - 0479 / 88 11 83

Hoping the problem  magically goes away  by ignoring it is the
"microsoft approach to programming" and should never be allowed.
(Linus Torvalds)
--- virt.py.orig	2008-02-08 13:31:26.000000000 +0100
+++ virt.py	2008-02-08 14:29:20.000000000 +0100
@@ -119,6 +119,8 @@
         state = self.find_vm(vmid).info()[0]
         return VIRT_STATE_NAME_MAP.get(state,"unknown")
 
+    def nodeinfo(self):
+        return self.conn.getInfo()
 
 
 class Virt(func_module.FuncModule):
@@ -155,6 +157,21 @@
             }
         return info
 
+    def nodeinfo(self):
+        self.__get_conn()
+        info = dict()
+        data = self.conn.nodeinfo()
+        info = {
+            "cpumodel"     : str(data[0]),
+            "phymemory"    : str(data[1]),
+            "cpus"         : str(data[2]),
+            "cpumhz"       : str(data[3]),
+            "numanodes"    : str(data[4]),
+            "sockets"      : str(data[5]),
+            "cpucores"     : str(data[6]),
+            "cputhreads"   : str(data[7])
+        }
+        return info
 
     def list_vms(self):
         self.conn = self.__get_conn()
_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux