[libvirt] [PATCH] cgroup: cleanup eventParams when virTypedParamsAddULLong failed

2019-09-19 Thread Xu Yandong
Function virTypedParamsAddULLong use realloc to gain memory, and doesn't free it when failed. so we need free eventParams to prevent a memory leak. Signed-off-by: Xu Yandong --- src/qemu/qemu_cgroup.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_cgroup.c

[libvirt] [PATCH] remote: fix a memory free error

2019-09-19 Thread Xu Yandong
In function remoteDeserializeDomainDiskErrors, there is a typo. Signed-off-by: Xu Yandong --- src/remote/remote_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 8789c5da00..877250d40c 100644 ---

[libvirt] [PATCH] qemu: add pointer check in qemuMonitorLastError

2019-09-19 Thread Xu Yandong
We found a exception when libvirt occurrs segmentation fault. thread 1 is waiting object lock in qemuConnectMonitor, qemu process exits and sends EOF event as well, so thread 2 invokes qemuMonitorLastError but pointer mon is NULL. Signed-off-by: Xu Yandong --- src/qemu/qemu_monitor.c | 2 +- 1

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Pavel Hrdina
On Thu, Sep 19, 2019 at 12:05:23AM +0200, Fabiano Fidêncio wrote: > On Wed, Sep 18, 2019 at 9:57 PM Ján Tomko wrote: > > > > On Wed, Sep 18, 2019 at 05:40:06PM +0200, Fabiano Fidêncio wrote: > > >On Wed, Sep 18, 2019 at 1:22 AM Fabiano Fidêncio > > >wrote: > > >> > > >> On Tue, Sep 17, 2019 at

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Daniel P . Berrangé
On Thu, Sep 19, 2019 at 10:20:04AM +0200, Pavel Hrdina wrote: > On Thu, Sep 19, 2019 at 12:05:23AM +0200, Fabiano Fidêncio wrote: > > On Wed, Sep 18, 2019 at 9:57 PM Ján Tomko wrote: > > > > > > On Wed, Sep 18, 2019 at 05:40:06PM +0200, Fabiano Fidêncio wrote: > > > >On Wed, Sep 18, 2019 at 1:22

[libvirt] [PATCH] qemu: clear vcpupin when unhotplug vcpu

2019-09-19 Thread Xu Yandong
step1: hotplug vcpus step2: pin vcpus step3: unhotplug vcpus As a result, vcpu pin info still show up in xml. So we need clear it. Signed-off-by: Xu Yandong --- src/qemu/qemu_hotplug.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c

[libvirt] [PATCH] qemu_conf: clear domain before VIR_DELETE_ELEMENT

2019-09-19 Thread Xu Yandong
The macro VIR_DELETE_ELEMENT assume that the items being deleted have already been cleared, so we must explicitly delete domain memory to prevent a memory leak. Signed-off-by: Xu Yandong --- src/qemu/qemu_conf.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH] qemu: fix potential memory leak

2019-09-19 Thread Xu Yandong
function virTypedParamsAddString may return -1 but alloc params, so invoker should free it. Signed-off-by: Xu Yandong --- src/qemu/qemu_driver.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1e041a8bac..62ce7270ca 100644

[libvirt] [PATCH] conf: fix memory leak in virNodeDevPCICapSRIOVVirtualParseXML

2019-09-19 Thread Xu Yandong
In function virNodeDevPCICapSRIOVVirtualParseXML, temp variable addr could leak if VIR_APPEND_ELEMENT fails . Signed-off-by: Xu Yandong --- src/conf/node_device_conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conf/node_device_conf.c

[libvirt] [PATCH] qemu: fix Validate scsi disk against domain def on coldplug

2019-09-19 Thread Xu Yandong
Check the disk scsi address only when the disk is scsi type. Signed-off-by: Xu Yandong --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 62ce7270ca..ff2173da5e 100644 ---

[libvirt] [PATCH] event: reference state only when virEventAddTimeout success

2019-09-19 Thread Xu Yandong
Reference state is not necessary when virEventAddTimeout failed, this may cause a memory leak, so reference state only when virEventAddTimeout success. Signed-off-by: Xu Yandong --- src/conf/object_event.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff

[libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev

2019-09-19 Thread Xu Yandong
In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree free data structure avoid potential memory leak. Signed-off-by: Xu Yandong --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c

Re: [libvirt] [jenkins-ci PATCH] jenkins: Remove meson-syntax-check job

2019-09-19 Thread Pavel Hrdina
On Wed, Sep 18, 2019 at 06:19:54PM +0200, Fabiano Fidêncio wrote: > It's been agreed that the projects using libvirt-jenkins-ci would have > the `syntax-check` running as part of their test suite. Therefore, > there's no reason for keeping a job which is not going to be used. > > Signed-off-by:

Re: [libvirt] [PATCH] qemu: clear vcpupin when unhotplug vcpu

2019-09-19 Thread Peter Krempa
On Thu, Sep 19, 2019 at 04:01:54 -0400, Xu Yandong wrote: > step1: hotplug vcpus > step2: pin vcpus > step3: unhotplug vcpus > As a result, vcpu pin info still show up in xml. > So we need clear it. > > Signed-off-by: Xu Yandong > --- The idea is that you can pre-configure the vcpu pinning info

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Andrea Bolognani
On Thu, 2019-09-19 at 09:36 +0100, Daniel P. Berrangé wrote: > On Thu, Sep 19, 2019 at 10:20:04AM +0200, Pavel Hrdina wrote: > > Another argument from my side was that we require syntax-check and check > > to be executed before posting patches to mailing list, having it under > > single target

[libvirt] [PATCH] gnulib: remove uneccessary func module

2019-09-19 Thread Daniel P . Berrangé
The gnulib 'func' modules provides portability to compilers which lack the '__func__' symbol. We only care about GCC and CLang compilers so do not need this compatibility code. Signed-off-by: Daniel P. Berrangé --- bootstrap.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/bootstrap.conf

[libvirt] [PATCH] gnulib: remove unused secure_getenv function replacement

2019-09-19 Thread Daniel P . Berrangé
We removed use of the secure_getenv recently in commit 2b0d597670fb5504b7ad1411c31b8af1d3016c1b Author: Daniel P. Berrangé Date: Thu Aug 1 13:35:56 2019 +0100 util: get rid of virGetEnv{Allow,Block}SUID functions Signed-off-by: Daniel P. Berrangé --- bootstrap.conf | 1 - 1 file

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Andrea Bolognani
On Wed, 2019-09-18 at 17:46 +0100, Daniel P. Berrangé wrote: > On Wed, Sep 18, 2019 at 02:55:53PM +0200, Andrea Bolognani wrote: > > So, to be clear, you're advocating for keeping our list of target > > platforms unchanged and exempt Meson specifically from the implicit > > requirement we've had

Re: [libvirt] [PATCH] cgroup: cleanup eventParams when virTypedParamsAddULLong failed

2019-09-19 Thread Michal Privoznik
On 9/19/19 10:02 AM, Xu Yandong wrote: Function virTypedParamsAddULLong use realloc to gain memory, and doesn't free it when failed. so we need free eventParams to prevent a memory leak. Signed-off-by: Xu Yandong --- src/qemu/qemu_cgroup.c | 5 - 1 file changed, 4 insertions(+), 1

Re: [libvirt] [PATCH] remote: fix a memory free error

2019-09-19 Thread Ján Tomko
On Thu, Sep 19, 2019 at 04:00:56AM -0400, Xu Yandong wrote: In function remoteDeserializeDomainDiskErrors, there is a typo. Signed-off-by: Xu Yandong --- src/remote/remote_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko and pushed Jano signature.asc

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Daniel P . Berrangé
On Thu, Sep 19, 2019 at 12:09:23PM +0200, Ján Tomko wrote: > On Thu, Sep 19, 2019 at 09:36:35AM +0100, Daniel P. Berrangé wrote: > > On Thu, Sep 19, 2019 at 10:20:04AM +0200, Pavel Hrdina wrote: > > > On Thu, Sep 19, 2019 at 12:05:23AM +0200, Fabiano Fidêncio wrote: > > > > On Wed, Sep 18, 2019 at

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Andrea Bolognani
On Thu, 2019-09-19 at 14:21 +0100, Daniel P. Berrangé wrote: > On Thu, Sep 19, 2019 at 02:45:53PM +0200, Andrea Bolognani wrote: > > On Thu, 2019-09-19 at 09:36 +0100, Daniel P. Berrangé wrote: > > Jumping in a bit late, but why do we care about this distinction in > > CI at all? In our existing

Re: [libvirt] [PATCH] qemu: fix potential memory leak

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:00 AM, Xu Yandong wrote: function virTypedParamsAddString may return -1 but alloc params, so invoker should free it. Signed-off-by: Xu Yandong --- src/qemu/qemu_driver.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_driver.c

Re: [libvirt] [PATCH] qemu: add pointer check in qemuMonitorLastError

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:01 AM, Xu Yandong wrote: We found a exception when libvirt occurrs segmentation fault. thread 1 is waiting object lock in qemuConnectMonitor, qemu process exits and sends EOF event as well, so thread 2 invokes qemuMonitorLastError but pointer mon is NULL. Signed-off-by: Xu

[libvirt] [PATCH 0/2] libvirt-rust: Fixing bugs in Stream::{send, recv}

2019-09-19 Thread Linus Färnstrand
Hi, Fixing memory soundness bugs in Stream::recv, and other bugs in both Stream::recv and Stream::send. The method Stream::recv takes a size argument that it passes on as the nbytes argument to virStreamRecv. The problem is that the corresponding data pointer points to a local stack allocated

[libvirt] [PATCH 2/2] libvirt-rust Fix Stream::send

2019-09-19 Thread Linus Färnstrand
* Handle the -2 error case * Allow sending arbitrary byte array, not just UTF-8 strings * Fix FFI declaration, takes size_t, not c_uint * Return usize to be more idiomatic (type used for slice indexing) Signed-off-by: Linus Färnstrand --- src/stream.rs | 21 ++--- 1 file

Re: [libvirt] [PATCH] remote: fix a memory free error

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:00 AM, Xu Yandong wrote: In function remoteDeserializeDomainDiskErrors, there is a typo. Signed-off-by: Xu Yandong --- Reviewed-by: Daniel Henrique Barboza src/remote/remote_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [libvirt] [PATCH] event: reference state only when virEventAddTimeout success

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:02 AM, Xu Yandong wrote: Reference state is not necessary when virEventAddTimeout failed, this may cause a memory leak, so reference state only when virEventAddTimeout success. Signed-off-by: Xu Yandong --- Reviewed-by: Daniel Henrique Barboza src/conf/object_event.c |

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Daniel P . Berrangé
On Thu, Sep 19, 2019 at 02:45:53PM +0200, Andrea Bolognani wrote: > On Thu, 2019-09-19 at 09:36 +0100, Daniel P. Berrangé wrote: > > On Thu, Sep 19, 2019 at 10:20:04AM +0200, Pavel Hrdina wrote: > > > Another argument from my side was that we require syntax-check and check > > > to be executed

Re: [libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:01 AM, Xu Yandong wrote: In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree free data structure avoid potential memory leak. Signed-off-by: Xu Yandong --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [libvirt] [PATCH] conf: fix memory leak in virNodeDevPCICapSRIOVVirtualParseXML

2019-09-19 Thread Ján Tomko
On Thu, Sep 19, 2019 at 04:01:31AM -0400, Xu Yandong wrote: In function virNodeDevPCICapSRIOVVirtualParseXML, temp variable addr could leak if VIR_APPEND_ELEMENT fails . Signed-off-by: Xu Yandong --- src/conf/node_device_conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) A nicer

Re: [libvirt] [dbus PATCH] build: convert to Meson/Ninja build system

2019-09-19 Thread Ján Tomko
On Thu, Sep 19, 2019 at 09:36:35AM +0100, Daniel P. Berrangé wrote: On Thu, Sep 19, 2019 at 10:20:04AM +0200, Pavel Hrdina wrote: On Thu, Sep 19, 2019 at 12:05:23AM +0200, Fabiano Fidêncio wrote: > On Wed, Sep 18, 2019 at 9:57 PM Ján Tomko wrote: > > > > On Wed, Sep 18, 2019 at 05:40:06PM

[libvirt] [PATCH 1/2] libvirt-rust: Fix bugs in Stream::recv

2019-09-19 Thread Linus Färnstrand
* pass same size to virStreamRecv as the buffer has allocated * Handle -2 error case * Fix FFI declaration to take size_t instead of c_uint * Allow user to pass in buffer. To allow user to decide where to allocate it. And to be able to re-use the same buffer * Don't try to treat binary data as a

Re: [libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:01 AM, Xu Yandong wrote: In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree free data structure avoid potential memory leak. Signed-off-by: Xu Yandong --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [libvirt] [PATCH] conf: fix memory leak in virNodeDevPCICapSRIOVVirtualParseXML

2019-09-19 Thread Daniel Henrique Barboza
On 9/19/19 5:01 AM, Xu Yandong wrote: In function virNodeDevPCICapSRIOVVirtualParseXML, temp variable addr could leak if VIR_APPEND_ELEMENT fails . Signed-off-by: Xu Yandong --- Reviewed-by: Daniel Henrique Barboza src/conf/node_device_conf.c | 4 +++- 1 file changed, 3

[libvirt] [PATCH 7/8] qemu: monitor: Don't handle HMP in qemuMonitorJSONArbitraryCommand

2019-09-19 Thread Peter Krempa
Call to qemuMonitorJSONHumanCommand directly from qemuMonitorArbitraryCommand. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 5 - src/qemu/qemu_monitor_json.c | 19 +++ src/qemu/qemu_monitor_json.h | 3 +-- 3 files changed, 12 insertions(+), 15

[libvirt] [PATCH 4/8] qemu: monitor: Don't escape HMP commands just to unescape them right away

2019-09-19 Thread Peter Krempa
Historically HMP commands needed to be escaped to work properly. The backdoor for calling HMP commands via QMP must unescape them so that arguments aren't messed up. Since we now only support the QMP passthrough the escape->unescape dance is pointless. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 8/8] qemu: monitor: Remove qemuMonitorHMPCommand in favor of qemuMonitorJSONHumanCommand

2019-09-19 Thread Peter Krempa
Use the function directly rather than having a wrapper. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 11 --- src/qemu/qemu_monitor.h | 3 --- src/qemu/qemu_monitor_text.c | 11 ++- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git

[libvirt] [PATCH 5/8] qemu: monitor: Remove HMP command (un)escaping infrastructure

2019-09-19 Thread Peter Krempa
We don't need to escape the commands any more since we use QMP passthrough, which means we can delete the functions. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 93 src/qemu/qemu_monitor.h | 3 -- tests/qemumonitortestutils.c | 6

[libvirt] [PATCH 6/8] qemu: monitor: Don't include text monitor in json monitor

2019-09-19 Thread Peter Krempa
It was necessary for fallback functions but last one was deleted in d828b744acae967c79513631425c685faf356be0. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index

Re: [libvirt] [PATCH 0/8] qemu: monitor: Clean up some more HMP cruft

2019-09-19 Thread Jiri Denemark
On Thu, Sep 19, 2019 at 18:10:15 +0200, Peter Krempa wrote: > There was quite a bit of legacy HMP cruft. We can remove it as we use > HMP commands via QMP. > > Peter Krempa (8): > qemu: monitor: Remove legacy monitor commands for FD manipulation > qemu: monitor: Remove qemuMonitorHMPCommand

[libvirt] [PATCH 01/22] util: typedparam: Split out public APIs into a separate file

2019-09-19 Thread Peter Krempa
Some of the typed parameter APIs are exported publically, but the implementation was intermixed with private functions. Introduce virtypedparam-public.c, move all public API functions there and purge the comments stating that some functions are public. This will decrease the likelyhood of messing

[libvirt] [PATCH 12/22] qemu: monitor: Refactor cleanup in qemuMonitorJSONGetAllBlockStatsInfo

2019-09-19 Thread Peter Krempa
Use VIR_AUTOPTR and get rid of the cleanup label. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 8d0ef62c8b..9be122a465 100644 ---

[libvirt] [PATCH 05/22] docs: apibuild: Purge irrelevant typed parameter APIs from ignore

2019-09-19 Thread Peter Krempa
The internal helpers are not considered any more so we don't have to ignore them either. Signed-off-by: Peter Krempa --- docs/apibuild.py | 5 - 1 file changed, 5 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 92886e1276..b59050f5ce 100755 --- a/docs/apibuild.py +++

[libvirt] [PATCH 03/22] util: typedparam: Move and unexport virTypedParameterAssignFromStr

2019-09-19 Thread Peter Krempa
The function is only used as a helper in virTypedParamsAddFromString. Make it static and move it to virtypedparam-public.c. Signed-off-by: Peter Krempa --- src/libvirt_private.syms| 1 - src/util/virtypedparam-public.c | 95 + src/util/virtypedparam.c

[libvirt] [PATCH 00/22] qemu: Clean up typed parameter handling in bulk stats

2019-09-19 Thread Peter Krempa
While investigating whether block bulk stats work properly with blockdev I got irritated by macros hiding gotos. Refactor the stats tracking by introducing few new typed parameter handlers. Peter Krempa (22): util: typedparam: Split out public APIs into a separate file util: typedparam:

[libvirt] [PATCH 02/22] util: typedparam: Purge public bits from virTypedParamsGetStringList

2019-09-19 Thread Peter Krempa
The function is not exported in the public API thus the error dispatching is not required. Signed-off-by: Peter Krempa --- src/util/virtypedparam.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index 7abf0257ce..acf8c39602 100644 ---

Re: [libvirt] [PATCH v2 0/3] unplug timeout changes for PPC64

2019-09-19 Thread Daniel Henrique Barboza
Ping On 9/11/19 6:05 PM, Daniel Henrique Barboza wrote: This is a redesign of the previous patch series [1]. After the reviews of the first version, I ended up discarding the idea of a qemu user configuration for the unplug timeout value. Instead, this patch series now handles the problematic

[libvirt] [glib PATCH] gconfig-domain-video: Add bochs video device

2019-09-19 Thread Fabiano Fidêncio
https://bugzilla.redhat.com/show_bug.cgi?id=1753670 Signed-off-by: Fabiano Fidêncio --- libvirt-gconfig/libvirt-gconfig-domain-video.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-video.h

[libvirt] [PATCH 13/22] qemu: monitor: Change fields in qemuBlockStats to 'unsigned'

2019-09-19 Thread Peter Krempa
None of the fields actually return negative values. The internal implementation of BlockAcctStats struct in qemu uses uint64_t and the last place using -1 in libvirt was in the HMP monitor code which was deleted. Change the internal type to unsigned long long and ensure that all public

[libvirt] [PATCH 17/22] qemu: Use virTypedParamList in the bulk stats gathering functions

2019-09-19 Thread Peter Krempa
The bulk stats functions are specific as they pass around the list into many sub-functions and also a substantial amount of the entries uses formatted names for indexing purposes. This makes them ideal to be converted to the new virTypedParamList helpers. Unfortunately given how the functions are

[libvirt] [PATCH 16/22] qemu: driver: Remove QEMU_ADD_BLOCK_PARAM_LL macro

2019-09-19 Thread Peter Krempa
Use QEMU_ADD_BLOCK_PARAM_ULL instead since all parameters are now unsigned. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 32 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 04/22] util: typedparam: Remove pointless cleanup label from virTypedParameterAssignFromStr

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virtypedparam-public.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/util/virtypedparam-public.c b/src/util/virtypedparam-public.c index fb7f178c6c..eaa9f433e7 100644 ---

[libvirt] [PATCH 08/22] util: typedparam: Simplify handling of lists of typed parameters

2019-09-19 Thread Peter Krempa
Introduce a new set of helpers including a new data structure which simplifies keeping and construction of lists of typed parameters. The use of VIR_RESIZE_N in the virTypedParamsAdd API has performance benefits but requires passing around 3 arguments. Use of them lead to a set of macros with

[libvirt] [PATCH 11/22] qemu: monitor: Refactor cleanup in qemuMonitorJSONGetOneBlockStatsInfo

2019-09-19 Thread Peter Krempa
Use VIR_AUTOFREE and get rid of the cleanup label. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index

[libvirt] [PATCH 06/22] util: typedparam: Separate code to assign value to typed parameter

2019-09-19 Thread Peter Krempa
The code will be reused in other function. Signed-off-by: Peter Krempa --- src/util/virtypedparam.c | 55 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index d9f8203796..9f86166707

[libvirt] [PATCH 07/22] util: typedparam: Optionally copy strings passed to virTypedParameterAssignValue

2019-09-19 Thread Peter Krempa
Some code paths pass in already pointers to strings which should be added directly as the value of the typed parameter. To allow more universal use of virTypedParameterAssignValue add a flag which allows to copy the value in place. Signed-off-by: Peter Krempa --- src/util/virtypedparam.c | 13

[libvirt] [PATCH 09/22] qemu: Remove stale comment for qemuDomainBlockStats

2019-09-19 Thread Peter Krempa
We no longer use HMP for this API. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 4 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1e041a8bac..9315b78c48 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@

[libvirt] [PATCH 18/22] qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in qemuDomainGetStatsOneBlockFallback

2019-09-19 Thread Peter Krempa
The open-coded version does not take much more space and additionally we get rid of the hidden goto. This also requires us to remove the 'cleanup' section. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 30 -- 1 file changed, 16 insertions(+), 14

[libvirt] [PATCH 10/22] qemu: monitor: Refactor cleanup in qemuMonitorJSONBlockStatsCollectData

2019-09-19 Thread Peter Krempa
Use VIR_AUTOFREE and get rid of the cleanup label. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e4404f0199..ccf9290838 100644

[libvirt] [PATCH 14/22] qemu: driver: Remove pointless macro QEMU_BLOCK_STAT_TOTAL

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ab41e51700..2814d6825a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@

[libvirt] [PATCH 15/22] qemu: driver: Don't return anything from qemuDomainBlockStatsGatherTotals

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2814d6825a..98ada96fe7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11411,7 +11411,7 @@

[libvirt] [PATCH 20/22] qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in qemuDomainGetStatsBlockExportBackendStorage

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 703f07a388..2163d14cea 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@

[libvirt] [PATCH 22/22] qemu: driver: Remove unused cleanup labels in stats gathering functions

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f0f08dcbfc..319f2d9476 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@

[libvirt] [PATCH 19/22] qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in qemuDomainGetStatsOneBlock

2019-09-19 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b703436744..703f07a388 100644 --- a/src/qemu/qemu_driver.c +++

[libvirt] [PATCH 21/22] qemu: driver: Stop using QEMU_ADD_BLOCK_PARAM_ULL in qemuDomainGetStatsBlockExportFrontend

2019-09-19 Thread Peter Krempa
The macro now became unused so it was deleted. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2163d14cea..f0f08dcbfc 100644

Re: [libvirt] [PATCH] qemu: fix Validate scsi disk against domain def on coldplug

2019-09-19 Thread Michal Privoznik
On 9/19/19 10:02 AM, Xu Yandong wrote: Check the disk scsi address only when the disk is scsi type. Signed-off-by: Xu Yandong --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

Re: [libvirt] [PATCH] qemu_conf: clear domain before VIR_DELETE_ELEMENT

2019-09-19 Thread Michal Privoznik
On 9/19/19 10:02 AM, Xu Yandong wrote: The macro VIR_DELETE_ELEMENT assume that the items being deleted have already been cleared, so we must explicitly delete domain memory to prevent a memory leak. Signed-off-by: Xu Yandong --- src/qemu/qemu_conf.c | 6 -- 1 file changed, 4

Re: [libvirt] [PATCH] event: reference state only when virEventAddTimeout success

2019-09-19 Thread Michal Privoznik
On 9/19/19 10:02 AM, Xu Yandong wrote: Reference state is not necessary when virEventAddTimeout failed, this may cause a memory leak, so reference state only when virEventAddTimeout success. Signed-off-by: Xu Yandong --- src/conf/object_event.c | 25 + 1 file

Re: [libvirt] [PATCH] gnulib: remove uneccessary func module

2019-09-19 Thread Michal Privoznik
On 9/19/19 3:38 PM, Daniel P. Berrangé wrote: The gnulib 'func' modules provides portability to compilers which lack the '__func__' symbol. We only care about GCC and CLang compilers so do not need this compatibility code. Signed-off-by: Daniel P. Berrangé --- bootstrap.conf | 1 - 1 file

Re: [libvirt] [PATCH] gnulib: remove unused secure_getenv function replacement

2019-09-19 Thread Michal Privoznik
On 9/19/19 3:37 PM, Daniel P. Berrangé wrote: We removed use of the secure_getenv recently in commit 2b0d597670fb5504b7ad1411c31b8af1d3016c1b Author: Daniel P. Berrangé Date: Thu Aug 1 13:35:56 2019 +0100 util: get rid of virGetEnv{Allow,Block}SUID functions Signed-off-by:

Re: [libvirt] [PATCH] conf: use virDomainDeviceDefFree free dev

2019-09-19 Thread Peter Krempa
On Thu, Sep 19, 2019 at 10:33:53 -0300, Daniel Henrique Barboza wrote: > > > On 9/19/19 5:01 AM, Xu Yandong wrote: > > In function virDomainDeviceDefParse, we shoud use virDomainDeviceDefFree > > free data structure avoid potential memory leak. > > > > Signed-off-by: Xu Yandong > > --- > >

[libvirt] [PATCH 2/8] qemu: monitor: Remove qemuMonitorHMPCommand macro

2019-09-19 Thread Peter Krempa
qemuMonitorHMPCommandWithFd is only called via qemuMonitorHMPCommand macro, so we can remove the macro and the extra unused cruft from the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 9 - src/qemu/qemu_monitor.h | 9 +++-- 2 files changed, 7 insertions(+), 11

[libvirt] [PATCH 0/8] qemu: monitor: Clean up some more HMP cruft

2019-09-19 Thread Peter Krempa
There was quite a bit of legacy HMP cruft. We can remove it as we use HMP commands via QMP. Peter Krempa (8): qemu: monitor: Remove legacy monitor commands for FD manipulation qemu: monitor: Remove qemuMonitorHMPCommand macro qemu: monitor: Remove support for HMP commands with fds qemu:

[libvirt] [PATCH 1/8] qemu: monitor: Remove legacy monitor commands for FD manipulation

2019-09-19 Thread Peter Krempa
The handlers for 'add-fd' and 'remove-fd' are unused now and riddled with legacy cruft. Purge them. Last use was removed in f2019083de3430101b94d4991a38fd947a08fd32. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 53 - src/qemu/qemu_monitor.h | 4

[libvirt] [PATCH 3/8] qemu: monitor: Remove support for HMP commands with fds

2019-09-19 Thread Peter Krempa
The remaining HMP commands don't require fd passing so we can purge filedescriptor passing support from qemuMonitorJSONHumanCommandWitFd and rename it. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor_json.c | 11 +--

[libvirt] [PATCH v5 09/15] qemu_driver: hook up query-cpu-model-baseline

2019-09-19 Thread Collin Walling
This command is hooked into the virsh hypervisor-cpu-baseline command. The CPU models provided in the XML sent to the command will be baselined via the query-cpu-model-baseline QMP command. The resulting CPU model will be reported. Signed-off-by: Collin Walling Reviewed-by: Daniel Henrique

[libvirt] [PATCH v5 04/15] qemu_monitor: add features to CPU model for QMP command

2019-09-19 Thread Collin Walling
query-cpu-model-baseline/comparison will accept a list of features as part of the command. Since CPUs may be defined with CPU feature policies, let's parse it to the appropriate boolean that the QMP command expects. A feature that is set to required, force, or if it is a hypervisor CPU feature

[libvirt] [PATCH v5 14/15] qemu_driver: hook up query-cpu-model-comparison

2019-09-19 Thread Collin Walling
This command is hooked into the virsh hypervisor-cpu-compare command. As such, the CPU model XML provided to the command will be compared to the hypervisor CPU contained in the QEMU capabilities file for the appropriate QEMU binary (for s390x, this CPU definition can be observed via virsh

[libvirt] [PATCH v5 07/15] qemu_monitor: implement query-cpu-model-baseline

2019-09-19 Thread Collin Walling
Interfaces with QEMU to baseline CPU models. The command takes two CPU models, A and B, that are given a model name and an optional list of CPU features. Through the query-cpu-model-baseline command issued via QMP, a result is produced that contains a new baselined CPU model that is guaranteed to

[libvirt] [PATCH v5 13/15] cpu_conf: xml to cpu definition parse helper

2019-09-19 Thread Collin Walling
Implement an XML to virCPUDefPtr helper that handles the ctxt prerequisite for virCPUDefParseXML. This does not alter any functionality. Signed-off-by: Collin Walling Reviewed-by: Bjoern Walk Reviewed-by: Daniel Henrique Barboza --- src/conf/cpu_conf.c | 29 +

[libvirt] [PATCH v5 06/15] qemu_monitor: make qemuMonitorJSONParseCPUModelData command-agnostic

2019-09-19 Thread Collin Walling
Modify the error messages in qemuMonitorJSONParseCPUModelData to print the command name provided to the function. Signed-off-by: Collin Walling --- src/qemu/qemu_monitor_json.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[libvirt] [PATCH v5 10/15] qemu_driver: expand cpu features after baseline

2019-09-19 Thread Collin Walling
Perform a full CPU model expansion on the result of the baselined model name when the features flag is present. Signed-off-by: Collin Walling --- src/qemu/qemu_driver.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCH v5 03/15] qemu_monitor: use cpu def instead of char for expansion

2019-09-19 Thread Collin Walling
When expanding a CPU model via query-cpu-model-expansion, any features that were a part of the original model are discarded. For exmaple, when expanding modelA with features f1, f2, a full expansion may reveal feature f3, but the expanded model will not include f1 or f2. Let's pass a virCPUDefPtr

[libvirt] [PATCH v5 00/15] CPU Model Baseline and Comparison for s390x

2019-09-19 Thread Collin Walling
Note: since I've made some changes to a lot of these patches / split up some patches, I've decided to hold off on adding any r-b's in case there is a specific change that someone does not agree with. Changelog: - Properly refactored code from CPU model expansion function - Introduced a

[libvirt] [PATCH v5 15/15] qemu_driver: improve comparison/baseline error reporting

2019-09-19 Thread Collin Walling
Providing an erroneous CPU definition in the XML file provided to the hypervisor-cpu-compare/baseline command will result in a verbose internal error. Let's add some sanity checking before executing the QMP commands to provide a cleaner message if something is wrong with the CPU model or features.

[libvirt] [PATCH v5 08/15] qemu_capabilities: introduce QEMU_CAPS_QUERY_CPU_MODEL_BASELINE

2019-09-19 Thread Collin Walling
This capability enables baselining of CPU models via QMP. Signed-off-by: Collin Walling Reviewed-by: Daniel Henrique Barboza Reviewed-by: Boris Fiuczynski Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

[libvirt] [PATCH v5 01/15] qemu_monitor: refactor cpu model expansion

2019-09-19 Thread Collin Walling
Refactor some code in qemuMonitorJSONGetCPUModelExpansion to be later used for the comparison and baseline functions. Signed-off-by: Collin Walling Reviewed-by: Bjoern Walk Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_monitor_json.c | 143 ---

[libvirt] [PATCH v5 02/15] qemu_monitor: expansion cleanups

2019-09-19 Thread Collin Walling
With refactoring most of the expansion function, let's take care of some additional cleanups. Signed-off-by: Collin Walling --- src/qemu/qemu_monitor_json.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[libvirt] [PATCH v5 05/15] qemu_monitor: allow cpu props to be optional

2019-09-19 Thread Collin Walling
Some older s390 CPU models (e.g. z900) will not report props as a response from query-cpu-model-expansion. As such, we should make the props field optional when parsing the return data from the QMP response. Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 10 --

[libvirt] [PATCH v5 11/15] qemu_monitor: implement query-cpu-model-comparison

2019-09-19 Thread Collin Walling
Interfaces with QEMU to compare CPU models. The command takes two CPU models, A and B, that are given a model name and an optional list of CPU features. Through the query-cpu-model-comparison command issued via QMP, a result is produced that contains the comparison evaluation string (identical,

[libvirt] [PATCH v5 12/15] qemu_capabilities: introduce QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON

2019-09-19 Thread Collin Walling
This capability enables comparison of CPU models via QMP. Signed-off-by: Collin Walling Reviewed-by: Daniel Henrique Barboza Reviewed-by: Boris Fiuczynski Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h

[libvirt] [PATCH 2/2] virpci, qemu_domain_address: adding virPCIDeviceSetAddress

2019-09-19 Thread Daniel Henrique Barboza
A common operation in qemu_domain_address is comparing a virPCIDeviceAddress and assigning domain, bus, slot and function to a specific value. The former can be done with the existing virPCIDeviceAddressEqual() helper. A new virpci helper called virPCIDeviceSetAddress() was created to make it

Re: [libvirt] [PATCH v4 00/20] Add vhost-user-gpu support

2019-09-19 Thread Cole Robinson
On 9/13/19 8:50 AM, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Hi, > > This series adds support for running virtio GPUs in seperate > processes, thanks to vhost-user backend. > Some quick notes. I attempted to run this with fedora 31 qemu. The qemu provided

[libvirt] [PATCH 0/2] a few cleanups in qemu_domain_address.c

2019-09-19 Thread Daniel Henrique Barboza
First patch is the standard "use VIR_AUTOFREE() in strings" type of patch. Second one is something I tried it out and ended up cleaning some repetitive code, so I believe it's worth seeing what you think. Daniel Henrique Barboza (2): qemu_domain_address.c: use VIR_AUTOFREE() in strings

[libvirt] [PATCH 1/2] qemu_domain_address.c: use VIR_AUTOFREE() in strings

2019-09-19 Thread Daniel Henrique Barboza
A few 'cleanup' labels gone after using VIR_AUTOFREE() in the strings. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain_address.c | 69 +++--- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/src/qemu/qemu_domain_address.c