[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH v2 02/17] libxl: Add "stubdomain_version" to domain_build_info.
From: Eric Shelton <eshelton@xxxxxxxxx> This enum gives the ability to select between a MiniOS-based QEMU traditional stub domain and a Linux-based QEMU upstream stub domain. To use the Linux-based stubdomain, the following two lines should be included in the appropriate xl.cfg file: device_model_version="qemu-xen" device_model_stubdomain_override=1 To use the MiniOS-based stubdomain, the following is used instead: device_model_version="qemu-xen-traditional" device_model_stubdomain_override=1 Signed-off-by: Eric Shelton <eshelton@xxxxxxxxx> Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx> --- tools/libxl/libxl_create.c | 34 +++++++++++++++++++++++++++++----- tools/libxl/libxl_types.idl | 7 +++++++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 1ccb3e3..1d92b5f 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -159,12 +159,36 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, } if (b_info->type == LIBXL_DOMAIN_TYPE_HVM && - b_info->device_model_version != - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL && libxl_defbool_val(b_info->device_model_stubdomain)) { - LOG(ERROR, - "device model stubdomains require \"qemu-xen-traditional\""); - return ERROR_INVAL; + if (!b_info->stubdomain_version) { + switch (b_info->device_model_version) { + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + b_info->stubdomain_version = LIBXL_STUBDOMAIN_VERSION_MINIOS; + break; + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: + b_info->stubdomain_version = LIBXL_STUBDOMAIN_VERSION_LINUX; + break; + default: abort(); + } + } + + switch (b_info->device_model_version) { + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: + if (b_info->stubdomain_version != LIBXL_STUBDOMAIN_VERSION_MINIOS) { + LOG(ERROR, + "\"qemu-xen-traditional\" require \"minios\" as stubdomain"); + return ERROR_INVAL; + } + break; + case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: + if (b_info->stubdomain_version != LIBXL_STUBDOMAIN_VERSION_LINUX) { + LOG(ERROR, + "\"qemu-xen\" require \"linux\" as stubdomain"); + return ERROR_INVAL; + } + break; + default: abort(); + } } if (!b_info->max_vcpus) diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 4a38580..847e2fe 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -101,6 +101,12 @@ libxl_device_model_version = Enumeration("device_model_version", [ (2, "QEMU_XEN"), # Upstream based qemu-xen device model ]) +# Give the kernel running in the stub-domain +libxl_stubdomain_version = Enumeration("stubdomain_version", [ + (1, "MINIOS"), + (2, "LINUX"), + ]) + libxl_console_type = Enumeration("console_type", [ (0, "UNKNOWN"), (1, "SERIAL"), @@ -491,6 +497,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("device_model_version", libxl_device_model_version), ("device_model_stubdomain", libxl_defbool), + ("stubdomain_version", libxl_stubdomain_version), # if you set device_model you must set device_model_version too ("device_model", string), ("device_model_ssidref", uint32), -- git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |