[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC 4/7] libxl: Add "stubdomain_version" to domain_build_info.
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> --- 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 98687bd..15258fa 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -181,12 +181,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)) { - LIBXL__LOG(CTX, XTL_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) { + LIBXL__LOG(CTX, XTL_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) { + LIBXL__LOG(CTX, XTL_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 02be466..8d0ac3b 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -83,6 +83,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"), @@ -379,6 +385,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), -- 1.8.5.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |