[libvirt] [PATCH] tests: Allow multiple mock libraries
by Peter Krempa
Make virtTestMain take variable number of libraries to mock.
---
tests/testutils.c | 11 ++++++++---
tests/testutils.h | 10 +++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 9180e86..f4fbad2 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -842,9 +843,11 @@ virTestSetEnvPath(void)
int virtTestMain(int argc,
char **argv,
- const char *lib,
- int (*func)(void))
+ int (*func)(void),
+ ...)
{
+ const char *lib;
+ va_list ap;
int ret;
char *testRange = NULL;
#ifdef TEST_OOM
@@ -854,8 +857,10 @@ int virtTestMain(int argc,
if (getenv("VIR_TEST_FILE_ACCESS"))
VIRT_TEST_PRELOAD(TEST_MOCK);
- if (lib)
+ va_start(ap, func);
+ while ((lib = va_arg(ap, const char *)))
VIRT_TEST_PRELOAD(lib);
+ va_end(ap);
progname = last_component(argv[0]);
if (STRPREFIX(progname, "lt-"))
diff --git a/tests/testutils.h b/tests/testutils.h
index d1caf20..c892902 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -102,13 +102,13 @@ const char *virtTestCounterNext(void);
int virtTestMain(int argc,
char **argv,
- const char *lib,
- int (*func)(void));
+ int (*func)(void),
+ ...);
/* Setup, then call func() */
# define VIRT_TEST_MAIN(func) \
int main(int argc, char **argv) { \
- return virtTestMain(argc, argv, NULL, func); \
+ return virtTestMain(argc, argv, func, NULL); \
}
# define VIRT_TEST_PRELOAD(lib) \
@@ -131,9 +131,9 @@ int virtTestMain(int argc,
} \
} while (0)
-# define VIRT_TEST_MAIN_PRELOAD(func, lib) \
+# define VIRT_TEST_MAIN_PRELOAD(func, ...) \
int main(int argc, char **argv) { \
- return virtTestMain(argc, argv, lib, func); \
+ return virtTestMain(argc, argv, func, __VA_ARGS__, NULL); \
}
virCapsPtr virTestGenericCapsInit(void);
--
2.8.2
8 years, 6 months
[libvirt] [PATCH] Replace VIR_ERROR with standard vir*Error in state driver init
by Jovanka Gulicoska
Replace VIR_ERROR logging macros for error reporting in driver startup routines
with vir*Error function.
Link to task: http://wiki.libvirt.org/page/BiteSizedTasks#Replace_VIR_ERROR_with_standa...
Jovanka Gulicoska (1):
Replace VIR_ERROR with standard vir*Error in state driver init
src/bhyve/bhyve_driver.c | 5 +++--
src/libxl/libxl_driver.c | 6 ++---
src/lxc/lxc_driver.c | 2 +-
src/node_device/node_device_hal.c | 19 ++++++++--------
src/node_device/node_device_udev.c | 32 +++++++++++++-------------
src/nwfilter/nwfilter_driver.c | 4 ++--
src/qemu/qemu_driver.c | 43 ++++++++++++++++++-----------------
src/storage/storage_driver.c | 46 +++++++++++++++++++-------------------
src/uml/uml_driver.c | 21 ++++++++---------
src/xen/xen_driver.c | 5 +++--
10 files changed, 95 insertions(+), 88 deletions(-)
--
2.5.5
8 years, 6 months
[libvirt] [PATCH 0/4] auto-assign controller indexes
by Laine Stump
The purpose of this series is just to eliminate the need to "count
indexes" when adding controllers.
Patch 4/4 is the meat of this series. 2/4 and 3/4 are code movement to
enable 4/4, and 1/4 is a small code simplification that I noticed
while testing the rest.
Laine Stump (4):
qemu: simplify addition of USB controller in qemuParseCommandLine
conf/qemu: make IS_USB2_CONTROLLER globally available
conf: make virDomainControllerFindUnusedIndex() more generally usable
conf: permit auto-assignment of controller indexes
docs/schemas/domaincommon.rng | 8 ++--
src/conf/domain_conf.c | 92 ++++++++++++++++++++++++++++++++++++------
src/conf/domain_conf.h | 7 ++++
src/qemu/qemu_domain_address.c | 7 ----
src/qemu/qemu_parse_command.c | 8 +---
5 files changed, 92 insertions(+), 30 deletions(-)
--
2.5.5
8 years, 6 months
[libvirt] [PATCH v3 0/2] qemu: parse: Introduce qemuParseCommandLineMem
by Nishith Shah
This series moves the parsing of qemu -m memory into a separate function
and adds suffix support for the -m option.
The first patch introduces the function qemuParseCommandLineMem, and the
second patch handles suffixes for the -m values and adds a test for the
same.
Nishith Shah (2):
qemu: parse: Use qemuParseCommandLineMem for -m memory
qemu: parse: Handle suffixes for -m memory
src/qemu/qemu_parse_command.c | 35 ++++++++++++++++----
tests/qemuargv2xmldata/qemuargv2xml-mem-scale.args | 22 +++++++++++++
tests/qemuargv2xmldata/qemuargv2xml-mem-scale.xml | 37 ++++++++++++++++++++++
tests/qemuargv2xmltest.c | 1 +
4 files changed, 88 insertions(+), 7 deletions(-)
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-mem-scale.args
create mode 100644 tests/qemuargv2xmldata/qemuargv2xml-mem-scale.xml
--
2.1.4
8 years, 6 months
[libvirt] [PATCH v5 0/6] Add AES Secret Object support (for RBD only)
by John Ferlan
This is a combination of two series...
The first 2 patches are a followon to (v1 from yesterday):
http://www.redhat.com/archives/libvir-list/2016-May/msg01396.html
But there really were a offshoot of the original AES/IV Secret changes (v4):
http://www.redhat.com/archives/libvir-list/2016-May/msg01292.html
Hopefully I haven't forgotten anything along the way. There's been numerous
adjustments and changes along the way.
Patch 1 is a combination with adjustments of patches 1&2 from v1. This
should make virRandomBytes available in the virrandommock library
which then is used in later patches.
Patch 2 mostly adjust names, comments, adds #ifdef's for unavailable code
This patch will make use of the virrandommock library instead of
self-populating the enc_alg and iv_buf. Mainly because it's possible,
but also since it's the basis for later patches to utilize the same
virrandommock library.
Patch 3 splits out the existing qemuDomainGenerateRandomKey into a
vircrypto.c API. The vircrypto.c was chosen over virrandom.c
because virrandom.c ends up being included in setuid_rpc_client
and it wasn't overly clear that it was desired to drag in all
of gnutls for just this one mock function.
Patch 4 splits out the qemuDomainSecretSetup as was suggested in one review
Patch 5 is new to handle the ability to have more than one mock library
to preload from a VIRT_TEST_MAIN_PRELOAD macro. As it turns out
the qemuxml2argvtest will need not only the qemuxml2argvmock, but
also the virrandommock libraries. I went with comma separated,
but a "space" separated list is fine with me too.
Patch 6 is the remainder of the v4 of the original series. Splitting it
up with ATTRIBUTE_UNUSED markers just no longer made sense. Lots
of changes here to keep up with the previous patches, but also
to adjust error messages, variable/API names, etc. Also changed
were the secret alias (leading to adjustments in each of the .args
file for the secret alias. Along the way I also had to adjust the
expected encoded ciphertext and iv since the mock algorithm changed
from all 0xff to an increasing sequence starting at 0x00 through
the length of the buffer.
John Ferlan (6):
tests: Add mock for virRandomBytes
util: Introduce encryption APIs
util: Introduce virCryptoGenerateRandom
qemu: Introduce qemuDomainSecretSetup
tests: Allow comma separate list of libs to preload
qemu: Utilize qemu secret objects for RBD auth/secret
configure.ac | 1 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_alias.c | 23 ++
src/qemu/qemu_alias.h | 2 +
src/qemu/qemu_command.c | 117 ++++++++++-
src/qemu/qemu_domain.c | 200 +++++++++++++-----
src/util/vircrypto.c | 233 ++++++++++++++++++++-
src/util/vircrypto.h | 22 +-
tests/Makefile.am | 12 ++
...muxml2argv-disk-drive-network-rbd-auth-AES.args | 31 +++
...emuxml2argv-disk-drive-network-rbd-auth-AES.xml | 42 ++++
tests/qemuxml2argvmock.c | 16 ++
tests/qemuxml2argvtest.c | 5 +-
tests/testutils.c | 12 +-
tests/vircryptotest.c | 100 ++++++++-
tests/virrandommock.c | 39 ++++
tests/virrandomtest.c | 86 ++++++++
17 files changed, 879 insertions(+), 65 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth-AES.xml
create mode 100644 tests/virrandommock.c
create mode 100644 tests/virrandomtest.c
--
2.5.5
8 years, 6 months
[libvirt] VirtualBox 5 support
by Martin Pietsch
Dear libvirt-developer-team,
I want to manage virtual machine of VirtualBox with libvirt. In a test I found out, that VirtualBox 5 is not support by the current version of libvirt. For this reason I have added this support in the source code. Now I want to commit these changes to the libvirt project, but I do not know, if there are any interests. Who can help me?
Best Regards
Martin
--
Martin Pietsch
Technische Univeristät Dresden
Fakultät Mathematik und Naturwissenschaften / Fachrichtung Mathematik
Besucheranschrift Willersbau, C-Flügel (Anbau), Raum C 232
Zellescher Weg 12-14
01069 Dresden
Postanschrift Technische Universität Dresden
Fachrichtung Mathematik
01062 Dresden
Telefon +49-351-463 32646
Fax +49-351-463 37114
E-Mail martin.pietsch(a)tu-dresden.de
8 years, 6 months
[libvirt] [PATCH 0/3] Couple of virtestmock fixes
by Michal Privoznik
Behold! This is not a trivial patch set and you will need a lot
of courage to review it. Sorry. I hadn't had a nice time writing
the patches neither.
Michal Privoznik (3):
tests: Drop VIR_MOCK_CALL_STAT
virtestmock: Mock stat() properly
tests: Link virtestmock with probes
cfg.mk | 3 ++
configure.ac | 1 +
tests/Makefile.am | 1 +
tests/vircgroupmock.c | 14 +++----
tests/virmock.h | 23 -----------
tests/virpcimock.c | 19 ++++-----
tests/virtestmock.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++--
7 files changed, 124 insertions(+), 43 deletions(-)
--
2.8.1
8 years, 6 months
[libvirt] [PATCH 0/2] qemu: reject invalid video accel* settings
by Cole Robinson
This series adds a couple checks for invalid video accel* settings,
incase users screw up their XML when trying to enable spice GL
Cole Robinson (2):
qemu: command: Error if accel3d isn't supported for non-virtio
qemu: command: Explicitly error if accel2d specified
src/qemu/qemu_command.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--
2.7.4
8 years, 6 months
[libvirt] [PATCH v4 00/14] improve graphics listen configuration
by Pavel Hrdina
The first 8 patches are cleanups and refactors of the graphics code.
9th patch introduces listen type socket and updates VNC graphics to use that
new listen type.
Patches 10 and 11 implements listen type socket for SPICE graphics and patch 12
adds spice_auto_unix_socket config option into qemu.conf.
The last two patches introduces and implements new listen type none for VNC and
SPICE graphics.
The listen type none and socket are required to enable OpenGL support for SPICE
graphics.
Changes in v4:
- removed the port patch that will be posted later as separate patch series
- reordered some patches and added some more cleanups
Changes in v3:
- add listen type none support for vnc
- fix issues pointed out in v2
Changes in v2:
- don't remove vnc_auto_unix_socket from qemu.conf
- add spice_auto_unix_socket
Pavel Hrdina (14):
qemu_domain: add a empty listen type address if we remove socket for
VNC
tests: cleanup vnc auto socket test
graphics: rename gListen to glisten
domain_conf: introduce virDomainGraphicsAddListenAddr
qemu_command: move sasl parameter after port and addr definition
graphics: resolve address for listen type network in qemu_process
qemu_process: separate graphics socket and address generation
qemu_command: refactor spice channel code
graphics: introduce listen type socket and use it for VNC
qemu_capabilites: add QEMU_CAPS_SPICE_UNIX
spice: add support for listen type socket
spice: introduce spice_auto_unix_socket config option
spice: introduce listen type none
vnc: add support for listen type none
docs/formatdomain.html.in | 28 ++
docs/schemas/domaincommon.rng | 15 +
src/conf/domain_conf.c | 314 ++++++++++++++++-----
src/conf/domain_conf.h | 8 +-
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 16 +-
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 17 +-
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 276 ++++++++----------
src/qemu/qemu_conf.c | 1 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 34 ++-
src/qemu/qemu_hotplug.c | 9 +
src/qemu/qemu_migration.c | 49 +++-
src/qemu/qemu_parse_command.c | 2 +-
src/qemu/qemu_process.c | 130 +++++++--
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/virt-aa-helper.c | 15 +-
src/vbox/vbox_common.c | 10 +-
src/vmx/vmx.c | 8 +-
src/vz/vz_sdk.c | 8 +-
src/xenconfig/xen_common.c | 14 +-
src/xenconfig/xen_sxpr.c | 16 +-
src/xenconfig/xen_xl.c | 8 +-
...ric-graphics-vnc-socket-attr-listen-address.xml | 30 ++
...hics-vnc-socket-attr-listen-socket-mismatch.xml | 30 ++
...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 ++
...ric-graphics-vnc-socket-attr-listen-address.xml | 30 ++
...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 ++
.../generic-graphics-vnc-socket-listen.xml | 4 +-
.../generic-graphics-vnc-socket.xml | 4 +-
tests/genericxml2xmltest.c | 4 +
.../qemuargv2xml-graphics-vnc-socket.xml | 4 +-
...emuxml2argv-graphics-spice-auto-socket-cfg.args | 20 ++
...qemuxml2argv-graphics-spice-auto-socket-cfg.xml | 30 ++
.../qemuxml2argv-graphics-spice-auto-socket.args | 20 ++
.../qemuxml2argv-graphics-spice-auto-socket.xml | 30 ++
.../qemuxml2argv-graphics-spice-sasl.args | 2 +-
.../qemuxml2argv-graphics-spice-socket.args | 20 ++
.../qemuxml2argv-graphics-spice-socket.xml | 30 ++
.../qemuxml2argv-graphics-vnc-auto-socket-cfg.args | 22 ++
.../qemuxml2argv-graphics-vnc-auto-socket-cfg.xml | 34 +++
.../qemuxml2argv-graphics-vnc-auto-socket.args | 20 ++
.../qemuxml2argv-graphics-vnc-auto-socket.xml | 30 ++
.../qemuxml2argv-graphics-vnc-autosocket.args | 22 --
.../qemuxml2argv-graphics-vnc-autosocket.xml | 34 ---
.../qemuxml2argv-graphics-vnc-none.args | 20 ++
.../qemuxml2argv-graphics-vnc-none.xml | 30 ++
...2argv-graphics-vnc-remove-generated-socket.args | 22 ++
...l2argv-graphics-vnc-remove-generated-socket.xml | 34 +++
.../qemuxml2argv-graphics-vnc-socket.args | 4 +-
.../qemuxml2argv-graphics-vnc-socket.xml | 10 +-
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 2 +-
tests/qemuxml2argvtest.c | 18 ++
...muxml2xmlout-graphics-spice-auto-socket-cfg.xml | 35 +++
.../qemuxml2xmlout-graphics-spice-auto-socket.xml | 35 +++
.../qemuxml2xmlout-graphics-spice-socket.xml | 35 +++
...qemuxml2xmlout-graphics-vnc-auto-socket-cfg.xml | 41 +++
.../qemuxml2xmlout-graphics-vnc-auto-socket.xml | 35 +++
.../qemuxml2xmlout-graphics-vnc-autosocket.xml | 39 ---
...graphics-vnc-remove-generated-socket-active.xml | 41 +++
...aphics-vnc-remove-generated-socket-inactive.xml | 41 +++
.../qemuxml2xmlout-graphics-vnc-socket.xml | 35 +++
.../qemuxml2xmlout-video-virtio-gpu-spice-gl.xml | 4 +-
tests/qemuxml2xmltest.c | 20 +-
67 files changed, 1530 insertions(+), 439 deletions(-)
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-address.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket-mismatch.xml
create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-address.xml
create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-auto-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-socket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-autosocket.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-none.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-remove-generated-socket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-auto-socket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-socket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-auto-socket-cfg.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-auto-socket.xml
delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-autosocket.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-remove-generated-socket-active.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-remove-generated-socket-inactive.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-socket.xml
--
2.8.2
8 years, 6 months
[libvirt] [PATCH] cpu: Add support for clflushopt and tsc_adjust Intel features
by Alexander Burluka
Corresponding QEMU commits:
clflushopt f7fda280948a5e74aeb076ef346b991ecb173c56
tsc_adjust 7b458bfd12a71b3da6b531daedc417492c9334e0
Signed-off-by: Alexander Burluka <aburluka(a)virtuozzo.com>
---
src/cpu/cpu_map.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index 0b6d424..08aded2 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -293,6 +293,9 @@
<feature name='fsgsbase'>
<cpuid function='0x00000007' ebx='0x00000001'/>
</feature>
+ <feature name='tsc_adjust'>
+ <cpuid function='0x00000007' ebx='0x00000002'/>
+ </feature>
<feature name='bmi1'>
<cpuid function='0x00000007' ebx='0x00000008'/>
</feature>
@@ -332,6 +335,9 @@
<feature name='smap'>
<cpuid function='0x00000007' ebx='0x00100000'/>
</feature>
+ <feature name='clflushopt'>
+ <cpuid function='0x00000007' ebx='0x00800000'/>
+ </feature>
<feature name='avx512pf'> <!-- AVX-512 Prefetch -->
<cpuid function='0x00000007' ebx='0x04000000'/>
</feature>
--
1.8.3.1
8 years, 6 months