[libvirt] [PATCH] tests: skip qemublocktest if building without YAJL
by Daniel P. Berrangé
If no JSON parser is available qemublocktest fails, so skip its execution.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a build fix for platforms without JSON parser installed
tests/qemublocktest.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 0c335abc5b..8e8773e6a8 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -19,17 +19,19 @@
#include <stdlib.h>
#include "testutils.h"
-#include "testutilsqemu.h"
-#include "testutilsqemuschema.h"
-#include "virstoragefile.h"
-#include "virstring.h"
-#include "virlog.h"
-#include "qemu/qemu_block.h"
-#include "qemu/qemu_qapi.h"
-#include "qemu/qemu_command.h"
+#if WITH_YAJL
+# include "testutilsqemu.h"
+# include "testutilsqemuschema.h"
+# include "virstoragefile.h"
+# include "virstring.h"
+# include "virlog.h"
+# include "qemu/qemu_block.h"
+# include "qemu/qemu_qapi.h"
-#define VIR_FROM_THIS VIR_FROM_NONE
+# include "qemu/qemu_command.h"
+
+# define VIR_FROM_THIS VIR_FROM_NONE
VIR_LOG_INIT("tests.storagetest");
@@ -355,7 +357,7 @@ mymain(void)
virTestCounterReset("qemu storage source xml->json->xml ");
-#define TEST_JSON_FORMAT(tpe, xmlstr) \
+# define TEST_JSON_FORMAT(tpe, xmlstr) \
do { \
xmljsonxmldata.type = tpe; \
xmljsonxmldata.xml = xmlstr; \
@@ -364,7 +366,7 @@ mymain(void)
ret = -1; \
} while (0)
-#define TEST_JSON_FORMAT_NET(xmlstr)\
+# define TEST_JSON_FORMAT_NET(xmlstr) \
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_NETWORK, xmlstr)
TEST_JSON_FORMAT(VIR_STORAGE_TYPE_FILE, "<source file='/path/to/file'/>\n");
@@ -417,7 +419,7 @@ mymain(void)
" <host name='example.com' port='9999'/>\n"
"</source>\n");
-#define TEST_DISK_TO_JSON_FULL(nme, fl) \
+# define TEST_DISK_TO_JSON_FULL(nme, fl) \
do { \
diskxmljsondata.name = nme; \
diskxmljsondata.props = NULL; \
@@ -435,7 +437,7 @@ mymain(void)
testQemuDiskXMLToPropsClear(&diskxmljsondata); \
} while (0)
-#define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false)
+# define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false)
if (!(diskxmljsondata.schema = testQEMUSchemaLoad())) {
ret = -1;
@@ -500,4 +502,12 @@ mymain(void)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
+#else
+static int
+mymain(void)
+{
+ return EXIT_AM_SKIP;
+}
+#endif
+
VIR_TEST_MAIN(mymain)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] qemu: clear seccomp capability if TSYNC is not supported by host
by marcandre.lureau@redhat.com
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
With qemu <= 3.0, when using "-seccomp on", the seccomp policy is only
applied to the main thread, the vcpu worker thread and other worker
threads created after seccomp policy is applied; the seccomp policy is
not applied to e.g. the RCU thread because it is created before the
seccomp policy is applied.
Since qemu commit 70dfabeaa79ba4d7a3b699abe1a047c8012db114 "seccomp:
set the seccomp filter to all threads", qemu will require seccomp
TSYNC flag, and will fail to start if the flag isn't available.
Without it, sandboxing is flawed. Disable seccomp capability if the
host is not capable of using seccomp TSYNC.
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
configure.ac | 2 +-
src/qemu/qemu_capabilities.c | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index da940e34df..c206de1cad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -330,7 +330,7 @@ AC_CHECK_FUNCS_ONCE([cfmakeraw fallocate geteuid getgid getgrnam_r \
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \
- sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
+ sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h linux/seccomp.h \
sys/un.h sys/syscall.h sys/sysctl.h netinet/tcp.h ifaddrs.h \
libtasn1.h sys/ucred.h sys/mount.h stdarg.h])
dnl Check whether endian provides handy macros.
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a075677421..dd62246eb4 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -54,6 +54,10 @@
#include <sys/wait.h>
#include <stdarg.h>
#include <sys/utsname.h>
+#if defined(HAVE_LINUX_SECCOMP_H) && defined(HAVE_SYS_SYSCALL_H)
+#include <linux/seccomp.h>
+#include <sys/syscall.h>
+#endif
#define VIR_FROM_THIS VIR_FROM_QEMU
@@ -4615,6 +4619,15 @@ virQEMUCapsLogProbeFailure(const char *binary)
}
+#if defined(HAVE_LINUX_SECCOMP_H) && defined(HAVE_SYS_SYSCALL_H)
+static int
+virSeccomp(unsigned int op, unsigned int flags, void *args)
+{
+ errno = 0;
+ return syscall(__NR_seccomp, op, flags, args);
+}
+#endif
+
virQEMUCapsPtr
virQEMUCapsNewForBinaryInternal(virArch hostArch,
const char *binary,
@@ -4679,6 +4692,20 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch,
goto error;
}
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX)) {
+ bool have_seccomp = false;
+#if defined(HAVE_LINUX_SECCOMP_H) && defined(HAVE_SYS_SYSCALL_H)
+ /* check the TSYNC flag - it returns errno == ENOSYS if unavailable */
+ if (virSeccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, NULL) < 0 &&
+ errno == EFAULT) {
+ have_seccomp = true;
+ }
+#endif
+ if (!have_seccomp) {
+ virQEMUCapsClear(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX);
+ }
+ }
+
cleanup:
VIR_FREE(qmperr);
return qemuCaps;
--
2.19.0.rc0.48.gb9dfa238d5
6 years, 3 months
[libvirt] [jenkins-ci PATCH 0/8] lcitool: Support building arbitrary branches
by Andrea Bolognani
Better (hopefully :) implementation of the feature scrapped
from the initial "build support" series.
Andrea Bolognani (8):
lcitool: Add "-r REVISION" argument for build
Don't use "branch" in paths and job names
jobs: Hardcode "master" branch
guests: Use "git_branch" when building
Drop "branch" variable
Add "git_urls" dictionary to defaults
guests: Use "git_remote" when building
guests: Update documentation
guests/README.markdown | 8 ++++-
guests/lcitool | 36 +++++++++++++------
.../build/jobs/autotools-build-job.yml | 4 +--
.../build/jobs/autotools-check-job.yml | 4 +--
.../build/jobs/autotools-rpm-job.yml | 4 +--
.../build/jobs/autotools-syntax-check-job.yml | 4 +--
guests/playbooks/build/jobs/defaults.yml | 32 ++++++++++++++++-
.../build/jobs/generic-build-job.yml | 4 +--
.../build/jobs/generic-check-job.yml | 4 +--
.../playbooks/build/jobs/generic-rpm-job.yml | 4 +--
.../build/jobs/generic-syntax-check-job.yml | 4 +--
guests/playbooks/build/jobs/go-build-job.yml | 4 +--
guests/playbooks/build/jobs/go-check-job.yml | 4 +--
.../build/jobs/perl-modulebuild-build-job.yml | 4 +--
.../build/jobs/perl-modulebuild-check-job.yml | 4 +--
.../build/jobs/perl-modulebuild-rpm-job.yml | 4 +--
guests/playbooks/build/jobs/prepare.yml | 10 +++---
.../build/jobs/python-distutils-build-job.yml | 4 +--
.../build/jobs/python-distutils-check-job.yml | 4 +--
.../build/jobs/python-distutils-rpm-job.yml | 4 +--
guests/playbooks/build/projects/libosinfo.yml | 2 +-
.../playbooks/build/projects/libvirt-cim.yml | 2 +-
.../playbooks/build/projects/libvirt-dbus.yml | 2 +-
.../playbooks/build/projects/libvirt-glib.yml | 2 +-
.../build/projects/libvirt-go-xml.yml | 2 +-
.../playbooks/build/projects/libvirt-go.yml | 2 +-
.../playbooks/build/projects/libvirt-perl.yml | 2 +-
.../build/projects/libvirt-python.yml | 2 +-
.../build/projects/libvirt-sandbox.yml | 2 +-
.../playbooks/build/projects/libvirt-tck.yml | 2 +-
guests/playbooks/build/projects/libvirt.yml | 2 +-
.../build/projects/osinfo-db-tools.yml | 2 +-
guests/playbooks/build/projects/osinfo-db.yml | 2 +-
.../playbooks/build/projects/virt-manager.yml | 2 +-
.../playbooks/build/projects/virt-viewer.yml | 2 +-
jobs/autotools.yaml | 18 +++++-----
jobs/defaults.yaml | 32 ++++++++++++++++-
jobs/generic.yaml | 18 +++++-----
jobs/go.yaml | 10 +++---
jobs/perl-modulebuild.yaml | 14 ++++----
jobs/python-distutils.yaml | 14 ++++----
projects/libosinfo.yaml | 14 ++++----
projects/libvirt-cim.yaml | 6 ++--
projects/libvirt-dbus.yaml | 10 +++---
projects/libvirt-glib.yaml | 14 ++++----
projects/libvirt-go-xml.yaml | 6 ++--
projects/libvirt-go.yaml | 6 ++--
projects/libvirt-perl.yaml | 8 ++---
projects/libvirt-python.yaml | 8 ++---
projects/libvirt-sandbox.yaml | 10 +++---
projects/libvirt-tck.yaml | 8 ++---
projects/libvirt.yaml | 8 ++---
projects/osinfo-db-tools.yaml | 8 ++---
projects/osinfo-db.yaml | 8 ++---
projects/virt-manager.yaml | 10 +++---
projects/virt-viewer.yaml | 14 ++++----
56 files changed, 253 insertions(+), 171 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] Release of libvirt-4.7.0
by Daniel Veillard
I didn't do this this week-end, that gave time to Andrea to update the release
notes :-) it's now tagged in git and signed tarball and rpms are pushed to the
usual place:
ftp://libvirt.org/libvirt/
I also pushed a release 4.7.0 for the python bindings but they are virtually equivalent
to 4.6.0 ones, you can find them at
ftp://libvirt.org/libvirt/python/
This seems a reasonably large release, many commits, not that many people were in
vacations last month ! The resulting is a balanced release with new features,
improvements, and obviously the usual amount of bug fixes !
New features:
- storage: add storage pool iscsi-direct
Introduce a new storage pool backend that uses libiscsi instead of
iscsiadm. It support basic pool operations: checkPool and refreshPool.
- Add support for MBA (Memory Bandwidth Allocation technology)
Domain vCPU threads can now have allocated some parts of host memory
bandwidth by using the memorytune element in cputune.
- qemu: Add support for RISC-V guests
riscv32 and riscv64 guest architectures are now supported.
Improvements:
- qemu: Add ccw support for vhost-vsock
Support the vhost-vsock-ccw device on S390.
- qemu: Make default machine type independent of QEMU
We can't control whether or not QEMU will change its default machine
type in the future, or whether downstream distributions will decide to
compile out some machine types, so our only option to provide a
predictable behavior is taking care of the default ourselves;
management applications and users are encouraged to explicitly pick a
machine type when creating new guests.
- apparmor: Various improvements
Rules have been added to deal with a number of scenarios that didn't
work correctly.
Bug fixes:
- esx: Truncate CPU model name
Some CPU model names are too long to be stored into the corresponding
property, and should be explicitly truncated to avoid unexpected
behavior in users of the virNodeGetInfo() API such as virsh nodeinfo.
- utils: Remove arbitrary limit on socket_id/core_id
Both values were assumed to be smaller than 4096, but in fact they are
entirely hardware-dependent and there have been reports of machines
presenting much bigger values, preventing libvirt from working
correctly; all such limits have now been removed.
Thanks everybody for your help with this release be it with code, bug reports,
patch reviews, documentation, ...
Enjoy !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
6 years, 3 months
[libvirt] [jenkins-ci PATCH 1/2] guests: enable {media, tree}uris tests for libosinfo
by Fabiano Fidêncio
Both media and tree uris tests are only run when LIBOSINFO_NETWORK_TESTS
is set.
Let's have those enabled in order to early catch URL changes in
osinfo-db.
Signed-off-by: Fabiano Fidêncio <fidencio(a)redhat.com>
---
guests/playbooks/build/projects/libosinfo.yml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/guests/playbooks/build/projects/libosinfo.yml b/guests/playbooks/build/projects/libosinfo.yml
index c29053b..3c941d2 100644
--- a/guests/playbooks/build/projects/libosinfo.yml
+++ b/guests/playbooks/build/projects/libosinfo.yml
@@ -9,6 +9,11 @@
- include: '{{ playbook_base }}/jobs/autotools-build-job.yml'
- include: '{{ playbook_base }}/jobs/autotools-syntax-check-job.yml'
- include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
+ vars:
+ local_env: |
+ # export LIBOSINFO_NETWORK_TESTS in order to run both
+ # mediauris and treeuris tests
+ export LIBOSINFO_NETWORK_TESTS=1
- include: '{{ playbook_base }}/jobs/autotools-rpm-job.yml'
vars:
machines: '{{ rpm_machines }}'
--
2.17.1
6 years, 3 months
[libvirt] [PATCH 0/6] conf: Move a bunch of stuff to device_conf
by Andrea Bolognani
These are the times where I wish we were using a language
with support for proper classes and modules like, I dunno,
PHP or something.
Andrea Bolognani (6):
conf: Move virDomainDeviceAddressType to device_conf
conf: Move virDomainDeviceAddressIsValid() to device_conf
conf: Change return type of *AddressIsValid() to bool
conf: Move virDomainPCIAddressAsString() to device_conf
conf: Rename virDomainPCIAddressAsString()
conf: Move *AddressParseXML() to device_conf
src/conf/device_conf.c | 348 ++++++++++++++++++++++++++++++++-
src/conf/device_conf.h | 31 ++-
src/conf/domain_addr.c | 20 +-
src/conf/domain_addr.h | 3 -
src/conf/domain_conf.c | 320 ------------------------------
src/conf/domain_conf.h | 3 -
src/libvirt_private.syms | 13 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain_address.c | 6 +-
9 files changed, 386 insertions(+), 360 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] qemu: Don't overwrite stats in qemuDomainBlocksStatsGather
by Peter Krempa
The size/capacity stats gathered in qemuDomainBlocksStatsGather when
using -blockdev would be overwritten by assigning/copying the transfered
data statistics at the end. Fix it by moving the assignment prior to
fetching the capacity data.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a0f7c71675..07ea5473b6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11114,6 +11114,8 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
goto cleanup;
}
+ **retstats = *stats;
+
if (blockdev) {
/* capacity are reported only per node-name so we need to transfer them */
qemuBlockStatsPtr capstats;
@@ -11127,8 +11129,6 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver,
(*retstats)->write_threshold = capstats->write_threshold;
}
}
-
- **retstats = *stats;
} else {
for (i = 0; i < vm->def->ndisks; i++) {
disk = vm->def->disks[i];
--
2.16.2
6 years, 3 months
[libvirt] [PATCH] news: Update for 4.7.0 release
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/news.xml | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 2b6d08dc02..3233796f32 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -71,8 +71,51 @@
Support the vhost-vsock-ccw device on S390.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Make default machine type independent of QEMU
+ </summary>
+ <description>
+ We can't control whether or not QEMU will change its default
+ machine type in the future, or whether downstream distributions
+ will decide to compile out some machine types, so our only option
+ to provide a predictable behavior is taking care of the default
+ ourselves; management applications and users are encouraged to
+ explicitly pick a machine type when creating new guests.
+ </description>
+ </change>
+ <change>
+ <summary>
+ apparmor: Various improvements
+ </summary>
+ <description>
+ Rules have been added to deal with a number of scenarios that
+ didn't work correctly.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ esx: Truncate CPU model name
+ </summary>
+ <description>
+ Some CPU model names are too long to be stored into the
+ corresponding property, and should be explicitly truncated to
+ avoid unexpected behavior.
+ </description>
+ </change>
+ <change>
+ <summary>
+ utils: Remove arbitrary limit on socket_id/core_id
+ </summary>
+ <description>
+ Both values were assumed to be smaller than 4096, but in fact
+ they are entirely hardware-dependent and there have been reports
+ of machines presenting much bigger values, preventing libvirt from
+ working correctly; all such limits have now been removed.
+ </description>
+ </change>
</section>
</release>
<release version="v4.6.0" date="2018-08-06">
--
2.17.1
6 years, 3 months
[libvirt] Terminal input “udevadm trigger” command,then produce “nl_recv returned with error:No buffer space available”
by xiajidong@cmss.chinamobile.com
Dear libvirt experts,
I have add some patch as follow.this two patch add buffer size to avoid to
produce “nl_recv returned with error:No buffer space available”
1. libvirt-nodedev-Increase-the-netlink-socket-buffer-size-to-t.patch
2. libvirt-util-increase-libnl-buffer-size.patch
but as I set some configuration in /etc/libvirt/libvitd.conf as follows
# Logging level: 4 errors, 3 warnings, 2 information, 1 debug
log_level =2
# Multiple outputs can be defined, they just need to be separated by spaces.
# e.g. to log all warnings and errors to syslog under the libvirtd ident:
log_outputs="2:syslog:libvirtd"
when I input “udevadm trigger” command
[root@localhost ~]# vi /etc/libvirt/libvirtd.conf
[root@localhost ~]# systemctl restart libvirtd
[root@localhost ~]# udevadm trigger
[root@localhost ~]# udevadm trigger
[root@localhost ~]# udevadm trigger
[root@localhost ~]#
then will produce “nl_recv returned with error:No buffer space available”
[root@localhost ~]# tail -f /var/log/messages | grep buffer
Sep 2 22:44:00 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
Sep 2 23:11:33 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
Sep 2 23:11:45 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
So my question is:
When input “udevadm trigger” in terminal, if setting log_level and
log_outputs="2:syslog:libvirtd",how to avoid to produce “error
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available” log information?
I am looking forward to your reply.
_____
Best Regards,
Jidong Xia
China Mobile (Suzhou) Software Technology Company.cloud computing product
department
Tel: (+86) 18896726087
E-Mail:xiajidong(a)cmss.chinamobile.com
<mailto:xiajidong@cmss.chinamobile.com>
6 years, 3 months