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

[Xen-changelog] [xen-unstable] tools/libxl: allow setting of timer_mode, hpet and vpt_align parameters



# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1278431749 -3600
# Node ID da46b25cf17d82e4504f8bf854ea42eead4a5ead
# Parent  473c170bca8d0fd0302bb9ba8b9a410cf86ff797
tools/libxl: allow setting of timer_mode, hpet and vpt_align parameters

Implement parsing for timer_mode, hpet and vpt_align parameters.

These are all HVM only parameters and hpet/vpt_align are boolean so
change types and place in hvm union accordingly. Also HPET is x86 only
on principle so make this compile-time conditional on arch as-is
viridian.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
---
 tools/libxl/libxl.h      |    6 +++---
 tools/libxl/libxl_dom.c  |    7 -------
 tools/libxl/xenguest.c   |    3 +++
 tools/libxl/xl_cmdimpl.c |   18 ++++++++++++------
 4 files changed, 18 insertions(+), 16 deletions(-)

diff -r 473c170bca8d -r da46b25cf17d tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Jul 06 13:10:14 2010 +0100
+++ b/tools/libxl/libxl.h       Tue Jul 06 16:55:49 2010 +0100
@@ -90,9 +90,6 @@ typedef struct {
 } libxl_domain_create_info;
 
 typedef struct {
-    int timer_mode;
-    int hpet;
-    int vpt_align;
     int max_vcpus;
     int cur_vcpus;
     int tsc_mode;
@@ -110,6 +107,9 @@ typedef struct {
             bool nx;
             bool viridian;
             char *timeoffset;
+            bool hpet;
+            bool vpt_align;
+            int timer_mode;
         } hvm;
         struct {
             uint32_t   slack_memkb;
diff -r 473c170bca8d -r da46b25cf17d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Tue Jul 06 13:10:14 2010 +0100
+++ b/tools/libxl/libxl_dom.c   Tue Jul 06 16:55:49 2010 +0100
@@ -62,13 +62,6 @@ int build_pre(struct libxl_ctx *ctx, uin
 int build_pre(struct libxl_ctx *ctx, uint32_t domid,
               libxl_domain_build_info *info, libxl_domain_build_state *state)
 {
-    if (info->timer_mode != -1)
-        xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_TIMER_MODE,
-                (unsigned long) info->timer_mode);
-    if (info->hpet != -1)
-        xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_HPET_ENABLED, (unsigned 
long) info->hpet);
-    if (info->vpt_align != -1)
-        xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) 
info->vpt_align);
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + 
LIBXL_MAXMEM_CONSTANT);
     xc_domain_set_memmap_limit(ctx->xch, domid, 
diff -r 473c170bca8d -r da46b25cf17d tools/libxl/xenguest.c
--- a/tools/libxl/xenguest.c    Tue Jul 06 13:10:14 2010 +0100
+++ b/tools/libxl/xenguest.c    Tue Jul 06 16:55:49 2010 +0100
@@ -49,7 +49,10 @@ int hvm_build_set_params(xc_interface *h
     xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info->u.hvm.pae);
 #if defined(__i386__) || defined(__x86_64__)
     xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info->u.hvm.viridian);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned long) 
info->u.hvm.hpet);
 #endif
+    xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, (unsigned long) 
info->u.hvm.timer_mode);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) 
info->u.hvm.vpt_align);
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
     return 0;
 }
diff -r 473c170bca8d -r da46b25cf17d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jul 06 13:10:14 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jul 06 16:55:49 2010 +0100
@@ -189,9 +189,6 @@ static void init_build_info(libxl_domain
 static void init_build_info(libxl_domain_build_info *b_info, 
libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->timer_mode = -1;
-    b_info->hpet = 1;
-    b_info->vpt_align = -1;
     b_info->max_vcpus = 1;
     b_info->max_memkb = 32 * 1024;
     b_info->target_memkb = b_info->max_memkb;
@@ -205,6 +202,9 @@ static void init_build_info(libxl_domain
         b_info->u.hvm.acpi = 1;
         b_info->u.hvm.nx = 1;
         b_info->u.hvm.viridian = 0;
+        b_info->u.hvm.hpet = 1;
+        b_info->u.hvm.vpt_align = 1;
+        b_info->u.hvm.timer_mode = 0;
     } else {
         b_info->u.pv.slack_memkb = 8 * 1024;
     }
@@ -356,9 +356,6 @@ static void printf_info(int domid,
 
 
     printf("\t(domain_build_info)\n");
-    printf("\t(timer_mode %d)\n", b_info->timer_mode);
-    printf("\t(hpet %d)\n", b_info->hpet);
-    printf("\t(vpt_align %d)\n", b_info->vpt_align);
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
     printf("\t(tsc_mode %d)\n", b_info->tsc_mode);
     printf("\t(max_memkb %d)\n", b_info->max_memkb);
@@ -375,6 +372,9 @@ static void printf_info(int domid,
         printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);
         printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx);
         printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian);
+        printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet);
+        printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
+        printf("\t\t\t(timer_mode %d)\n", b_info->u.hvm.timer_mode);
 
         printf("\t\t\t(device_model %s)\n", dm_info->device_model);
         printf("\t\t\t(videoram %d)\n", dm_info->videoram);
@@ -571,6 +571,12 @@ static void parse_config_data(const char
             b_info->u.hvm.nx = l;
         if (!xlu_cfg_get_long (config, "viridian", &l))
             b_info->u.hvm.viridian = l;
+        if (!xlu_cfg_get_long (config, "hpet", &l))
+            b_info->u.hvm.hpet = l;
+        if (!xlu_cfg_get_long (config, "vpt_align", &l))
+            b_info->u.hvm.vpt_align = l;
+        if (!xlu_cfg_get_long (config, "timer_mode", &l))
+            b_info->u.hvm.timer_mode = l;
     } else {
         char *cmdline = NULL;
         const char *root = NULL, *extra = "";

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.