[PATCH 3/3] qemuTestParseCapabilitiesArch: Free @binary

2020-02-20 Thread Michal Privoznik
The variable is allocated, but never freed. ==119642== 29 bytes in 1 blocks are definitely lost in loss record 409 of 671 ==119642==at 0x483579F: malloc (vg_replace_malloc.c:309) ==119642==by 0x5AB075F: __vasprintf_internal (in /lib64/libc-2.29.so) ==119642==by 0x57C1A28: g_vasprintf

[PATCH 2/3] virDomainNetDefClear: Free @persistent name

2020-02-20 Thread Michal Privoznik
The persistent alias name @persistent is allocated in virDomainNetDefParseXML() but never freed. ==119642== 22 bytes in 2 blocks are definitely lost in loss record 178 of 671 ==119642==at 0x483579F: malloc (vg_replace_malloc.c:309) ==119642==by 0x58F89F1: xmlStrndup (in

[PATCH 0/3] Couple of memleak fixes

2020-02-20 Thread Michal Privoznik
*** BLURB HERE *** Michal Prívozník (3): virDomainFSDefFree: Unref private data virDomainNetDefClear: Free @persistent name qemuTestParseCapabilitiesArch: Free @binary src/conf/domain_conf.c | 2 ++ tests/testutilsqemu.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) --

[PATCH 1/3] virDomainFSDefFree: Unref private data

2020-02-20 Thread Michal Privoznik
The privateData object is allocated in virDomainFSDefNew() but never unref'd. ==119642== 480 bytes in 20 blocks are definitely lost in loss record 656 of 671 ==119642==at 0x4837B86: calloc (vg_replace_malloc.c:762) ==119642==by 0x57806A0: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6000.7)

[PATCH v1 2/3] qemumonitorjsontest: add tests for cpu comparison

2020-02-20 Thread Collin Walling
Signed-off-by: Collin Walling --- tests/qemumonitorjsontest.c | 50 + 1 file changed, 50 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index cd7fa1f..5568af5 100644 --- a/tests/qemumonitorjsontest.c +++

[PATCH v1 3/3] qemumonitorjsontest: add test for cpu baseline

2020-02-20 Thread Collin Walling
Signed-off-by: Collin Walling --- tests/qemumonitorjsontest.c | 77 + 1 file changed, 77 insertions(+) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 5568af5..e9f95e3 100644 --- a/tests/qemumonitorjsontest.c +++

[PATCH v1 0/3] qemumonitorjson tests for cpu compare and baseline

2020-02-20 Thread Collin Walling
These patches implement tests for the libvirt qemu_monitor_json API for the hypervisor-cpu-compare and -baseline commands. The input and output data is mocked with arbitrary values. A prerequisite patch is included to load the capabilities schema for a specific architecture. Originally, only the

[PATCH v1 1/3] qemumonitorjsontest: load schema based on specified arch

2020-02-20 Thread Collin Walling
There are some architectures that support capabilities that others do not (e.g. s390x supports cpu comparison and baseline via QEMU). Let's make testQEMUSchemaLoad accept a string to specify the schema to load based on the specified arch. Signed-off-by: Collin Walling --- tests/qemublocktest.c

Re: [libvirt PATCH] m4: libxl: properly fail when libxl is required

2020-02-20 Thread Andrea Bolognani
On Thu, 2020-02-20 at 16:05 +0100, Ján Tomko wrote: > We specify "true" as the fail-action for LIBVIRT_CHECK_PKG. > > This was used when we had a fallback to non-pkg-config detection, > then removed in commit 5bdcef13d13560512c7d6d8c9e8822e456889e0c > later re-introduced in commit

Re: [PATCH] storage: Add support to set{uid,gid} and sticky bit

2020-02-20 Thread Ján Tomko
On Wed, Feb 19, 2020 at 05:51:44PM -0300, Julio Faracco wrote: This commit add more features to storages that supports setuid, setgid and sticky bit. This extend some permission levels of volumes when you run an hypervisor using a specific user that can run but cannot delete volumes for

[libvirt PATCH] m4: libxl: properly fail when libxl is required

2020-02-20 Thread Ján Tomko
We specify "true" as the fail-action for LIBVIRT_CHECK_PKG. This was used when we had a fallback to non-pkg-config detection, then removed in commit 5bdcef13d13560512c7d6d8c9e8822e456889e0c later re-introduced in commit dc3d2c9f8c7678a950abedd227b1587ca62335c4 and then left in when removing the

[libvirt PATCHv4 01/15] docs: reduce excessive spacing in ToC for RST files

2020-02-20 Thread Ján Tomko
From: Daniel P. Berrangé The table of contents in the RST based files uses tags inside the , which results in 1em's worth of spacing above & below each entry. This results in way too much whitespace in the ToC. Signed-off-by: Daniel P. Berrangé Reviewed-by: Ján Tomko --- docs/libvirt.css |

[libvirt PATCHv4 06/15] conf: qemu: add virtiofs fsdriver type

2020-02-20 Thread Ján Tomko
Introduce a new 'virtiofs' driver type for filesystem. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- docs/formatdomain.html.in | 12 ++- docs/schemas/domaincommon.rng | 6 ++ src/conf/domain_conf.c| 1 +

[libvirt PATCHv4 08/15] qemu: add virtiofsd_debug to qemu.conf

2020-02-20 Thread Ján Tomko
Add a 'virtiofsd_debug' option for tuning whether to run virtiofsd in debug mode. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf | 7 +++ src/qemu/qemu_conf.c | 2 ++

[libvirt PATCHv4 09/15] qemu: validate virtiofs filesystems

2020-02-20 Thread Ján Tomko
Reject unsupported configurations. Signed-off-by: Ján Tomko --- src/qemu/qemu_domain.c | 61 +++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c3fc3fed1c..7cb283123d 100644 ---

[libvirt PATCHv4 10/15] qemu: forbid migration with vhost-user-fs device

2020-02-20 Thread Ján Tomko
This is not yet supported. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_migration.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a307c5ebe2..2624a7388c 100644 ---

[libvirt PATCHv4 13/15] qemu: use the vhost-user schemas to find binary

2020-02-20 Thread Ján Tomko
Look into /usr/share/qemu/vhost-user to see whether we can find a suitable virtiofsd binary, in case the user did not provide one in the domain XML. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_extdevice.c | 9 + src/qemu/qemu_vhost_user.c | 40

[libvirt PATCHv4 03/15] qemuExtDevicesStart: pass logManager

2020-02-20 Thread Ján Tomko
Pass logManager to qemuExtDevicesStart for future usage. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_extdevice.c | 1 + src/qemu/qemu_extdevice.h | 1 + src/qemu/qemu_process.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git

[libvirt PATCHv4 15/15] wip: SELinux integration for virtiofsd

2020-02-20 Thread Ján Tomko
This patch attempts to run virtiofsd with libvirtd's label and the category of the currently ran domain, which obviously does nothing without a corresponding policy. Per: https://www.redhat.com/archives/libvir-list/2020-February/msg00108.html a new type might be needed. TODO: file a SELinux

[libvirt PATCHv4 05/15] docs: add virtiofs kbase

2020-02-20 Thread Ján Tomko
Add a document describing the usage of virtiofs. --- docs/kbase.html.in | 3 + docs/kbase/virtiofs.rst | 152 2 files changed, 155 insertions(+) create mode 100644 docs/kbase/virtiofs.rst diff --git a/docs/kbase.html.in b/docs/kbase.html.in index

[libvirt PATCHv4 11/15] qemu: add code for handling virtiofsd

2020-02-20 Thread Ján Tomko
Start virtiofsd for each device using it. Pre-create the socket for communication with QEMU and pass it to virtiofsd. Note that virtiofsd needs to run as root. https://bugzilla.redhat.com/show_bug.cgi?id=1694166 Introduced by QEMU commit a43efa34c7d7b628cbf1ec0fe60043e5c91043ea

[libvirt PATCHv4 14/15] qemu: build vhost-user-fs device command line

2020-02-20 Thread Ján Tomko
Format the 'vhost-user-fs' device on the QEMU command line. This device provides shared file system access using the FUSE protocol carried over virtio. The actual file server is implemented in an external vhost-user-fs device backend process. https://bugzilla.redhat.com/show_bug.cgi?id=1694166

[libvirt PATCHv4 12/15] qemu: put virtiofsd in the emulator cgroup

2020-02-20 Thread Ján Tomko
Wire up the code to put virtiofsd in the emulator cgroup on domain startup. Signed-off-by: Ján Tomko --- src/qemu/qemu_extdevice.c | 15 +++ src/qemu/qemu_virtiofs.c | 28 src/qemu/qemu_virtiofs.h | 6 ++ 3 files changed, 49 insertions(+) diff

[libvirt PATCHv4 07/15] conf: add virtiofs-related elements and attributes

2020-02-20 Thread Ján Tomko
Add more elements for tuning the virtiofsd daemon and the vhost-user-fs device: Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé Reviewed-by: Masayoshi Mizuma --- docs/formatdomain.html.in | 25 +++- docs/schemas/domaincommon.rng

[libvirt PATCHv4 04/15] qemu: add QEMU_CAPS_VHOST_USER_FS

2020-02-20 Thread Ján Tomko
Introduced by QEMU commit 98fc1ada4cf70af0f1df1a2d7183cf786fc7da05 virtio: add vhost-user-fs base device Released in QEMU v4.2.0. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c

[libvirt PATCHv4 00/15] add virtiofs support (virtio-fs epopee)

2020-02-20 Thread Ján Tomko
For: https://bugzilla.redhat.com/show_bug.cgi?id=1694166 v3: https://www.redhat.com/archives/libvir-list/2020-January/msg01401.html v4: * place virtiofsd into the emulator cgroup * do not leak the log file descriptor * better validation of the path existence and shared memory support * run as

[libvirt PATCHv4 02/15] schema: wrap fsDriver in a choice group

2020-02-20 Thread Ján Tomko
Allow adding new groups without changing indentation. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa Acked-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrangé --- docs/schemas/domaincommon.rng | 50 +++ 1 file changed, 27 insertions(+), 23 deletions(-)

Re: [jenkins-ci PATCH 0/8] lcitool: Support MinGW cross-build Dockerfiles

2020-02-20 Thread Andrea Bolognani
On Mon, 2020-02-10 at 18:18 +0100, Andrea Bolognani wrote: > More details in the commit message for patch 7/8. > > Pavel pointed out today that the current method of triggering MinGW > builds using our CI scaffolding, eg. > > $ make ci-build@fedora-30 CI_CONFIGURE=mingw64-configure > > is

Re: [PATCH 0/3] Couple of almost trivial patches

2020-02-20 Thread Ján Tomko
On Thu, Feb 20, 2020 at 12:02:34PM +0100, Michal Privoznik wrote: These stem out from my review of Marc-André's patches: https://www.redhat.com/archives/libvir-list/2020-January/msg00648.html Michal Prívozník (3): virpidfile: Set correct retval in virPidFileReadPath() qemu: Don't explicitly

[PATCH 1/3] virpidfile: Set correct retval in virPidFileReadPath()

2020-02-20 Thread Michal Privoznik
The virPidFileReadPath() function is supposed to return 0 on success or a negative value on failure. But the negative value has a special meaning - it's negated errno. Therefore, when converting string to int we shouldn't return -1 which translates to EPERM. Returning EINVAL looks closer to the

[PATCH 3/3] qemu_migration: Rearrange some checks in qemuMigrationSrcIsAllowed()

2020-02-20 Thread Michal Privoznik
Firstly, the check for disk I/O error can be moved into 'if (!offline)' section a few lines below. Secondly, checks for vmstate and slirp should be moved under the same section because they reflect live state of a domain. For offline migration no QEMU is involved and thus these restrictions are

[PATCH 2/3] qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath()

2020-02-20 Thread Michal Privoznik
In two places where virPidFileForceCleanupPath() is called, we try to unlink() the pidfile again. This is needless because virPidFileForceCleanupPath() has done just that. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c| 9 + src/qemu/qemu_vhost_user_gpu.c | 10

[PATCH 0/3] Couple of almost trivial patches

2020-02-20 Thread Michal Privoznik
These stem out from my review of Marc-André's patches: https://www.redhat.com/archives/libvir-list/2020-January/msg00648.html Michal Prívozník (3): virpidfile: Set correct retval in virPidFileReadPath() qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath()

[ruby PATCH] Fix cpumap allocation for virDomainGetVcpus and use return value

2020-02-20 Thread Charlie Smurthwaite
This patch fixes a bug in which only enough memory for one cpumap is allocated for virDomainGetVcpus instead of one per virtual CPU. This Fixes an overflow. Additionally, it uses the return value of virDomainGetVcpus to determine how many cpuinfo structs were actually populated rather than

Re: [PATCH 7/8] qemu: add dbus-vmstate helper migration support

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Helper processes may have their state migrated with QEMU data stream thanks to the QEMU "dbus-vmstate". libvirt maintains the list of helpers to be migrated. The "dbus-vmstate" is added when required, and given the

Re: [PATCH 3/8] qemu-conf: add dbusStateDir

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Location of DBus daemon state configuration, socket, pid... Signed-off-by: Marc-André Lureau --- src/qemu/qemu_conf.c | 4 src/qemu/qemu_conf.h | 1 + 2 files changed, 5 insertions(+) diff --git

Re: [PATCH 4/8] qemu: add a DBus daemon helper unit

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Add a unit to start & stop a private dbus-daemon. The daemon is meant to be started on demand, and associated with a QEMU process. It should be stopped when the QEMU process is stopped. The current policy is

Re: [PATCH 1/8] qemu: remove dbus-vmstate code

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau This code was based on a per-helper instance and peer-to-peer connections. The code that landed in qemu master for v5.0 is relying on a single instance and DBus bus. Instead of trying to adapt the existing

Re: [PATCH 5/8] domain: save/restore the state of dbus-daemon running

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau This avoids trying to start a dbus-daemon when its already running. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c

Re: [PATCH 6/8] qemu: prepare and stop the dbus daemon

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_process.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4195042194..845a7caa55 100644 ---

Re: [PATCH 8/8] qemu-slirp: register helper for migration

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau When the helper supports DBus, connect it to the bus and set its ID. If the helper supports migration, register its ID to the list of dbus-vmstate ID to migrate, and specify --dbus-incoming when restoring the VM.

Re: [PATCH 2/8] qemu-conf: add configurable dbus-daemon location

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- m4/virt-driver-qemu.m4 | 6 ++ src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf | 3 +++ src/qemu/qemu_conf.c | 5

Re: [libvirt] [PATCH 0/8] Second take on slirp-helper & dbus-vmstate

2020-02-20 Thread Michal Privoznik
On 1/14/20 2:46 PM, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Sorry for late review. I will reply to individual patches with suggested changes. I have them locally as a fixup patches, so I can squash them and resend (keeping your authorship of course). You can also find