[libvirt] [PATCH] vbox: add support for v4.2.20+ and v4.3.4+
by Jean-Baptiste Rouault
While working on adding virDomain*Stats support to the vbox driver, we
found bugs in the VirtualBox API C bindings. These bugs have been fixed
in versions 4.2.20 and 4.3.4.
However, the changes in the C bindings are incompatible with the vbox_CAPI_v4_2.h
and vbox_CAPI_v4_3.h files which are bundled in libvirt source code. This is why the
following patch adds vbox_CAPI_v4_2_20.h and vbox_CAPI_v4_3_4.h.
We tried to keep compatibility with older VirtualBox 4.2.x and 4.3.x releases so we
added a "SPECIAL_VERSION" identifier to conditionnaly include the right header.
I'm not really pleased with this "SPECIAL_VERSION" identifier, maybe we could instead
increase the precision of "VBOX_API_VERSION", for example 4002 would become 4002000.
This would permit us to select the right header based on the VBOX_API_VERSION only, what
do you think ?
Jean-Baptiste Rouault (1):
vbox: add support for v4.2.20+ and v4.3.4+
src/Makefile.am | 4 +-
src/vbox/vbox_CAPI_v4_2_20.h | 9001 +++++++++++++++++++++++++++++++++++
src/vbox/vbox_CAPI_v4_3_4.h | 10321 +++++++++++++++++++++++++++++++++++++++++
src/vbox/vbox_V2_2.c | 1 +
src/vbox/vbox_V3_0.c | 1 +
src/vbox/vbox_V3_1.c | 1 +
src/vbox/vbox_V3_2.c | 1 +
src/vbox/vbox_V4_0.c | 1 +
src/vbox/vbox_V4_1.c | 1 +
src/vbox/vbox_V4_2.c | 1 +
src/vbox/vbox_V4_2_20.c | 14 +
src/vbox/vbox_V4_3.c | 1 +
src/vbox/vbox_V4_3_4.c | 14 +
src/vbox/vbox_driver.c | 20 +-
src/vbox/vbox_tmpl.c | 12 +-
15 files changed, 19389 insertions(+), 5 deletions(-)
create mode 100644 src/vbox/vbox_CAPI_v4_2_20.h
create mode 100644 src/vbox/vbox_CAPI_v4_3_4.h
create mode 100644 src/vbox/vbox_V4_2_20.c
create mode 100644 src/vbox/vbox_V4_3_4.c
--
1.8.5.1
10 years, 11 months
[libvirt] libvirt on armhf with selinux driver
by Ivan Gooten
hi,
recently i've been busy with libvirt(d) v1.2.0 and v1.2.1 from GIT on armhf and i see, even
if selinux sec driver is enabled on the configure stage, the driver is
not finally created. i pass these configure parameters:
--with-selinux
--with-secdriver-selinux
--with-selinux-mount=/sys/fs/selinux
the /sys/fs/selinux is valid, selinux is running in permissive mode, got
also libselinux DEV package installed, so no missing req. headers here.
when trying to run libvirtd, i'm getting:
error : virSecurityDriverLookup:78 : unsupported configuration: Security
driver selinux not enabled
error : lxcSecurityInit:1461 : Failed to initialise security drivers
error : virStateInitialize:854 : Initialisation of LXC state driver
failed: unsupported configuration: Security driver selinux not enabled
error : daemonRunStateInit:909 : Driver state initialisation failed
here i provide the configure summary:
http://pastebin.com/un0UnFCP
for me it looks okay, and below is is the sestatus:
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: default
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
the platform is running custom kernel 3.10 with debian testing a.k.a. jessie.
also, my friend with the same configuration on rpi, except for his newer
kernel, is having same stranginess.
someone got any clue what may be causing this and/or howto debug this?
thanks,
ivan gooten
10 years, 11 months
[libvirt] [PATCHv2] storage: FS: Tweak some comments and fix typos
by Peter Krempa
---
Notes:
Version 2:
- tweak most of the messages
I'm not going to push this without a review as I'm not a native speaker.
src/storage/storage_backend_fs.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 6ebdd46..19add8a 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -1,7 +1,7 @@
/*
* storage_backend_fs.c: storage backend for FS and directory handling
*
- * Copyright (C) 2007-2013 Red Hat, Inc.
+ * Copyright (C) 2007-2014 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -460,7 +460,7 @@ cleanup:
* @pool storage pool to unmount
*
* Ensure that a FS storage pool is not mounted on its target location.
- * If already unmounted, this is a no-op
+ * If already unmounted, this is a no-op.
*
* Returns 0 if successfully unmounted, -1 on error
*/
@@ -540,9 +540,8 @@ virStorageBackendFileSystemCheck(virConnectPtr conn ATTRIBUTE_UNUSED,
* @conn connection to report errors against
* @pool storage pool to start
*
- * Starts a directory or FS based storage pool.
- *
- * - If it is a FS based pool, mounts the unlying source device on the pool
+ * Starts a directory or FS based storage pool. If the pool is a FS based
+ * pool the underlying source device will be mounted.
*
* Returns 0 on success, -1 on error
*/
@@ -739,7 +738,7 @@ error:
* VIR_STORAGE_POOL_BUILD_OVERWRITE is set, mkfs is always executed,
* any existed data on the target device is overwritten unconditionally.
*
- * - If it is a FS based pool, mounts the unlying source device on the pool
+ * If the pool is a FS based pool the underlying source device is mounted.
*
* Returns 0 on success, -1 on error
*/
@@ -940,12 +939,12 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
/**
* @conn connection to report errors against
- * @pool storage pool to start
+ * @pool storage pool to stop
*
- * Stops a FS based storage pool.
+ * Stops a FS based storage pool. If @pool is a FS based pool the underlying
+ * source device is unmounted. All cached data about volumes is released.
*
- * - If it is a FS based pool, unmounts the unlying source device on the pool
- * - Releases all cached data about volumes
+ * Returns 0 on success, -1 on error.
*/
#if WITH_STORAGE_FS
static int
--
1.8.5.2
10 years, 11 months
[libvirt] [PATCH] build: fix build on mingw with winpthreads
by Eric Blake
On my Fedora 20 box with mingw cross-compiler, the build failed with:
../../src/rpc/virnetclient.c: In function 'virNetClientSetTLSSession':
../../src/rpc/virnetclient.c:745:14: error: unused variable 'oldmask' [-Werror=unused-variable]
sigset_t oldmask, blockedsigs;
^
I traced it to the fact that mingw64-winpthreads installs a header
that does #define pthread_sigmask(...) 0, which means any argument
only ever passeed to pthread_sigmask is reported as unused. This
patch works around the compilation failure, with behavior no worse
than what mingw already gives us regarding the function being a
no-op.
* configure.ac (pthread_sigmask): Probe for broken mingw macro.
* src/util/virutil.h (pthread_sigmask): Rewrite to something that
avoids unused variables.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Tested for both mingw and Linux; I'll probably push this under
the build-breaker rule on Monday if I don't have a review first.
configure.ac | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index d02b9d2..f5dccf1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-dnl Copyright (C) 2005-2013 Red Hat, Inc.
+dnl Copyright (C) 2005-2014 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
@@ -276,6 +276,22 @@ dnl LIB_PTHREAD and LIBMULTITHREAD were set during gl_INIT by gnulib.
old_LIBS=$LIBS
LIBS="$LIBS $LIB_PTHREAD $LIBMULTITHREAD"
AC_CHECK_FUNCS([pthread_mutexattr_init])
+dnl At least mingw64-winpthreads #defines pthread_sigmask to 0,
+dnl which in turn causes compilation to complain about unused variables.
+dnl Expose this broken implementation, so we can work around it.
+AC_CACHE_CHECK([whether pthread_sigmask does anything],
+ [lv_cv_pthread_sigmask_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <signal.h>
+ ]], [[
+ int (*foo)(int, const sigset_t *, sigset_t *) = &pthread_sigmask;
+ return !foo;
+ ]])], [lv_cv_pthread_sigmask_works=yes], [lv_cv_pthread_sigmask_works=no])])
+if test "x$lv_cv_pthread_sigmask_works" != xyes; then
+ AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1],
+ [Define to 1 if pthread_sigmask is not a real function])
+fi
LIBS=$old_libs
dnl Availability of various common headers (non-fatal if missing).
--
1.8.4.2
10 years, 11 months
[libvirt] [PATCH] Don't crash if a connection closes early
by Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=1047577
When a client closes its connection to libvirtd early during
virConnectOpen, more specifically just after making
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE call to check if
VIR_DRV_FEATURE_PROGRAM_KEEPALIVE is supported without even waiting for
the result, libvirtd may crash due to a race in keep-alive
initialization. Once receiving the REMOTE_PROC_CONNECT_SUPPORTS_FEATURE
call, the daemon's event loop delegates it to a worker thread. In case
the event loop detects EOF on the connection and calls
virNetServerClientClose before the worker thread starts to handle
REMOTE_PROC_CONNECT_SUPPORTS_FEATURE call, client->keepalive will be
disposed by the time virNetServerClientStartKeepAlive gets called from
remoteDispatchConnectSupportsFeature. Because the flow is common for
both authenticated and read-only connections, even unprivileged clients
may cause the daemon to crash.
To void the crash, virNetServerClientStartKeepAlive needs to check if
the connection is still open before starting keep-alive protocol.
Every libvirt release since 0.9.8 is affected by this bug.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/rpc/virnetserverclient.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 8aebeb0..7830b7f 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1539,9 +1539,22 @@ cleanup:
int
virNetServerClientStartKeepAlive(virNetServerClientPtr client)
{
- int ret;
+ int ret = -1;
+
virObjectLock(client);
+
+ /* The connection might have been closed before we got here and thus the
+ * keepalive object could have been removed too.
+ */
+ if (!client->sock) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("connection not open"));
+ goto cleanup;
+ }
+
ret = virKeepAliveStart(client->keepalive, 0, 0);
+
+cleanup:
virObjectUnlock(client);
return ret;
}
--
1.8.5.2
10 years, 11 months
[libvirt] [PATCH 0/2] v3: spice: expose the disable file transfer option
by Francesco Romani
Addressed Christophe's comments.
Added filetransfer check in another test.
I think now the setting should survive a dumpxml roundtrip, any suggestion
for further improvement is of course welcome.
Francesco Romani (2):
spice: detect if qemu can disable file transfer
spice: expose the QEMU disable file transfer option
docs/formatdomain.html.in | 8 +++++
docs/schemas/domaincommon.rng | 11 ++++++
src/conf/domain_conf.c | 31 ++++++++++++++++-
src/conf/domain_conf.h | 10 ++++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_capabilities.c | 5 ++-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 9 +++++
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
...emuxml2argv-graphics-spice-agent-file-xfer.args | 9 +++++
...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 40 ++++++++++++++++++++++
.../qemuxml2argv-graphics-spice.args | 5 +--
.../qemuxml2argv-graphics-spice.xml | 1 +
tests/qemuxml2argvtest.c | 9 ++++-
15 files changed, 138 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml
--
1.8.4.2
10 years, 11 months
[libvirt] [PATCH 0/2] Trivial fixes for 1.2.1
by Peter Krempa
Peter Krempa (2):
storage: Break long lines and clean up spaces in storage backend
header
storage: FS: Tweak some comments and fix typo
src/storage/storage_backend.h | 56 ++++++++++++++++++++++++++--------------
src/storage/storage_backend_fs.c | 21 ++++++++-------
2 files changed, 48 insertions(+), 29 deletions(-)
--
1.8.5.2
10 years, 11 months
[libvirt] [Ruby]How to retrieve nodes in <devices> ?
by Teto
Hi,
I would like to list devices (for instance I would like to retrieve
the <filesystem> part in <devices><filesystem
type="mount">...</filesystem></devices>) embedded in a domain via the
ruby bindings ?
Thanks
Matt
10 years, 11 months
[libvirt] traffic control on hypervisor
by yue
hi,all
if we can control the bandwidth of vm at hypervisor level?
i know linux tc command can control traffic, but it is at ISO level 3, vm;s network is on bridge at level 2.
how libvirt implement traffic control over vm?
thanks
10 years, 11 months