[libvirt] [PATCH V3] Use loop-control to allocate loop device.
by Ian Main
This patch changes virFileLoopDeviceOpen() to use the new loop-control
device to allocate a new loop device. If this behavior is unsupported
we fall back to the previous method of searching /dev for a free device.
With this patch you can start as many image based LXC domains as you
like (well almost).
Fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=995543
V2:
- Modified to use a dedicated error return for loop-control allocation
function.
- Only do fallback if /dev/loop-control does not exist, otherwise return
error.
V3:
- Remove warning about falling back to search technique.
Signed-off-by: Ian Main <imain(a)redhat.com>
---
configure.ac | 12 ++++++++++
src/util/virfile.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ac8cfa1..10cd872 100644
--- a/configure.ac
+++ b/configure.ac
@@ -913,6 +913,18 @@ if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then
AC_MSG_ERROR([Required kernel features for LXC were not found])
fi
])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sched.h>
+ #include <linux/loop.h>
+ #include <sys/epoll.h>
+ ]], [[
+ unshare(!(LOOP_CTL_GET_FREE));
+ ]])], [
+ AC_DEFINE([HAVE_DECL_LOOP_CTL_GET_FREE], [1],
+ [Define to 1 if you have the declaration of `LOOP_CTL_GET_FREE',
+ and to 0 if you don't.])
+ ])
fi
if test "$with_lxc" = "yes" ; then
AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled])
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 2b07ac9..9d42380 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -528,7 +528,56 @@ int virFileUpdatePerm(const char *path,
#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR
-static int virFileLoopDeviceOpen(char **dev_name)
+
+#if HAVE_DECL_LOOP_CTL_GET_FREE
+
+/* virFileLoopDeviceOpenLoopCtl() returns -1 when a real failure has occured
+ * while in the process of allocating or opening the loop device. On success
+ * we return 0 and modify the fd to the appropriate file descriptor.
+ * If /dev/loop-control does not exist, we return 0 and do not set fd. */
+
+static int virFileLoopDeviceOpenLoopCtl(char **dev_name, int *fd)
+{
+ int devnr;
+ int ctl_fd;
+ char *looppath = NULL;
+
+ VIR_DEBUG("Opening loop-control device");
+ if ((ctl_fd = open("/dev/loop-control", O_RDWR)) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to open /dev/loop-control"));
+ if (errno == ENOENT) {
+ return 0;
+ }
+ return -1;
+ }
+
+ if ((devnr = ioctl(ctl_fd, LOOP_CTL_GET_FREE)) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to get free loop device via ioctl"));
+ close(ctl_fd);
+ return -1;
+ }
+ close(ctl_fd);
+
+ VIR_DEBUG("Found free loop device number %i", devnr);
+
+ if (virAsprintf(&looppath, "/dev/loop%i", devnr) < 0)
+ return -1;
+
+ if ((*fd = open(looppath, O_RDWR)) < 0) {
+ virReportSystemError(errno,
+ _("Unable to open %s"), looppath);
+ VIR_FREE(looppath);
+ return -1;
+ }
+
+ *dev_name = looppath;
+ return 0;
+}
+#endif /* HAVE_DECL_LOOP_CTL_GET_FREE */
+
+static int virFileLoopDeviceOpenSearch(char **dev_name)
{
int fd = -1;
DIR *dh = NULL;
@@ -601,6 +650,25 @@ cleanup:
return fd;
}
+static int virFileLoopDeviceOpen(char **dev_name)
+{
+ int loop_fd = -1;
+
+#ifdef HAVE_DECL_LOOP_CTL_GET_FREE
+ if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0)
+ return -1;
+
+ VIR_DEBUG("Return from loop-control got fd %d\n", loop_fd);
+
+ if (loop_fd >= 0)
+ return loop_fd;
+#endif /* HAVE_DECL_LOOP_CTL_GET_FREE */
+
+ /* Without the loop control device we just use the old technique. */
+ loop_fd = virFileLoopDeviceOpenSearch(dev_name);
+
+ return loop_fd;
+}
int virFileLoopDeviceAssociate(const char *file,
char **dev)
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH 1/1] cpu: Cleanup ppcCompute to avoid memory leak
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
This patch is to Cleanup ppcCompute to avoid memory leak to make
the code better.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/cpu/cpu_powerpc.c | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index a47ee38..4e90672 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -345,16 +345,16 @@ ppcMakeCPUData(virArch arch, struct cpuPPCData *data)
static virCPUCompareResult
ppcCompute(virCPUDefPtr host,
- const virCPUDefPtr cpu,
- virCPUDataPtr *guestData,
- char **message)
+ const virCPUDefPtr cpu,
+ virCPUDataPtr *guestData,
+ char **message)
{
struct ppc_map *map = NULL;
struct ppc_model *host_model = NULL;
struct ppc_model *guest_model = NULL;
- int ret = 0;
+ virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
virArch arch;
size_t i;
@@ -375,8 +375,10 @@ ppcCompute(virCPUDefPtr host,
virAsprintf(message,
_("CPU arch %s does not match host arch"),
virArchToString(cpu->arch)) < 0)
- goto error;
- return VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
}
arch = cpu->arch;
} else {
@@ -392,14 +394,16 @@ ppcCompute(virCPUDefPtr host,
_("host CPU vendor does not match required "
"CPU vendor %s"),
cpu->vendor) < 0)
- goto error;
- return VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
}
if (!(map = ppcLoadMap()) ||
!(host_model = ppcModelFromCPU(host, map)) ||
!(guest_model = ppcModelFromCPU(cpu, map)))
- goto error;
+ goto cleanup;
if (guestData != NULL) {
if (cpu->type == VIR_CPU_TYPE_GUEST &&
@@ -412,25 +416,23 @@ ppcCompute(virCPUDefPtr host,
_("host CPU model does not match required "
"CPU model %s"),
guest_model->name) < 0)
- goto error;
- return VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
+
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
}
if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data)))
- goto error;
+ goto cleanup;
}
ret = VIR_CPU_COMPARE_IDENTICAL;
-out:
+cleanup:
ppcMapFree(map);
ppcModelFree(host_model);
ppcModelFree(guest_model);
return ret;
-
-error:
- ret = VIR_CPU_COMPARE_ERROR;
- goto out;
}
static virCPUCompareResult
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH] build: shut up automake warnings
by Eric Blake
I'm tired of seeing screenfuls of messages like these when using
automake 1.13 (Fedora 19):
configure.ac:2121: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
configure.ac:2121: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:2121: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
daemon/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
seeing as how we MUST use those constructs for the benefit of
automake 1.9 (RHEL 5). Conversely, RHEL 5 automake complained:
aclocal:configure.ac:36: warning: macro `AM_SILENT_RULES' not found in library
Obviously, I tested this patch on both Fedora 19 and RHEL 5.
* configure.ac (AM_INIT_AUTOMAKE): Avoid obsoletion warnings.
(AM_SILENT_RULES): Avoid unknown macro warning.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
configure.ac | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index f853e03..925afcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,8 +21,9 @@ AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-dnl Make automake keep quiet about wildcards & other GNUmake-isms
-AM_INIT_AUTOMAKE([-Wno-portability tar-ustar])
+dnl Make automake keep quiet about wildcards & other GNUmake-isms; also keep
+dnl quiet about the fact that we intentionally cater to automake 1.9
+AM_INIT_AUTOMAKE([-Wno-portability -Wno-obsolete tar-ustar])
AM_MAINTAINER_MODE([enable])
# Maintainer note - comment this line out if you plan to rerun
@@ -30,9 +31,11 @@ AM_MAINTAINER_MODE([enable])
# Leave it uncommented for normal releases, for faster ./configure.
gl_ASSERT_NO_GNULIB_POSIXCHECK
-# Use the silent-rules feature when possible.
-m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
-AM_SILENT_RULES([yes])
+# Default to using the silent-rules feature when possible. Formatting
+# chosen to bypass 'grep' checks that cause older automake to warn.
+# Users (include rpm) can still change the default at configure time.
+m4_ifndef([AM_SILENT_RULES],
+ [m4_define([AM_SILENT_RULES],[])])AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCHv2] qemu: don't leak vm on failure
by Eric Blake
Failure to attach to a domain during 'virsh qemu-attach' left
the list of domains in an odd state:
$ virsh qemu-attach 4176
error: An error occurred, but the cause is unknown
$ virsh list --all
Id Name State
----------------------------------------------------
2 foo shut off
$ virsh qemu-attach 4176
error: Requested operation is not valid: domain is already active as 'foo'
$ virsh undefine foo
error: Failed to undefine domain foo
error: Requested operation is not valid: cannot undefine transient domain
$ virsh shutdown foo
error: Failed to shutdown domain foo
error: invalid argument: monitor must not be NULL
It all stems from leaving the list of domains unmodified on
the initial failure; we should follow the lead of createXML
which removes vm on failure (the actual initial failure still
needs to be fixed in a later patch, but at least this patch
gets us to the point where we aren't getting stuck with an
unremovable "shut off" transient domain).
While investigating, I also found a leak in qemuDomainCreateXML;
the two functions should behave similarly. Note that there are
still two unusual paths: if dom is not allocated, the user will
see an OOM error even though the vm remains registered (but oom
errors already indicate tricky cleanup); and if the vm starts
and then quits again all before the job ends, it is possible
to return a non-NULL dom even though the dom will no longer be
useful for anything (but this at least lets the user know their
short-lived vm ran).
* src/qemu/qemu_driver.c (qemuDomainCreateXML): Don't leak vm on
failure to obtain job.
(qemuDomainQemuAttach): Match cleanup of qemuDomainCreateXML.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
v1 was discussed here: https://www.redhat.com/archives/libvir-list/2013-September/msg00362.html
changes since then: plug another leak of vm, and clean up some style.
Expand the commit message to explain unusual paths.
src/qemu/qemu_driver.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e37fe33..6dafa2b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1602,8 +1602,11 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
def = NULL;
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
- goto cleanup; /* XXXX free the 'vm' we created ? */
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) {
+ qemuDomainRemoveInactive(driver, vm);
+ vm = NULL;
+ goto cleanup;
+ }
if (qemuProcessStart(conn, driver, vm, NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
@@ -1631,10 +1634,10 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
virDomainAuditStart(vm, "booted", true);
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
- if (dom) dom->id = vm->def->id;
+ if (dom)
+ dom->id = vm->def->id;
- if (vm &&
- qemuDomainObjEndJob(driver, vm) == 0)
+ if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
cleanup:
@@ -13630,34 +13633,38 @@ static virDomainPtr qemuDomainQemuAttach(virConnectPtr conn,
def = NULL;
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) {
+ qemuDomainRemoveInactive(driver, vm);
+ vm = NULL;
goto cleanup;
+ }
if (qemuProcessAttach(conn, driver, vm, pid,
pidfile, monConfig, monJSON) < 0) {
+ if (qemuDomainObjEndJob(driver, vm) > 0)
+ qemuDomainRemoveInactive(driver, vm);
+ vm = NULL;
monConfig = NULL;
- goto endjob;
+ goto cleanup;
}
monConfig = NULL;
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
- if (dom) dom->id = vm->def->id;
+ if (dom)
+ dom->id = vm->def->id;
-endjob:
if (qemuDomainObjEndJob(driver, vm) == 0) {
vm = NULL;
- goto cleanup;
- }
cleanup:
virDomainDefFree(def);
- virObjectUnref(qemuCaps);
virDomainChrSourceDefFree(monConfig);
if (vm)
virObjectUnlock(vm);
VIR_FREE(pidfile);
virObjectUnref(caps);
+ virObjectUnref(qemuCaps);
return dom;
}
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCHv2 RESEND 0/5] Handling of undefine and redefine snapshots with VirtualBox 4.2
by Manuel VIVES
Hi,
This is a serie of patches in order to support undefining and redefining
snapshots with VirtualBox 4.2.
The serie of patches is rather big, and adds among other things some utility functions unrelated to VirtualBox in patches 1 & 2.
The code review could be done in several parts: e.g. patches 1 & 2 separately to validate the utility functions.
This 2nd version brings a different function for string replacement, because of the license problem with
the first one.
The VirtualBox API provides only high level operations to manipulate snapshots,
so it not possible to support flags like VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE and
VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY with only API calls.
Following an IRC talk with Eric Blake, the decision was taken to emulate these
behaviours by manipulating directly the .vbox XML files.
The first two patches are some util methods for handling uuid and strings that
will be used after.
The third patch brings more details in the snapshot XML returned by libvirt.
We will need those modifications in order to redefine the snapshots.
The fourth patch brings the support of the VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE
and VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT flags in virDomainSnapshotCreateXML.
The fifth and last patch brings the support of the VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY
flag in virDomainSnapshotDelete.
The patches are only for Virtualbox 4.2
Regards,
Manuel VIVES
Manuel VIVES (5):
viruuid.h/c: Util method for finding uuid patterns in some strings
virstring.h/c: Util method for making some find and replace in
strings
vbox_tmpl.c: Better XML description for snapshots
vbox_tmpl.c: Patch for redefining snapshots
vbox_tmpl.c: Add methods for undefining snapshots
src/conf/domain_conf.c | 20 +-
src/libvirt_private.syms | 2 +
src/util/virstring.c | 48 ++
src/util/virstring.h | 2 +
src/util/viruuid.c | 79 ++
src/util/viruuid.h | 1 +
src/vbox/vbox_tmpl.c | 1846 +++++++++++++++++++++++++++++++++++++++++++---
7 files changed, 1878 insertions(+), 120 deletions(-)
--
1.7.10.4
11 years, 2 months
[libvirt] [PATCH v3 0/8] Support qemu-system-arm vexpress-a9
by Cole Robinson
This series adds the bits needed to kick of a qemu-system-arm -machine
vexpress-a9 guest. vexpress-a15 likely works as well but is untested.
Patches 1-2 are related bugfixes/improvements.
Patch 6 adds disk bus=sd, which is often the only way to specify storage
for ARM boards.
Patch 8 adds virtio-mmio address support, which enables virtio
for ARM vexpress machine types.
The rest are mostly about fixing CLI generations. Unfortunately
qemu ARM boards don't quite work like x86 where we can mix and match
devices, so -device is out of the picture (for non-virtio), meaning
we have to fall back to CLI infrastrucure like -net nic and -serial.
v3:
Rebased series
Add qemu.conf nographics_allow_host_audio for patch #1
Drop domain_conf.c default memballoon handling in patch #2, not #3
Cole Robinson (8):
qemu: Set QEMU_AUDIO_DRV=none with -nographic
domain_conf: Add default memballoon in PostParse callbacks
qemu: Don't add default memballoon device on ARM
qemu: Fix specifying char devs for ARM
qemu: Don't try to allocate PCI addresses for ARM
domain_conf: Add disk bus=sd, wire it up for qemu
qemu: Fix networking for ARM guests
qemu: Support virtio-mmio transport for virtio on ARM
docs/formatdomain.html.in | 3 +-
docs/schemas/domaincommon.rng | 20 ++++
src/conf/domain_conf.c | 29 +++--
src/conf/domain_conf.h | 2 +
src/qemu/libvirtd_qemu.aug | 3 +
src/qemu/qemu.conf | 9 ++
src/qemu/qemu_capabilities.c | 23 ++++
src/qemu/qemu_capabilities.h | 6 +
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/qemu_command.c | 127 +++++++++++++++++----
src/qemu/qemu_conf.c | 1 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 32 +++++-
src/qemu/qemu_process.c | 37 +++---
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/xen/xen_driver.c | 9 ++
.../qemuxml2argv-arm-vexpressa9-basic.args | 8 ++
.../qemuxml2argv-arm-vexpressa9-basic.xml | 34 ++++++
.../qemuxml2argv-arm-vexpressa9-nodevs.args | 5 +
.../qemuxml2argv-arm-vexpressa9-nodevs.xml | 26 +++++
.../qemuxml2argv-arm-vexpressa9-virtio.args | 14 +++
.../qemuxml2argv-arm-vexpressa9-virtio.xml | 45 ++++++++
.../qemuxml2argv-balloon-device-auto.args | 3 +-
.../qemuxml2argv-balloon-device-period.args | 3 +-
.../qemuxml2argv-balloon-device.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-bios.args | 2 +-
.../qemuxml2argv-blkdeviotune.args | 3 +-
.../qemuxml2argv-blkiotune-device.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-blkiotune.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 3 +-
.../qemuxml2argv-boot-complex-bootindex.args | 2 +-
.../qemuxml2argv-boot-complex.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 3 +-
...xml2argv-boot-menu-disable-drive-bootindex.args | 3 +-
.../qemuxml2argv-boot-menu-disable-drive.args | 3 +-
.../qemuxml2argv-boot-menu-disable.args | 3 +-
.../qemuxml2argv-boot-menu-enable.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-boot-multi.args | 3 +-
.../qemuxml2argv-boot-network.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-boot-order.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-bootloader.args | 3 +-
.../qemuxml2argv-channel-guestfwd.args | 3 +-
.../qemuxml2argv-channel-virtio-auto.args | 3 +-
.../qemuxml2argv-channel-virtio.args | 3 +-
.../qemuxml2argv-clock-france.args | 4 +-
.../qemuxml2argv-clock-localtime.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 3 +-
.../qemuxml2argv-clock-variable.args | 3 +-
.../qemuxml2argv-console-compat-auto.args | 3 +-
.../qemuxml2argv-console-compat-chardev.args | 3 +-
.../qemuxml2argv-console-compat.args | 3 +-
.../qemuxml2argv-console-sclp.args | 3 +-
.../qemuxml2argv-console-virtio-ccw.args | 3 +-
.../qemuxml2argv-console-virtio-many.args | 3 +-
.../qemuxml2argv-console-virtio-s390.args | 3 +-
.../qemuxml2argv-console-virtio.args | 3 +-
.../qemuxml2argv-cpu-eoi-disabled.args | 3 +-
.../qemuxml2argv-cpu-eoi-enabled.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-exact1.args | 3 +-
.../qemuxml2argv-cpu-exact2-nofallback.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args | 3 +-
.../qemuxml2argv-cpu-fallback.args | 2 +-
.../qemuxml2argv-cpu-host-kvmclock.args | 3 +-
.../qemuxml2argv-cpu-host-model-fallback.args | 2 +-
.../qemuxml2argv-cpu-host-model.args | 2 +-
.../qemuxml2argv-cpu-host-passthrough.args | 2 +-
.../qemuxml2argv-cpu-kvmclock.args | 3 +-
.../qemuxml2argv-cpu-minimum1.args | 3 +-
.../qemuxml2argv-cpu-minimum2.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa1.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-cpu-numa2.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args | 3 +-
.../qemuxml2argv-cpu-topology1.args | 3 +-
.../qemuxml2argv-cpu-topology2.args | 3 +-
.../qemuxml2argv-cpu-topology3.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-cputune.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args | 3 +-
.../qemuxml2argv-disk-blockio.args | 2 +-
.../qemuxml2argv-disk-cdrom-empty.args | 3 +-
.../qemuxml2argv-disk-cdrom-network-ftp.args | 3 +-
.../qemuxml2argv-disk-cdrom-network-http.args | 3 +-
...qemuxml2argv-disk-cdrom-tray-no-device-cap.args | 3 +-
.../qemuxml2argv-disk-cdrom-tray.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 3 +-
.../qemuxml2argv-disk-copy_on_read.args | 2 +-
.../qemuxml2argv-disk-drive-boot-cdrom.args | 3 +-
.../qemuxml2argv-disk-drive-boot-disk.args | 3 +-
.../qemuxml2argv-disk-drive-cache-directsync.args | 3 +-
.../qemuxml2argv-disk-drive-cache-unsafe.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v1-none.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v1-wb.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v1-wt.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v2-none.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v2-wb.args | 3 +-
.../qemuxml2argv-disk-drive-cache-v2-wt.args | 3 +-
.../qemuxml2argv-disk-drive-discard.args | 2 +-
...uxml2argv-disk-drive-error-policy-enospace.args | 3 +-
.../qemuxml2argv-disk-drive-error-policy-stop.args | 3 +-
...gv-disk-drive-error-policy-wreport-rignore.args | 3 +-
.../qemuxml2argv-disk-drive-fat.args | 3 +-
.../qemuxml2argv-disk-drive-fmt-qcow.args | 3 +-
.../qemuxml2argv-disk-drive-network-gluster.args | 3 +-
...qemuxml2argv-disk-drive-network-iscsi-auth.args | 3 +-
.../qemuxml2argv-disk-drive-network-iscsi-lun.args | 2 +-
.../qemuxml2argv-disk-drive-network-iscsi.args | 3 +-
...qemuxml2argv-disk-drive-network-nbd-export.args | 3 +-
...ml2argv-disk-drive-network-nbd-ipv6-export.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd-ipv6.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd-unix.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd.args | 3 +-
.../qemuxml2argv-disk-drive-network-rbd-auth.args | 2 +-
...muxml2argv-disk-drive-network-rbd-ceph-env.args | 4 +-
.../qemuxml2argv-disk-drive-network-rbd-ipv6.args | 2 +-
.../qemuxml2argv-disk-drive-network-rbd.args | 2 +-
.../qemuxml2argv-disk-drive-network-sheepdog.args | 3 +-
.../qemuxml2argv-disk-drive-no-boot.args | 2 +-
.../qemuxml2argv-disk-drive-readonly-disk.args | 3 +-
...qemuxml2argv-disk-drive-readonly-no-device.args | 3 +-
.../qemuxml2argv-disk-drive-shared.args | 3 +-
...emuxml2argv-disk-floppy-tray-no-device-cap.args | 3 +-
.../qemuxml2argv-disk-floppy-tray.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 3 +-
.../qemuxml2argv-disk-geometry.args | 3 +-
.../qemuxml2argv-disk-ide-drive-split.args | 2 +-
.../qemuxml2argv-disk-ide-wwn.args | 2 +-
.../qemuxml2argv-disk-ioeventfd.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-disk-order.args | 3 +-
.../qemuxml2argv-disk-sata-device.args | 3 +-
.../qemuxml2argv-disk-scsi-device-auto.args | 3 +-
.../qemuxml2argv-disk-scsi-device.args | 3 +-
.../qemuxml2argv-disk-scsi-disk-split.args | 2 +-
.../qemuxml2argv-disk-scsi-disk-vpd.args | 2 +-
.../qemuxml2argv-disk-scsi-disk-wwn.args | 2 +-
.../qemuxml2argv-disk-scsi-lun-passthrough.args | 3 +-
.../qemuxml2argv-disk-scsi-megasas.args | 3 +-
.../qemuxml2argv-disk-scsi-virtio-scsi.args | 3 +-
.../qemuxml2argv-disk-scsi-vscsi.args | 3 +-
.../qemuxml2argv-disk-snapshot.args | 3 +-
.../qemuxml2argv-disk-usb-device.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args | 3 +-
.../qemuxml2argv-disk-virtio-ccw-many.args | 3 +-
.../qemuxml2argv-disk-virtio-ccw.args | 3 +-
.../qemuxml2argv-disk-virtio-s390.args | 3 +-
.../qemuxml2argv-disk-virtio-scsi-ccw.args | 3 +-
.../qemuxml2argv-disk-virtio-scsi-num_queues.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 3 +-
.../qemuxml2argv-eoi-disabled.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-eoi-enabled.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-event_idx.args | 2 +-
.../qemuxml2argv-floppy-drive-fat.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-fs9p.args | 3 +-
.../qemuxml2argv-graphics-vnc-sasl.args | 3 +-
.../qemuxml2argv-graphics-vnc-tls.args | 3 +-
.../qemuxml2argv-graphics-vnc-websocket.args | 3 +-
.../qemuxml2argv-hostdev-pci-address-device.args | 3 +-
.../qemuxml2argv-hostdev-pci-address.args | 3 +-
.../qemuxml2argv-hostdev-scsi-boot.args | 3 +-
.../qemuxml2argv-hostdev-scsi-lsi.args | 3 +-
.../qemuxml2argv-hostdev-scsi-readonly.args | 3 +-
.../qemuxml2argv-hostdev-scsi-virtio-scsi.args | 3 +-
...muxml2argv-hostdev-usb-address-device-boot.args | 3 +-
.../qemuxml2argv-hostdev-usb-address-device.args | 3 +-
.../qemuxml2argv-hostdev-usb-address.args | 3 +-
.../qemuxml2argv-hostdev-vfio.args | 3 +-
.../qemuxml2argv-hotplug-base.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-hugepages.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-hyperv-off.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-hyperv.args | 3 +-
.../qemuxml2argv-input-usbmouse-addr.args | 3 +-
.../qemuxml2argv-input-usbmouse.args | 3 +-
.../qemuxml2argv-input-usbtablet.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-kvm.args | 2 +-
.../qemuxml2argv-kvmclock+eoi-disabled.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-kvmclock.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-lease.args | 3 +-
.../qemuxml2argv-machine-aliases1.args | 2 +-
.../qemuxml2argv-machine-aliases2.args | 3 +-
.../qemuxml2argv-machine-core-off.args | 3 +-
.../qemuxml2argv-machine-core-on.args | 3 +-
.../qemuxml2argv-machine-usb-opt.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-memtune.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-metadata.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-migrate.args | 3 +-
.../qemuxml2argv-minimal-s390.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 3 +-
.../qemuxml2argv-misc-disable-s3.args | 3 +-
.../qemuxml2argv-misc-disable-suspends.args | 3 +-
.../qemuxml2argv-misc-enable-s4.args | 3 +-
.../qemuxml2argv-misc-no-reboot.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-mlock-off.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-mlock-on.args | 2 +-
.../qemuxml2argv-mlock-unsupported.args | 2 +-
.../qemuxml2argv-monitor-json.args | 3 +-
.../qemuxml2argv-multifunction-pci-device.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-net-client.args | 3 +-
.../qemuxml2argv-net-eth-ifname.args | 3 +-
.../qemuxml2argv-net-eth-names.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 3 +-
.../qemuxml2argv-net-hostdev-vfio.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-net-server.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 3 +-
.../qemuxml2argv-net-virtio-ccw.args | 3 +-
.../qemuxml2argv-net-virtio-device.args | 3 +-
.../qemuxml2argv-net-virtio-netdev.args | 3 +-
.../qemuxml2argv-net-virtio-s390.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-net-virtio.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-no-shutdown.args | 2 +-
.../qemuxml2argv-nographics-vga.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-nographics.args | 3 +-
.../qemuxml2argv-nosharepages.args | 3 +-
...qemuxml2argv-numad-auto-memory-vcpu-cpuset.args | 3 +-
...d-auto-memory-vcpu-no-cpuset-and-placement.args | 3 +-
...muxml2argv-numad-auto-vcpu-static-numatune.args | 3 +-
...qemuxml2argv-numad-static-memory-auto-vcpu.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-numad.args | 3 +-
.../qemuxml2argv-numatune-memory.args | 3 +-
.../qemuxml2argv-parallel-parport-chardev.args | 3 +-
.../qemuxml2argv-parallel-tcp-chardev.args | 3 +-
.../qemuxml2argv-parallel-tcp.args | 3 +-
.../qemuxml2argv-pci-autoadd-addr.args | 2 +-
.../qemuxml2argv-pci-autoadd-idx.args | 2 +-
.../qemuxml2argv-pci-bridge-many-disks.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args | 3 +-
.../qemuxml2argv-pcihole64-none.args | 2 +-
.../qemuxml2argv-pcihole64-q35.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pcihole64.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 2 +-
.../qemuxml2argv-pseries-basic.args | 2 +-
.../qemuxml2argv-pseries-nvram.args | 3 +-
.../qemuxml2argv-pseries-usb-default.args | 2 +-
.../qemuxml2argv-pseries-usb-multi.args | 2 +-
.../qemuxml2argv-pseries-vio-user-assigned.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +-
.../qemuxml2argv-qemu-ns-no-env.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-qemu-ns.args | 4 +-
.../qemuxml2argv-reboot-timeout-disabled.args | 3 +-
.../qemuxml2argv-reboot-timeout-enabled.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-restore-v1.args | 3 +-
.../qemuxml2argv-restore-v2-fd.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-restore-v2.args | 3 +-
.../qemuxml2argv-s390-piix-controllers.args | 2 +-
.../qemuxml2argv-s390-usb-none.args | 2 +-
.../qemuxml2argv-seclabel-dynamic-baselabel.args | 3 +-
.../qemuxml2argv-seclabel-dynamic-labelskip.args | 3 +-
.../qemuxml2argv-seclabel-dynamic-override.args | 3 +-
.../qemuxml2argv-seclabel-dynamic.args | 3 +-
.../qemuxml2argv-seclabel-none.args | 3 +-
.../qemuxml2argv-seclabel-static-labelskip.args | 3 +-
.../qemuxml2argv-seclabel-static-relabel.args | 3 +-
.../qemuxml2argv-seclabel-static.args | 3 +-
.../qemuxml2argv-serial-dev-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-dev.args | 3 +-
.../qemuxml2argv-serial-file-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-file.args | 3 +-
.../qemuxml2argv-serial-many-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-many.args | 3 +-
.../qemuxml2argv-serial-pty-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-pty.args | 3 +-
.../qemuxml2argv-serial-tcp-chardev.args | 3 +-
.../qemuxml2argv-serial-tcp-telnet-chardev.args | 3 +-
.../qemuxml2argv-serial-tcp-telnet.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 3 +-
.../qemuxml2argv-serial-udp-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-udp.args | 3 +-
.../qemuxml2argv-serial-unix-chardev.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-serial-unix.args | 3 +-
.../qemuxml2argv-serial-vc-chardev.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 3 +-
.../qemuxml2argv-smartcard-controller.args | 3 +-
.../qemuxml2argv-smartcard-host-certificates.args | 3 +-
.../qemuxml2argv-smartcard-host.args | 3 +-
...emuxml2argv-smartcard-passthrough-spicevmc.args | 3 +-
.../qemuxml2argv-smartcard-passthrough-tcp.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-smbios.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-smp.args | 3 +-
.../qemuxml2argv-sound-device.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-sound.args | 3 +-
.../qemuxml2argv-tpm-passthrough.args | 2 +-
.../qemuxml2argv-usb-controller.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-hub.args | 3 +-
.../qemuxml2argv-usb-ich9-companion.args | 3 +-
.../qemuxml2argv-usb-ich9-ehci-addr.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-none.args | 3 +-
.../qemuxml2argv-usb-piix3-controller.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-ports.args | 3 +-
.../qemuxml2argv-usb-redir-boot.args | 3 +-
.../qemuxml2argv-usb-redir-filter.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-usb-redir.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-usb1-usb2.args | 3 +-
.../qemuxml2argvdata/qemuxml2argv-virtio-lun.args | 2 +-
.../qemuxml2argv-virtio-rng-ccw.args | 3 +-
.../qemuxml2argv-virtio-rng-default.args | 3 +-
.../qemuxml2argv-virtio-rng-egd.args | 3 +-
.../qemuxml2argv-virtio-rng-random.args | 3 +-
.../qemuxml2argv-watchdog-device.args | 3 +-
.../qemuxml2argv-watchdog-dump.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-watchdog.args | 3 +-
tests/qemuxml2argvtest.c | 10 ++
.../qemuxmlns-qemu-ns-commandline-ns0.args | 2 +-
.../qemuxmlns-qemu-ns-commandline-ns1.args | 2 +-
.../qemuxmlns-qemu-ns-commandline.args | 2 +-
.../qemuxmlns-qemu-ns-domain-commandline-ns0.args | 2 +-
.../qemuxmlns-qemu-ns-domain-commandline.args | 2 +-
.../qemuxmlns-qemu-ns-domain-ns0.args | 2 +-
tests/qemuxmlnsdata/qemuxmlns-qemu-ns-domain.args | 2 +-
tests/testutilsqemu.c | 33 ++++++
314 files changed, 948 insertions(+), 350 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-basic.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-nodevs.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-arm-vexpressa9-virtio.xml
--
1.8.3.1
11 years, 2 months
[libvirt] [ libvirt ] [ PATCH ] Added support for ARMv7 Big Endian
by yogesh tillu
Hi All,
Could you please review below patch, I have successfully tested patch on
ARM Versatile Express V2P Board.
From: Yogesh Tillu <tillu.yogesh(a)gmail.com>
Date: Thu, 5 Sep 2013 17:07:55 +0530
Subject: [PATCH] [ PATCH ] Added Support for ARMv7 Big Endian
Signed-off-by: Yogesh Tillu <tillu.yogesh(a)gmail.com>
---
src/util/virarch.c | 1 +
src/util/virarch.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/util/virarch.c b/src/util/virarch.c
index 81558e5..b4e06da 100644
--- a/src/util/virarch.c
+++ b/src/util/virarch.c
@@ -37,6 +37,7 @@ static const struct virArchData {
{ "alpha", 64, VIR_ARCH_BIG_ENDIAN },
{ "armv6l", 32, VIR_ARCH_LITTLE_ENDIAN },
{ "armv7l", 32, VIR_ARCH_LITTLE_ENDIAN },
+ { "armv7b", 32, VIR_ARCH_BIG_ENDIAN },
{ "cris", 32, VIR_ARCH_LITTLE_ENDIAN },
{ "i686", 32, VIR_ARCH_LITTLE_ENDIAN },
diff --git a/src/util/virarch.h b/src/util/virarch.h
index 0d8ae25..dd25679 100644
--- a/src/util/virarch.h
+++ b/src/util/virarch.h
@@ -29,6 +29,7 @@ typedef enum {
VIR_ARCH_ALPHA, /* Alpha 64 BE
http://en.wikipedia.org/wiki/DEC_Alpha */
VIR_ARCH_ARMV6L, /* ARMv6 32 LE
http://en.wikipedia.org/wiki/ARM_architecture */
VIR_ARCH_ARMV7L, /* ARMv7 32 LE
http://en.wikipedia.org/wiki/ARM_architecture */
+ VIR_ARCH_ARMV7B, /* ARMv7 32 BE
http://en.wikipedia.org/wiki/ARM_architecture */
VIR_ARCH_CRIS, /* ETRAX 32 LE
http://en.wikipedia.org/wiki/ETRAX_CRIS */
VIR_ARCH_I686, /* x86 32 LE
http://en.wikipedia.org/wiki/X86 */
--
1.8.1.2
Test Performed:
# virsh nodeinfo
CPU model: armv7b
CPU(s): 1
CPU frequency: 48 MHz
CPU socket(s): 1
Core(s) per socket: 5
Thread(s) per core: 1
NUMA cell(s): 1
Memory size: 1029784 KiB
Regards,
Yogesh Tillu
11 years, 2 months
[libvirt] [PATCH] LXC: Free variable vroot in lxcDomainDetachDeviceHostdevUSBLive()
by Hongwei Bi
The variable vroot should be freed in label cleanup.
---
src/lxc/lxc_driver.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 9cb95ff..b587c22 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3766,7 +3766,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
virDomainHostdevDefPtr def = NULL;
int idx, ret = -1;
char *dst = NULL;
- char *vroot;
+ char *vroot = NULL;
virUSBDevicePtr usb = NULL;
if ((idx = virDomainHostdevFind(vm->def,
@@ -3824,6 +3824,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
cleanup:
virUSBDeviceFree(usb);
VIR_FREE(dst);
+ VIR_FREE(vroot);
return ret;
}
--
1.7.1
11 years, 2 months
[libvirt] [PATCH v2 0/3] Improve PPC CPU driver
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
Currently, PPC CPU driver doesn't support to parse guest data.
It can't pass CPU parameters to Qemu command line.
This patchset is to implement .guestData to support to parse guest
CPU configuration and .update to support host-model and host-passthrough.
The guest CPU configuration is as the following:
<cpu match='exact'>
<model>POWER7_v2.3</model>
<vendor>IBM</vendor>
</cpu>
v2 -> v1:
* Remove features functions calling for non-x86 platform (Doug Goldstein)
* Improve update code.
* Merge update code with guestData.
Li Zhang (3):
Remove CPU features check for non-x86 platform.
cpu: Implement guestData and update for PPC
cpu: Add cpu test cases for PPC CPU driver.
src/cpu/cpu_powerpc.c | 178 ++++++++++++++++++++-
src/qemu/qemu_command.c | 16 +-
tests/cputest.c | 9 ++
tests/cputestdata/ppc64-baseline-1-result.xml | 3 +
.../ppc64-baseline-incompatible-vendors.xml | 14 ++
.../ppc64-baseline-no-vendor-result.xml | 3 +
tests/cputestdata/ppc64-baseline-no-vendor.xml | 7 +
tests/cputestdata/ppc64-exact.xml | 3 +
tests/cputestdata/ppc64-guest-nofallback.xml | 4 +
tests/cputestdata/ppc64-guest.xml | 4 +
.../ppc64-host+guest,ppc_models-result.xml | 5 +
...st-nofallback,ppc_models,POWER7_v2.1-result.xml | 5 +
tests/cputestdata/ppc64-host.xml | 6 +
tests/cputestdata/ppc64-strict.xml | 3 +
.../qemuxml2argv-pseries-cpu-exact.args | 7 +
.../qemuxml2argv-pseries-cpu-exact.xml | 21 +++
tests/qemuxml2argvtest.c | 1 +
17 files changed, 279 insertions(+), 10 deletions(-)
create mode 100644 tests/cputestdata/ppc64-baseline-1-result.xml
create mode 100644 tests/cputestdata/ppc64-baseline-incompatible-vendors.xml
create mode 100644 tests/cputestdata/ppc64-baseline-no-vendor-result.xml
create mode 100644 tests/cputestdata/ppc64-baseline-no-vendor.xml
create mode 100644 tests/cputestdata/ppc64-exact.xml
create mode 100644 tests/cputestdata/ppc64-guest-nofallback.xml
create mode 100644 tests/cputestdata/ppc64-guest.xml
create mode 100644 tests/cputestdata/ppc64-host+guest,ppc_models-result.xml
create mode 100644 tests/cputestdata/ppc64-host+guest-nofallback,ppc_models,POWER7_v2.1-result.xml
create mode 100644 tests/cputestdata/ppc64-host.xml
create mode 100644 tests/cputestdata/ppc64-strict.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.xml
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH] Add support for enabling SASL for SPICE guests
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
QEMU has support for SASL auth for SPICE guests, but libvirt
has no way to enable it. Following the example from VNC where
it is globally enabled via qemu.conf
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/libvirtd_qemu.aug | 2 ++
src/qemu/qemu.conf | 16 ++++++++++++++++
src/qemu/qemu_command.c | 10 ++++++++++
src/qemu/qemu_conf.c | 3 +++
src/qemu/qemu_conf.h | 2 ++
src/qemu/test_libvirtd_qemu.aug.in | 2 ++
6 files changed, 35 insertions(+)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index cd13d53..118d4c7 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -38,6 +38,8 @@ module Libvirtd_qemu =
| bool_entry "spice_tls"
| str_entry "spice_tls_x509_cert_dir"
| str_entry "spice_password"
+ | bool_entry "spice_sasl"
+ | str_entry "spice_sasl_dir"
let nogfx_entry = bool_entry "nographics_allow_host_audio"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 5fd6263..6d4e99e 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -140,6 +140,22 @@
#spice_password = "XYZ12345"
+# Enable use of SASL encryption on the SPICE server. This requires
+# a SPICE client which supports the SASL protocol extension.
+#
+# It is necessary to configure /etc/sasl2/qemu.conf to choose
+# the desired SASL plugin (eg, GSSPI for Kerberos)
+#
+#spice_sasl = 1
+
+# The default SASL configuration file is located in /etc/sasl2/
+# When running libvirtd unprivileged, it may be desirable to
+# override the configs in this location. Set this parameter to
+# point to the directory, and create a qemu.conf in that location
+#
+#spice_sasl_dir = "/some/directory/sasl2"
+
+
# By default, if no graphical front end is configured, libvirt will disable
# QEMU audio output since directly talking to alsa/pulseaudio may not work
# with various security settings. If you know what you're doing, enable
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 91ca86a..5e4ebc8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7065,6 +7065,16 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
virBufferAsprintf(&opt, "tls-port=%u", tlsPort);
}
+ if (cfg->spiceSASL) {
+ virBufferAddLit(&opt, ",sasl");
+
+ if (cfg->spiceSASLdir)
+ virCommandAddEnvPair(cmd, "SASL_CONF_DIR",
+ cfg->spiceSASLdir);
+
+ /* TODO: Support ACLs later */
+ }
+
switch (virDomainGraphicsListenGetType(graphics, 0)) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 1f57f72..41ca7a3 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -266,6 +266,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->spiceTLSx509certdir);
VIR_FREE(cfg->spiceListen);
VIR_FREE(cfg->spicePassword);
+ VIR_FREE(cfg->spiceSASLdir);
VIR_FREE(cfg->hugetlbfsMount);
VIR_FREE(cfg->hugepagePath);
@@ -379,6 +380,8 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
GET_VALUE_BOOL("spice_tls", cfg->spiceTLS);
GET_VALUE_STR("spice_tls_x509_cert_dir", cfg->spiceTLSx509certdir);
+ GET_VALUE_BOOL("spice_sasl", cfg->spiceSASL);
+ GET_VALUE_STR("spice_sasl_dir", cfg->spiceSASLdir);
GET_VALUE_STR("spice_listen", cfg->spiceListen);
GET_VALUE_STR("spice_password", cfg->spicePassword);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 206f2c6..cbd7053 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -111,6 +111,8 @@ struct _virQEMUDriverConfig {
bool spiceTLS;
char *spiceTLSx509certdir;
+ bool spiceSASL;
+ char *spiceSASLdir;
char *spiceListen;
char *spicePassword;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index ea770dc..1a9fb20 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -15,6 +15,8 @@ module Test_libvirtd_qemu =
{ "spice_tls" = "1" }
{ "spice_tls_x509_cert_dir" = "/etc/pki/libvirt-spice" }
{ "spice_password" = "XYZ12345" }
+{ "spice_sasl" = "1" }
+{ "spice_sasl_dir" = "/some/directory/sasl2" }
{ "nographics_allow_host_audio" = "1" }
{ "remote_display_port_min" = "5900" }
{ "remote_display_port_max" = "65535" }
--
1.8.3.1
11 years, 2 months