libxl accepts hpet configuration in its domain info struct. Parse the
domain definition's <clock> element in order to set the value.
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
src/libxl/libxl_conf.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 9dc35fc..6ace10e 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -374,6 +374,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config
*d_config)
{
libxl_domain_build_info *b_info = &d_config->b_info;
int hvm = STREQ(def->os.type, "hvm");
+ int i;
libxl_init_build_info(b_info, &d_config->c_info);
@@ -399,6 +400,13 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config
*d_config)
b_info->u.hvm.pae = def->features & (1 <<
VIR_DOMAIN_FEATURE_PAE);
b_info->u.hvm.apic = def->features & (1 <<
VIR_DOMAIN_FEATURE_APIC);
b_info->u.hvm.acpi = def->features & (1 <<
VIR_DOMAIN_FEATURE_ACPI);
+ for (i = 0; i < def->clock.ntimers; i++) {
+ if (def->clock.timers[i]->name == VIR_DOMAIN_TIMER_NAME_HPET
&&
+ def->clock.timers[i]->present == 1) {
+ b_info->u.hvm.acpi.hpet = 1;
+ }
+ }
+
/*
* The following comment and calculation were taken directly from
* libxenlight's internal function libxl_get_required_shadow_memory():
--
1.7.4.4