From 0fd3fac53765dedc6343d47e588a83300d6d9333 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 10 May 2011 13:24:15 +0200 Subject: [PATCH] libxl: support enabling the HPET libxl accepts hpet configuration in its domain info struct. Parse the domain definition's element in order to set the value. Signed-off-by: Paolo Bonzini --- src/libxl/libxl_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 5054422cf6..ae527f3887 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -377,6 +377,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); @@ -402,6 +403,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():