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

[Xen-devel] [PATCH 15 of 16] libxl: Introduce a new guest config file parameter



# HG changeset patch
# User Wei Wang <wei.wang2@xxxxxxx>
# Date 1323876143 -3600
# Node ID 93658ca85035d6a4e56e2e6602c02859974d30a4
# Parent  f9575683f10a08a86a9c73226581610fa3f7be4b
libxl: Introduce a new guest config file parameter
Use iommu = {1,0} to enable or disable guest iommu emulation.
Default value is 0.

Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>

diff -r f9575683f10a -r 93658ca85035 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Wed Dec 14 16:22:22 2011 +0100
+++ b/tools/libxl/libxl_create.c        Wed Dec 14 16:22:23 2011 +0100
@@ -99,6 +99,7 @@ int libxl_init_build_info(libxl_ctx *ctx
         b_info->u.hvm.vpt_align = 1;
         b_info->u.hvm.timer_mode = 1;
         b_info->u.hvm.nested_hvm = 0;
+        b_info->u.hvm.iommu = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 8 * 1024;
diff -r f9575683f10a -r 93658ca85035 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Wed Dec 14 16:22:22 2011 +0100
+++ b/tools/libxl/libxl_dom.c   Wed Dec 14 16:22:23 2011 +0100
@@ -266,6 +266,10 @@ static int hvm_build_set_params(xc_inter
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
     va_hvm->apic_mode = info->u.hvm.apic;
     va_hvm->nr_vcpus = info->max_vcpus;
+
+    if ( info->u.hvm.iommu )
+         va_hvm->iommu_enabled = 1;
+
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
     for (i = 0, sum = 0; i < va_hvm->length; i++)
         sum += ((uint8_t *) va_hvm)[i];
diff -r f9575683f10a -r 93658ca85035 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Wed Dec 14 16:22:22 2011 +0100
+++ b/tools/libxl/libxl_types.idl       Wed Dec 14 16:22:23 2011 +0100
@@ -184,6 +184,7 @@ libxl_domain_build_info = Struct("domain
                                        ("vpt_align", bool),
                                        ("timer_mode", integer),
                                        ("nested_hvm", bool),
+                                       ("iommu", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
diff -r f9575683f10a -r 93658ca85035 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Dec 14 16:22:22 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Wed Dec 14 16:22:23 2011 +0100
@@ -360,6 +360,7 @@ static void printf_info(int domid,
         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(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
+        printf("\t\t\t(iommu %d)\n", b_info->u.hvm.iommu);
 
         printf("\t\t\t(device_model %s)\n", dm_info->device_model ? : 
"default");
         printf("\t\t\t(videoram %d)\n", dm_info->videoram);
@@ -764,6 +765,8 @@ static void parse_config_data(const char
             b_info->u.hvm.timer_mode = l;
         if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
             b_info->u.hvm.nested_hvm = l;
+        if (!xlu_cfg_get_long (config, "iommu", &l, 0))
+            b_info->u.hvm.iommu = l;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {


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


 


Rackspace

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