From: Daniel P. Berrange Date: Tue, 29 Nov 2011 15:28:26 +0000 (+0000) Subject: Add suspend info to Xen, LXC and UML hypervisor capabilities X-Git-Tag: v0.9.8-rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ae0b8349cc31922260207b7551f3a77ae44d685;p=thirdparty%2Flibvirt.git Add suspend info to Xen, LXC and UML hypervisor capabilities * 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 --- diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index 52e99ca1c2..e8427364f5 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 d4cb12b003..a576047d75 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 870bc4f910..6c71b65bb5 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 42b099c9b4..872e5f6698 100644 --- a/tests/xencapsdata/xen-i686-pae-hvm.xml +++ b/tests/xencapsdata/xen-i686-pae-hvm.xml @@ -7,6 +7,7 @@ + diff --git a/tests/xencapsdata/xen-i686-pae.xml b/tests/xencapsdata/xen-i686-pae.xml index a6cec8a617..3dba6ebbcf 100644 --- a/tests/xencapsdata/xen-i686-pae.xml +++ b/tests/xencapsdata/xen-i686-pae.xml @@ -7,6 +7,7 @@ + diff --git a/tests/xencapsdata/xen-i686.xml b/tests/xencapsdata/xen-i686.xml index 907121215f..22d7685fcd 100644 --- a/tests/xencapsdata/xen-i686.xml +++ b/tests/xencapsdata/xen-i686.xml @@ -4,6 +4,7 @@ i686 + diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml index 732b693727..222de1dadb 100644 --- a/tests/xencapsdata/xen-ia64-be-hvm.xml +++ b/tests/xencapsdata/xen-ia64-be-hvm.xml @@ -4,6 +4,7 @@ ia64 + diff --git a/tests/xencapsdata/xen-ia64-be.xml b/tests/xencapsdata/xen-ia64-be.xml index 4f133ec60d..017816c4db 100644 --- a/tests/xencapsdata/xen-ia64-be.xml +++ b/tests/xencapsdata/xen-ia64-be.xml @@ -4,6 +4,7 @@ ia64 + diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml index ef48a95e39..33c49469c4 100644 --- a/tests/xencapsdata/xen-ia64-hvm.xml +++ b/tests/xencapsdata/xen-ia64-hvm.xml @@ -4,6 +4,7 @@ ia64 + diff --git a/tests/xencapsdata/xen-ia64.xml b/tests/xencapsdata/xen-ia64.xml index 5570f4dfd9..82ce965625 100644 --- a/tests/xencapsdata/xen-ia64.xml +++ b/tests/xencapsdata/xen-ia64.xml @@ -4,6 +4,7 @@ ia64 + diff --git a/tests/xencapsdata/xen-ppc64.xml b/tests/xencapsdata/xen-ppc64.xml index 627d79c141..91401b9387 100644 --- a/tests/xencapsdata/xen-ppc64.xml +++ b/tests/xencapsdata/xen-ppc64.xml @@ -4,6 +4,7 @@ ppc64 + diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml index 52c12c616e..8de8cf4468 100644 --- a/tests/xencapsdata/xen-x86_64-hvm.xml +++ b/tests/xencapsdata/xen-x86_64-hvm.xml @@ -7,6 +7,7 @@ + diff --git a/tests/xencapsdata/xen-x86_64.xml b/tests/xencapsdata/xen-x86_64.xml index 0faa43c791..0c3279bb24 100644 --- a/tests/xencapsdata/xen-x86_64.xml +++ b/tests/xencapsdata/xen-x86_64.xml @@ -7,6 +7,7 @@ +