[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 16 of 16] libxl: pass iommu parameter to qemu-dm
# HG changeset patch # User Wei Wang <wei.wang2@xxxxxxx> # Date 1324569422 -3600 # Node ID 1aad019305172c4abca8c2c9d7e632fe3291fead # Parent 8ea73cd1a367b318f72026a02629c774d24f999f libxl: pass iommu parameter to qemu-dm. When iomm = 0, virtual iommu device will be disabled. Signed-off-by: Wei Wang <wei.wang2@xxxxxxx> diff -r 8ea73cd1a367 -r 1aad01930517 tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Thu Dec 22 16:56:59 2011 +0100 +++ b/tools/libxl/libxl_create.c Thu Dec 22 16:57:02 2011 +0100 @@ -559,7 +559,7 @@ static int do_domain_create(libxl__gc *g libxl_device_vkb_dispose(&vkb); dm_info->domid = domid; - ret = libxl__create_device_model(gc, dm_info, + ret = libxl__create_device_model(gc, dm_info, &d_config->b_info, d_config->disks, d_config->num_disks, d_config->vifs, d_config->num_vifs, &dm_starting); diff -r 8ea73cd1a367 -r 1aad01930517 tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Thu Dec 22 16:56:59 2011 +0100 +++ b/tools/libxl/libxl_dm.c Thu Dec 22 16:57:02 2011 +0100 @@ -84,6 +84,7 @@ static const char *libxl__domain_bios(li static char ** libxl__build_device_model_args_old(libxl__gc *gc, const char *dm, libxl_device_model_info *info, + libxl_domain_build_info *b_info, libxl_device_disk *disks, int num_disks, libxl_device_nic *vifs, int num_vifs) { @@ -199,6 +200,9 @@ static char ** libxl__build_device_model if (info->gfx_passthru) { flexarray_append(dm_args, "-gfx_passthru"); } + if (b_info && b_info->u.hvm.iommu) { + flexarray_append(dm_args, "-iommu"); + } } if (info->saved_state) { flexarray_vappend(dm_args, "-loadvm", info->saved_state, NULL); @@ -237,6 +241,7 @@ static const char *qemu_disk_format_stri static char ** libxl__build_device_model_args_new(libxl__gc *gc, const char *dm, libxl_device_model_info *info, + libxl_domain_build_info *b_info, libxl_device_disk *disks, int num_disks, libxl_device_nic *vifs, int num_vifs) { @@ -409,6 +414,9 @@ static char ** libxl__build_device_model if (info->gfx_passthru) { flexarray_append(dm_args, "-gfx_passthru"); } + if (b_info && b_info->u.hvm.iommu) { + flexarray_append(dm_args, "-iommu"); + } } if (info->saved_state) { /* This file descriptor is meant to be used by QEMU */ @@ -500,6 +508,7 @@ static char ** libxl__build_device_model static char ** libxl__build_device_model_args(libxl__gc *gc, const char *dm, libxl_device_model_info *info, + libxl_domain_build_info *b_info, libxl_device_disk *disks, int num_disks, libxl_device_nic *vifs, int num_vifs) { @@ -507,11 +516,11 @@ static char ** libxl__build_device_model switch (info->device_model_version) { case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: - return libxl__build_device_model_args_old(gc, dm, info, + return libxl__build_device_model_args_old(gc, dm, info, b_info, disks, num_disks, vifs, num_vifs); case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - return libxl__build_device_model_args_new(gc, dm, info, + return libxl__build_device_model_args_new(gc, dm, info, b_info, disks, num_disks, vifs, num_vifs); default: @@ -619,7 +628,7 @@ static int libxl__create_stubdom(libxl__ goto out; } - args = libxl__build_device_model_args(gc, "stubdom-dm", info, + args = libxl__build_device_model_args(gc, "stubdom-dm", info, NULL, disks, num_disks, vifs, num_vifs); if (!args) { @@ -782,6 +791,7 @@ out: int libxl__create_device_model(libxl__gc *gc, libxl_device_model_info *info, + libxl_domain_build_info *b_info, libxl_device_disk *disks, int num_disks, libxl_device_nic *vifs, int num_vifs, libxl__spawner_starting **starting_r) @@ -820,7 +830,7 @@ int libxl__create_device_model(libxl__gc rc = ERROR_FAIL; goto out; } - args = libxl__build_device_model_args(gc, dm, info, disks, num_disks, + args = libxl__build_device_model_args(gc, dm, info, b_info, disks, num_disks, vifs, num_vifs); if (!args) { rc = ERROR_FAIL; @@ -1046,7 +1056,7 @@ int libxl__create_xenpv_qemu(libxl__gc * libxl__spawner_starting **starting_r) { libxl__build_xenpv_qemu_args(gc, domid, vfb, info); - libxl__create_device_model(gc, info, NULL, 0, NULL, 0, starting_r); + libxl__create_device_model(gc, info, NULL, NULL, 0, NULL, 0, starting_r); return 0; } diff -r 8ea73cd1a367 -r 1aad01930517 tools/libxl/libxl_internal.h --- a/tools/libxl/libxl_internal.h Thu Dec 22 16:56:59 2011 +0100 +++ b/tools/libxl/libxl_internal.h Thu Dec 22 16:57:02 2011 +0100 @@ -466,6 +466,7 @@ _hidden const char *libxl__domain_device libxl_device_model_info *info); _hidden int libxl__create_device_model(libxl__gc *gc, libxl_device_model_info *info, + libxl_domain_build_info *b_info, libxl_device_disk *disk, int num_disks, libxl_device_nic *vifs, int num_vifs, libxl__spawner_starting **starting_r); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |