Re: [PATCH 04/25] util: validate return from xmlNodeGetContent before use

2020-06-26 Thread Laine Stump
On 6/25/20 6:55 PM, Ján Tomko wrote: On a Wednesday in 2020, Laine Stump wrote: There were a few uses of xmlNodeGetContent() that didn't check for NULL before using the result. A NULL return from xmlNodeGetContent() *could* (probably does) mean that there was an Out of Memory condition, but it

Re: [PATCH 03/25] conf: refactor virDomainBlkioDeviceParseXML to remove possible NULL dereference

2020-06-26 Thread Laine Stump
On 6/26/20 6:54 PM, Laine Stump wrote: On 6/25/20 6:44 PM, Ján Tomko wrote: and give a possibility of assigning the path directly to 'path', without the extra steal_pointer. I don't follow there - if you assign directly from xmlNodeGetContent() into path, then you'll need to duplicate the

Re: [PATCH 03/25] conf: refactor virDomainBlkioDeviceParseXML to remove possible NULL dereference

2020-06-26 Thread Laine Stump
On 6/25/20 6:44 PM, Ján Tomko wrote: On a Wednesday in 2020, Laine Stump wrote: virDomainBlkioDeviceParseXML() has multiple cases of sending the return from xmlNodeGetContent() directly to virStrToLong_xx() without checking for NULL. Although it is *very* rare for xmlNodeGetContent() to return

[PATCH 3/7] virsh-domain.c: modernize virshVcpuinfoInactive()

2020-06-26 Thread Daniel Henrique Barboza
Use g_auto* in the string and in the bitmap. Remove the cleanup label since it's now unneeded. Signed-off-by: Daniel Henrique Barboza --- tools/virsh-domain.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c

[PATCH 5/7] virhostcpu.c: refactor virHostCPUParseCountLinux()

2020-06-26 Thread Daniel Henrique Barboza
This function reads the string in sysfspath/cpu/present and parses it manually to retrieve the number of present CPUs. virHostCPUGetPresentBitmap() reads and parses the same file, using a more robust parser via virBitmapParseUnlimited(), but returns a bitmap. Let's drop all the manual parsing

[PATCH 6/7] virhostcpu.c: introduce virHostCPUGetAvailableCPUsBitmap()

2020-06-26 Thread Daniel Henrique Barboza
The idea is to have a function that calls virHostCPUGetOnlineBitmap() but, instead of returning NULL if the host does not have CPU offlining capabilities, fall back to a bitmap containing all present CPUs. Next patch will use this helper in two other places. Signed-off-by: Daniel Henrique

[PATCH 1/7] qemu_driver.c: use g_autoptr in qemuDomainGetEmulatorPinInfo()

2020-06-26 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- 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 a5b38b3d24..d486ce5278 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5427,7 +5427,7

[PATCH 0/7] consider available CPUs in vcpupin/emulatorpin output

2020-06-26 Thread Daniel Henrique Barboza
Hi, This series contains 5 cleanups and refactorings I found on my way to fixing [1]. Last 2 patches contains the actual fix for the bug. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1434276 Daniel Henrique Barboza (7): qemu_driver.c: use g_autoptr in qemuDomainGetEmulatorPinInfo()

[PATCH 7/7] conf, qemu: consider available CPUs in vcpupin/emulatorpin output

2020-06-26 Thread Daniel Henrique Barboza
The output of vcpupin and emulatorpin for a domain with vcpu placement='static' is based on a default bitmap that contains all possible CPUs in the host, regardless of the CPUs being offline or not. E.g. for a Linux host with this CPU setup (from lscpu): On-line CPU(s) list:

[PATCH 2/7] virhostcpu.c: use g_autoptr in virHostCPUGetMap()

2020-06-26 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- src/util/virhostcpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 39bbcf8ca8..3023bca831 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1089,7 +1089,7 @@

[PATCH 4/7] virsh-domain.c: modernize cmdVcpuinfo()

2020-06-26 Thread Daniel Henrique Barboza
Use g_auto* pointers to avoid the need for the cleanup label. The type of the pointer 'virDomainPtr dom' was changed to its alias 'virshDomainPtr' to allow the use of g_autoptr(). Signed-off-by: Daniel Henrique Barboza --- tools/virsh-domain.c | 26 +- 1 file changed, 9

Re: [PATCH libvirt v2 2/5] conf: fix zPCI address auto-generation on s390

2020-06-26 Thread Daniel Henrique Barboza
Hello, This patch is generating errors when booting Libvirt in a Power 8 host: 2020-06-26 21:35:49.703+: 139213: error : virDomainDeviceInfoFormat:7527 : internal error: Missing uid or fid attribute of zPCI address 2020-06-26 21:35:49.703+: 139213: error :

[PATCH 1/1] domain_conf.c: skip checking ZPCI address is incomplete if not present

2020-06-26 Thread Daniel Henrique Barboza
Commit 076591009ad1 ("conf: fix zPCI address auto-generation on s390") is doing a check for virZPCIDeviceAddressIsIncomplete() prior to checking if the device has a ZPCI address at all. This results in errors like these when starting Libvirt: error : virDomainDeviceInfoFormat:7527 : internal

Re: [PATCH v1] qemu: monitor: substitute missing model name for host-passthrough

2020-06-26 Thread Collin Walling
On 6/26/20 3:22 AM, Peter Krempa wrote: > On Thu, Jun 25, 2020 at 17:58:46 -0400, Collin Walling wrote: >> When executing the hypervisor-cpu-compare/baseline commands and >> the XML file contains a CPU definition using host-passthrough >> and no model name, the commands will fail and return an

[libvirt PATCH] ci: Run all jobs, for all branches, all the time

2020-06-26 Thread Andrea Bolognani
After recent changes (increasing the parallelism of the pipeline by reducing the number of stages, introducing FreeBSD builds that take longer than any other job), the difference between running the full pipeline or a reduced one has basically disappeared: in both cases, the completion time is

Re: [PATCH libvirt v2 0/5] Fix zPCI address auto-generation on s390

2020-06-26 Thread Andrea Bolognani
On Fri, 2020-06-26 at 14:13 +0200, Shalini Chellathurai Saroja wrote: > On 6/25/20 8:01 PM, Andrea Bolognani wrote: > > Aside from the comments in patch 2/5, everything looks good to me. > > > > The series does, however, not update the release notes (NEWS.rst): > > can you please post a 6/5 patch

Re: [PATCH 11/25] network: use g_free() in place of remaining VIR_FREE()

2020-06-26 Thread Laine Stump
On 6/25/20 11:12 AM, Daniel P. Berrangé wrote: On Thu, Jun 25, 2020 at 11:01:48AM -0400, Laine Stump wrote: On 6/25/20 3:55 AM, Peter Krempa wrote: On Wed, Jun 24, 2020 at 23:34:00 -0400, Laine Stump wrote: Signed-off-by: Laine Stump --- src/network/bridge_driver.c | 59

Re: [PATCH libvirt v2 2/5] conf: fix zPCI address auto-generation on s390

2020-06-26 Thread Andrea Bolognani
On Fri, 2020-06-26 at 16:08 +0200, Bjoern Walk wrote: > Andrea Bolognani [2020-06-25, 07:43PM +0200]: > > static int > > virDomainZPCIAddressReserveId(virHashTablePtr set, > > - unsigned int id, > > + virZPCIDeviceAddressID *id, > >

Re: [PATCH libvirt v2 2/5] conf: fix zPCI address auto-generation on s390

2020-06-26 Thread Bjoern Walk
Andrea Bolognani [2020-06-25, 07:43PM +0200]: > From 82197ea6d794144e51b72f97df2315a65134b385 Mon Sep 17 00:00:00 2001 > From: Andrea Bolognani > Date: Thu, 25 Jun 2020 18:37:27 +0200 > Subject: [libvirt PATCH 1/2] conf: Move id->{value,isSet} handling further > down the stack > >

Re: [PATCH libvirt v2 2/5] conf: fix zPCI address auto-generation on s390

2020-06-26 Thread Shalini Chellathurai Saroja
On 6/25/20 7:43 PM, Andrea Bolognani wrote: First of all, this is much closer to what I had in mind. Good job! Hi Andrea, Thank you:-) We're not quite there yet, though: as you can see from the hunks above, there are still many scenarios in which we're either manipulating id->value and

Re: [PATCH libvirt v2 0/5] Fix zPCI address auto-generation on s390

2020-06-26 Thread Shalini Chellathurai Saroja
On 6/25/20 8:01 PM, Andrea Bolognani wrote: On Thu, 2020-06-18 at 10:25 +0200, Shalini Chellathurai Saroja wrote: Shalini Chellathurai Saroja (5): conf: use g_autofree to ensure automatic cleanup conf: fix zPCI address auto-generation on s390 qemu: move ZPCI uid validation into device

Re: [PATCH libvirt v2 2/5] conf: fix zPCI address auto-generation on s390

2020-06-26 Thread Boris Fiuczynski
On 6/25/20 7:43 PM, Andrea Bolognani wrote: On Thu, 2020-06-18 at 10:25 +0200, Shalini Chellathurai Saroja wrote: @@ -129,7 +129,8 @@ static void virDomainZPCIAddressReleaseUid(virHashTablePtr set, virZPCIDeviceAddressPtr addr) { -

Re: [libvirt PATCH v2] ci: Use openSUSE image for code style checking

2020-06-26 Thread Erik Skultety
On Thu, Jun 25, 2020 at 03:43:37PM -0500, Jonathon Jongsma wrote: > On Mon, 2020-06-22 at 18:18 +0200, Andrea Bolognani wrote: > > On Mon, 2020-06-22 at 09:43 -0500, Jonathon Jongsma wrote: > > > CentOS does not have the cppi package, so some code style checks > > > are > > > skipped. Switch to a

Re: [PATCH v1] qemu: monitor: substitute missing model name for host-passthrough

2020-06-26 Thread Peter Krempa
On Thu, Jun 25, 2020 at 17:58:46 -0400, Collin Walling wrote: > When executing the hypervisor-cpu-compare/baseline commands and > the XML file contains a CPU definition using host-passthrough > and no model name, the commands will fail and return an error > message from the QMP response. This