aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_create.c
diff options
context:
space:
mode:
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-10-05 15:12:04 +0100
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>2012-10-05 15:12:04 +0100
commit5bce815d5d998383dd46a39dad9d46492aa6524f (patch)
treeaeeabcfd8497b8896c7ef25b0c2be21b06856045 /tools/libxl/libxl_create.c
parent7bb7e581a4b8f3e22bf7de6826bfa705f8f7cfaf (diff)
downloadxen-5bce815d5d998383dd46a39dad9d46492aa6524f.tar.gz
xen-5bce815d5d998383dd46a39dad9d46492aa6524f.tar.bz2
xen-5bce815d5d998383dd46a39dad9d46492aa6524f.zip
xl/libxl: add iomem support
This patch adds a new option for xen config files for directly mapping hardware io memory into a vm. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_create.c')
-rw-r--r--tools/libxl/libxl_create.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ef17f052c0..eedf38fbcc 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -942,7 +942,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
ret = xc_domain_ioport_permission(CTX->xch, domid,
io->first, io->number, 1);
- if ( ret<0 ){
+ if (ret < 0) {
LOGE(ERROR,
"failed give dom%d access to ioports %"PRIx32"-%"PRIx32,
domid, io->first, io->first + io->number - 1);
@@ -956,13 +956,31 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
- if ( ret<0 ){
+ if (ret < 0) {
LOGE(ERROR,
"failed give dom%d access to irq %"PRId32, domid, irq);
ret = ERROR_FAIL;
}
}
+ for (i = 0; i < d_config->b_info.num_iomem; i++) {
+ libxl_iomem_range *io = &d_config->b_info.iomem[i];
+
+ LOG(DEBUG, "dom%d iomem %"PRIx64"-%"PRIx64,
+ domid, io->start, io->start + io->number - 1);
+
+ ret = xc_domain_iomem_permission(CTX->xch, domid,
+ io->start, io->number, 1);
+ if (ret < 0) {
+ LOGE(ERROR,
+ "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64,
+ domid, io->start, io->start + io->number - 1);
+ ret = ERROR_FAIL;
+ }
+ }
+
+
+
for (i = 0; i < d_config->num_nics; i++) {
/* We have to init the nic here, because we still haven't
* called libxl_device_nic_add at this point, but qemu needs