Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
libvirt.1263
libxl-dev-model.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libxl-dev-model.patch of Package libvirt.1263
From b300580ceae5c5b998fdd808a89d525deb166eb5 Mon Sep 17 00:00:00 2001 From: Jim Fehlig <jfehlig@suse.com> Date: Fri, 19 Sep 2014 10:32:43 -0600 Subject: [PATCH 3/5] libxl: Add function to determine device model type This patch introduces a function to detect whether the specified emulator is QEMU_XEN or QEMU_XEN_TRADITIONAL. Detection is based on the string "Options specific to the Xen version:" in '$qemu -help' output. AFAIK, the only qemu containing that string in help output is the old Xen fork (aka qemu-dm). Note: QEMU_XEN means a qemu that contains support for Xen. QEMU_XEN_TRADITIONAL means Xen's old forked qemu 0.10.2 Signed-off-by: Jim Fehlig <jfehlig@suse.com> --- src/libxl/libxl_conf.c | 32 ++++++++++++++++++++++++++++++++ src/libxl/libxl_conf.h | 3 +++ 2 files changed, 35 insertions(+) Index: libvirt-1.2.5/src/libxl/libxl_conf.c =================================================================== --- libvirt-1.2.5.orig/src/libxl/libxl_conf.c +++ libvirt-1.2.5/src/libxl/libxl_conf.c @@ -40,6 +40,7 @@ #include "viralloc.h" #include "viruuid.h" #include "capabilities.h" +#include "vircommand.h" #include "libxl_domain.h" #include "libxl_conf.h" #include "libxl_utils.h" @@ -826,6 +827,37 @@ libxlDiskSetDiscard(libxl_device_disk *x #endif } +#define LIBXL_QEMU_DM_STR "Options specific to the Xen version:" + +int +libxlDomainGetEmulatorType(const virDomainDef *def) +{ + int ret = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; + virCommandPtr cmd = NULL; + char *output = NULL; + + if (STREQ(def->os.type, "hvm")) { + if (def->emulator) { + cmd = virCommandNew(def->emulator); + + virCommandAddArgList(cmd, "-help", NULL); + virCommandSetOutputBuffer(cmd, &output); + + if (virCommandRun(cmd, NULL) < 0) + goto cleanup; + + if (strstr(output, LIBXL_QEMU_DM_STR)) + ret = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; + } + } + + cleanup: + VIR_FREE(output); + virCommandFree(cmd); + return ret; +} + + int libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) { Index: libvirt-1.2.5/src/libxl/libxl_conf.h =================================================================== --- libvirt-1.2.5.orig/src/libxl/libxl_conf.h +++ libvirt-1.2.5/src/libxl/libxl_conf.h @@ -152,6 +152,9 @@ virCapsPtr libxlMakeCapabilities(libxl_ctx *ctx); int +libxlDomainGetEmulatorType(const virDomainDef *def); + +int libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev); int libxlMakeNic(virDomainDefPtr def,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor