[libvirt] [PATCH 13/14] Add suspend info to Xen, LXC and UML hypervisor capabilities

Daniel P. Berrange berrange at redhat.com
Tue Nov 29 15:44:48 UTC 2011


From: "Daniel P. Berrange" <berrange at redhat.com>

* src/lxc/lxc_conf.c, src/uml/uml_conf.c,
  src/xen/xen_hypervisor.c: Initialize suspend capabilities
* tests/xencapsdata/*xml: Add empty powermgmt capabilities
---
 src/lxc/lxc_conf.c                     |    5 +++++
 src/uml/uml_conf.c                     |    5 +++++
 src/xen/xen_hypervisor.c               |    4 ++++
 tests/xencapsdata/xen-i686-pae-hvm.xml |    1 +
 tests/xencapsdata/xen-i686-pae.xml     |    1 +
 tests/xencapsdata/xen-i686.xml         |    1 +
 tests/xencapsdata/xen-ia64-be-hvm.xml  |    1 +
 tests/xencapsdata/xen-ia64-be.xml      |    1 +
 tests/xencapsdata/xen-ia64-hvm.xml     |    1 +
 tests/xencapsdata/xen-ia64.xml         |    1 +
 tests/xencapsdata/xen-ppc64.xml        |    1 +
 tests/xencapsdata/xen-x86_64-hvm.xml   |    1 +
 tests/xencapsdata/xen-x86_64.xml       |    1 +
 13 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
index 52e99ca..e842736 100644
--- a/src/lxc/lxc_conf.c
+++ b/src/lxc/lxc_conf.c
@@ -37,6 +37,8 @@
 #include "uuid.h"
 #include "configmake.h"
 #include "lxc_container.h"
+#include "virnodesuspend.h"
+
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
@@ -71,6 +73,9 @@ virCapsPtr lxcCapsInit(void)
         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
     }
 
+    if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
+        VIR_WARN("Failed to get host power management capabilities");
+
     if (virGetHostUUID(caps->host.host_uuid)) {
         lxcError(VIR_ERR_INTERNAL_ERROR,
                  "%s", _("cannot get the host uuid"));
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index d4cb12b..a576047 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -47,6 +47,8 @@
 #include "virfile.h"
 #include "command.h"
 #include "virnetdevtap.h"
+#include "virnodesuspend.h"
+
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
@@ -81,6 +83,9 @@ virCapsPtr umlCapsInit(void) {
         VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
     }
 
+    if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
+        VIR_WARN("Failed to get host power management capabilities");
+
     if (virGetHostUUID(caps->host.host_uuid)) {
         umlReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("cannot get the host uuid"));
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 870bc4f..6c71b65 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -66,6 +66,7 @@
 #include "capabilities.h"
 #include "memory.h"
 #include "virfile.h"
+#include "virnodesuspend.h"
 
 #define VIR_FROM_THIS VIR_FROM_XEN
 
@@ -2743,6 +2744,9 @@ xenHypervisorMakeCapabilities(virConnectPtr conn)
                                                  cpuinfo,
                                                  capabilities);
 
+    if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
+        VIR_WARN("Failed to get host power management capabilities");
+
     VIR_FORCE_FCLOSE(cpuinfo);
     VIR_FORCE_FCLOSE(capabilities);
 
diff --git a/tests/xencapsdata/xen-i686-pae-hvm.xml b/tests/xencapsdata/xen-i686-pae-hvm.xml
index 42b099c..872e5f6 100644
--- a/tests/xencapsdata/xen-i686-pae-hvm.xml
+++ b/tests/xencapsdata/xen-i686-pae-hvm.xml
@@ -7,6 +7,7 @@
         <vmx/>
       </features>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-i686-pae.xml b/tests/xencapsdata/xen-i686-pae.xml
index a6cec8a..3dba6eb 100644
--- a/tests/xencapsdata/xen-i686-pae.xml
+++ b/tests/xencapsdata/xen-i686-pae.xml
@@ -7,6 +7,7 @@
         <vmx/>
       </features>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-i686.xml b/tests/xencapsdata/xen-i686.xml
index 9071212..22d7685 100644
--- a/tests/xencapsdata/xen-i686.xml
+++ b/tests/xencapsdata/xen-i686.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>i686</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml
index 732b693..222de1d 100644
--- a/tests/xencapsdata/xen-ia64-be-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-be-hvm.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>ia64</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-ia64-be.xml b/tests/xencapsdata/xen-ia64-be.xml
index 4f133ec..017816c 100644
--- a/tests/xencapsdata/xen-ia64-be.xml
+++ b/tests/xencapsdata/xen-ia64-be.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>ia64</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml
index ef48a95..33c4946 100644
--- a/tests/xencapsdata/xen-ia64-hvm.xml
+++ b/tests/xencapsdata/xen-ia64-hvm.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>ia64</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-ia64.xml b/tests/xencapsdata/xen-ia64.xml
index 5570f4d..82ce965 100644
--- a/tests/xencapsdata/xen-ia64.xml
+++ b/tests/xencapsdata/xen-ia64.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>ia64</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-ppc64.xml b/tests/xencapsdata/xen-ppc64.xml
index 627d79c..91401b9 100644
--- a/tests/xencapsdata/xen-ppc64.xml
+++ b/tests/xencapsdata/xen-ppc64.xml
@@ -4,6 +4,7 @@
     <cpu>
       <arch>ppc64</arch>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml
index 52c12c6..8de8cf4 100644
--- a/tests/xencapsdata/xen-x86_64-hvm.xml
+++ b/tests/xencapsdata/xen-x86_64-hvm.xml
@@ -7,6 +7,7 @@
         <svm/>
       </features>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
diff --git a/tests/xencapsdata/xen-x86_64.xml b/tests/xencapsdata/xen-x86_64.xml
index 0faa43c..0c3279b 100644
--- a/tests/xencapsdata/xen-x86_64.xml
+++ b/tests/xencapsdata/xen-x86_64.xml
@@ -7,6 +7,7 @@
         <svm/>
       </features>
     </cpu>
+    <power_management/>
     <migration_features>
       <live/>
       <uri_transports>
-- 
1.7.6.4




More information about the libvir-list mailing list