diff options
author | Ian Jackson <ian.jackson@eu.citrix.com> | 2013-03-01 17:17:04 +0000 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2013-03-13 15:59:40 +0000 |
commit | c966179ba4c1ee0461a2d84a1d667629cca21ec8 (patch) | |
tree | 433d4ef59e3252f2338832f54c706ee9ae00d8e2 /tools | |
parent | d46d13606e5533d63a83c6541942d7d66f217896 (diff) | |
download | xen-c966179ba4c1ee0461a2d84a1d667629cca21ec8.tar.gz xen-c966179ba4c1ee0461a2d84a1d667629cca21ec8.tar.bz2 xen-c966179ba4c1ee0461a2d84a1d667629cca21ec8.zip |
libxl: move check for existence of qemuu device model
The stat in libxl__domain_build_info_setdefault's default device model
logic works to fall back to qemu-xen-traditional whenever the
executable for qemu-xen is not found.
We are going to use qemu-xen-traditional in more cases, so break this
check out into its own if statement.
Also add a pair of braces to make the if() statement symmetrical.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/libxl_create.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index efeebf27fb..04bf4a59b7 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -105,22 +105,25 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_defbool_setdefault(&b_info->device_model_stubdomain, false); if (!b_info->device_model_version) { - if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) + if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) { b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; - else { + } else { + b_info->device_model_version = + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; + } + if (b_info->device_model_version + == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { const char *dm; int rc; - b_info->device_model_version = - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; dm = libxl__domain_device_model(gc, b_info); rc = access(dm, X_OK); if (rc < 0) { /* qemu-xen unavailable, use qemu-xen-traditional */ if (errno == ENOENT) { LIBXL__LOG_ERRNO(CTX, XTL_VERBOSE, "qemu-xen is unavailable" - ", use qemu-xen-traditional instead"); + ", use qemu-xen-traditional instead"); b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; } else { |