Re: [libvirt] [PATCH v3 06/10] qemu_driver: use VIR_AUTOFREE() with strings 1/3

2019-10-16 Thread Daniel Henrique Barboza
On 10/16/19 11:28 AM, Ján Tomko wrote: On Wed, Oct 16, 2019 at 11:14:05AM -0300, Daniel Henrique Barboza wrote: On 10/16/19 10:49 AM, Ján Tomko wrote: On Tue, Oct 15, 2019 at 05:08:48PM -0300, Daniel Henrique Barboza wrote: Using VIR_AUTOFREE() in all strings of qemu_driver.c make the

Re: [libvirt] [RFC] Accepting PRs/MRs for libvirt on GitHub/GitLab

2019-10-16 Thread Ján Tomko
On Wed, Oct 16, 2019 at 02:22:56PM +0200, Andrea Bolognani wrote: First of all, we'd remove the ominous message from GitHub mirror repositories (interestingly, the same is not present on GitLab). Well if you're using GitLab then you're already aware of the fact that not everything is hosted

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread John Ferlan
On 10/16/19 10:52 AM, Ján Tomko wrote: > On Wed, Oct 16, 2019 at 03:23:41PM +0100, Daniel P. Berrangé wrote: >> On Wed, Oct 16, 2019 at 10:17:16AM -0400, John Ferlan wrote: >>> >>> >>> On 10/16/19 10:08 AM, Daniel P. Berrangé wrote: >>> > On Wed, Oct 16, 2019 at 08:54:26AM -0400, John Ferlan

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread Eric Blake
On 10/16/19 9:23 AM, Daniel P. Berrangé wrote: On Wed, Oct 16, 2019 at 10:17:16AM -0400, John Ferlan wrote: On 10/16/19 10:08 AM, Daniel P. Berrangé wrote: On Wed, Oct 16, 2019 at 08:54:26AM -0400, John Ferlan wrote: Recent changes moved some files to build-aux and created at least one

Re: [libvirt] [PATCH v2 28/31] qemuxml2*test: Add test cases for default CPU models on ppc64

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:35:04PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch ...ault-cpu-kvm-pseries-2.7.ppc64-latest.args | 38 .../ppc64-default-cpu-kvm-pseries-2.7.xml | 22 +

Re: [libvirt] [PATCH v2 27/31] qemuxml2*test: Add test cases for default CPU models on aarch64

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:35:03PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch ...fault-cpu-kvm-virt-4.2.aarch64-latest.args | 38 +++ .../aarch64-default-cpu-kvm-virt-4.2.xml | 20 ++

Re: [libvirt] [PATCH v2 29/31] qemuxml2*test: Add test cases for default CPU models on s390x

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:35:05PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 31 +++ .../s390-default-cpu-kvm-ccw-virtio-4.2.xml | 16 ++

Re: [libvirt] [PATCH v2 26/31] conf: Define VIR_AUTOPTR for virCPUDef

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:35:02PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/conf/cpu_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 30904fab95..230e75f077 100644 ---

Re: [libvirt] [PATCH v2 21/31] qemu: Store typename from query-cpu-definitions in qemuCaps

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:57PM +0200, Jiri Denemark wrote: We need to create a mapping between CPU model names and their corresponding QOM types. Signed-off-by: Jiri Denemark --- Notes: Version 2: - ignore empty typename strings Reviewed-by: Ján Tomko Jano signature.asc

Re: [libvirt] [PATCH v2 25/31] qemu: Use VIR_AUTOUNREF in qemuDomainDefPostParse

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:35:01PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/qemu/qemu_domain.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git

Re: [libvirt] [RFC] Accepting PRs/MRs for libvirt on GitHub/GitLab

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 02:22:56PM +0200, Andrea Bolognani wrote: > As we look to make the libvirt project easier to contribute to, one > fact that certainly comes to mind is that we only accept patches via > the mailing list. While the core developers are comfortable with the > email-based

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 10:10:48AM -0500, Eric Blake wrote: > On 10/16/19 9:23 AM, Daniel P. Berrangé wrote: > > On Wed, Oct 16, 2019 at 10:17:16AM -0400, John Ferlan wrote: > > > > > > > > > On 10/16/19 10:08 AM, Daniel P. Berrangé wrote: > > > > On Wed, Oct 16, 2019 at 08:54:26AM -0400, John

Re: [libvirt] [PATCH v2 16/31] qemu: Rename virQEMUCaps{Get, Fetch}CPUDefinitions

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:52PM +0200, Jiri Denemark wrote: The functions return virDomainCapsCPUModelsPtr and thus they should be called *CPUModels for consistency. Functions called *CPUDefinitions will work on qemuMonitorCPUDefsPtr. Signed-off-by: Jiri Denemark --- Notes: Version 2:

Re: [libvirt] [PATCH v2 18/31] qemu: Switch qemuCaps to use qemuMonitorCPUDefs

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:54PM +0200, Jiri Denemark wrote: We will need to keep some QEMU-specific data for each CPU model supported by a QEMU binary. Instead of complicating the generic virDomainCapsCPUModelsPtr, we can just directly store qemuMonitorCPUDefsPtr returned by the capabilities

Re: [libvirt] [PATCH v2 19/31] conf: Drop unused virDomainCapsCPUModelsFilter

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:55PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 33 - src/conf/domain_capabilities.h | 3 --- src/libvirt_private.syms | 1 - 3 files

Re: [libvirt] [PATCH v2 0/3] qemu_process: use VIR_AUTO*/g_auto* all around

2019-10-16 Thread Daniel Henrique Barboza
Please nevermind this patch series. It is deprecated after all the changes going in current master. I'll resend it using GLib macros only and splitting the patch series like it was suggested by Jano in the qemu_driver cleanup. Thanks, DHB On 10/15/19 7:47 PM, Daniel Henrique Barboza wrote:

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

2019-10-16 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 v4 2/5] qemu_driver: use g_autoptr() when possible

2019-10-16 Thread Daniel Henrique Barboza
Several pointer types can be auto-unref for the great majority of the uses made in qemu_driver, sparing us a virObjectUnref() call. This patch uses g_autoptr() in the following pointer types inside qemu_driver.c, whenever possible: - qemuBlockJobDataPtr - virCapsPtr - virConnect -

[libvirt] [PATCH v4 3/5] qemu_driver: use g_autofree when possible

2019-10-16 Thread Daniel Henrique Barboza
String and other scalar pointers an be auto-unref, sparing us a VIR_FREE() call. This patch uses g_autofree whenever possible with strings and other scalar pointer types. Suggested-by: Erik Skultety Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 203

[libvirt] [PATCH v4 5/5] qemu_driver: use g_strdup_printf

2019-10-16 Thread Daniel Henrique Barboza
This patch changes all virAsprintf calls to use the GLib API g_strdup_printf in qemu_driver.c Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCH v4 4/5] qemu_driver: remove unused 'cleanup' labels after g_auto*() changes

2019-10-16 Thread Daniel Henrique Barboza
The g_auto*() changes made by the previous patches made a lot of 'cleanup' labels obsolete. Let's remove them. Suggested-by: Ján Tomko Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 160 +++-- 1 file changed, 56 insertions(+), 104

[libvirt] [PATCH v4 1/5] qemu_driver: use g_auto* in some functions

2019-10-16 Thread Daniel Henrique Barboza
This patch changes qemuDomainSnapshotLoad, qemuDomainCheckpointLoad and qemuStateInitialize to use g_autoptr() and g_autofree, cleaning up some virObjectUnref() and VIR_FREE() calls on each. The reason this is being sent separately is because these are not trivial search/replace cases. In all

[libvirt] [PATCH v4 0/5] qemu_driver: GLib powered cleanup

2019-10-16 Thread Daniel Henrique Barboza
changes from v3: - only use the new Glib macros in all patches - different patch split, as suggested by Jano in v3 review - patch 5 (new): g_strdup_printf conversion changes from v2: - rebased with newer master (67e72053c1) - added an extra patch to convert the existing VIR_AUTO* macros to

Re: [libvirt] [PATCH 2/3] conf/network_conf: use virStringParseYesNo helper

2019-10-16 Thread Michal Privoznik
On 10/16/19 4:39 AM, Mao Zhongyi wrote: A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks.

Re: [libvirt] [PATCH 0/3] use virStringParseYesNo helper

2019-10-16 Thread Andrea Bolognani
On Wed, 2019-10-16 at 10:39 +0800, Mao Zhongyi wrote: > A function virStringParseYesNo was added to convert > string 'yes' to true and 'no' to false, so use this > helper to replace 'STREQ(.*, \"yes\")' and > 'STREQ(.*, \"no\")' as it allows us to drop several > repetitive if-then-else

Re: [libvirt] [PATCH 1/3] conf/domain_conf: use virStringParseYesNo helper

2019-10-16 Thread Michal Privoznik
On 10/16/19 4:39 AM, Mao Zhongyi wrote: This helper performs a conversion from a "yes|no" string to a corresponding boolean, and several conversions were already done, but there are still some omissions. For most of the remaining usages in domain_conf.c only "yes" is explicitly checked for.

Re: [libvirt] [PATCH 7/8] examples: Use G_N_ELEMENTS instead of ARRAY_CARDINALITY

2019-10-16 Thread Andrea Bolognani
On Tue, 2019-10-15 at 18:21 +0100, Daniel P. Berrangé wrote: > On Tue, Oct 15, 2019 at 04:10:55PM +0200, Andrea Bolognani wrote: > > On Tue, 2019-10-15 at 14:21 +0200, Ján Tomko wrote: > > > -#define ARRAY_CARDINALITY(Array) (sizeof(Array) / sizeof(*(Array))) > > > +#define G_N_ELEMENTS(Array)

Re: [libvirt] [PATCH 3/3] qemu/qemu_migration_params: use virStringParseYesNo helper

2019-10-16 Thread Michal Privoznik
On 10/16/19 4:39 AM, Mao Zhongyi wrote: A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks.

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 09:59:46PM -0500, Eric Blake wrote: > On 10/15/19 9:43 PM, Eric Blake wrote: > > On 10/15/19 9:25 PM, Wang Yechao wrote: > > > Libvirtd has set SIGPIPE to ignored, and virFork resets all signal > > > handlers to the defaults. But child process may write logs to > > >

Re: [libvirt] [PATCH 0/3] use virStringParseYesNo helper

2019-10-16 Thread maozy
On 10/16/19 3:51 PM, Andrea Bolognani wrote: On Wed, 2019-10-16 at 10:39 +0800, Mao Zhongyi wrote: A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop

Re: [libvirt] [PATCH 0/9] More GLib macro usage (glib chronicles)

2019-10-16 Thread Michal Privoznik
On 10/15/19 5:03 PM, Ján Tomko wrote: Ján Tomko (9): util: xml: use g_auto directly for VIR_XPATH_NODE_AUTORESTORE virbuffer: use g_auto directly for virBuffer Use g_autofree instead of VIR_AUTOFREE Use G_DEFINE_AUTOPTR_CLEANUP_FUNC instead of VIR_DEFINE_AUTOPTR_FUNC Use g_autoptr

[libvirt] [PATCH v4] util: Ignore SIGPIPE before write logs to stderr in child process

2019-10-16 Thread Wang Yechao
Libvirtd has set SIGPIPE to ignored, and virFork resets all signal handlers to the defaults. But child process may write logs to stderr/stdout, that may generate SIGPIPE if journald has stopped. So in virExec(), set SIGPIPE to ignored before invoke virCommandMassClose, and revert it back to

Re: [libvirt] [PATCH v2 01/31] tests: Add capabilities for QEMU 4.2.0 on s390x

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:37PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch .../caps_4.2.0.s390x.replies | 22414 .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 3345 +++ 2 files changed, 25759

Re: [libvirt] [PATCH v2 03/31] conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:39PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko with the

Re: [libvirt] [PATCH v2 05/31] qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:41PM +0200, Jiri Denemark wrote: Rather than returning a direct pointer the list stored in qemuCaps the function now creates a new copy of the CPU models list. The main purpose of this seemingly useless change is to update callers to free the result returned by

Re: [libvirt] [PATCH v2 08/31] qemu: Use VIR_AUTOPTR in qemuMonitorJSONGetCPUDefinitions

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:44PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/qemu/qemu_monitor_json.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko diff --git

[libvirt] [PATCH 2/2] storage: fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos On musl _PATH_MOUNTED is defined in paths.h, not in mntent.h, which causes compilation errors: storage/storage_backend_fs.c: In function 'virStorageBackendFileSystemIsMounted': storage/storage_backend_fs.c:255:23: error: '_PATH_MOUNTED' undeclared (first use in this

[libvirt] [PATCH 0/2] Fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos - Do not use 'stderr' as a field name, since it's a preprocessor macro in stdio.h. - Include paths.h for _PATH_MOUNTED, if it's not defined in mntent.h. Found while porting libvirt to Buildroot (https://buildroot.org/). Carlos Santos (2): qemu: fix build with musl libc

[libvirt] [PATCH 1/2] qemu: fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos On musl libc "stderr" is a preprocessor macro whose expansion leads to compilation errors: In file included from qemu/qemu_process.c:66: qemu/qemu_process.c: In function 'qemuProcessQMPFree': qemu/qemu_process.c:8418:21: error: expected identifier before '(' token

Re: [libvirt] [PATCH v2 12/31] build: Export virStringListCopy internal API

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:48PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing

[libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE

2019-10-16 Thread Ján Tomko
Commit 1e2ae2e311c7453e7894e93688f8785736aa0618 deleted the last use of VIR_AUTOFREE but forgot to delete the macro definition. Signed-off-by: Ján Tomko --- src/util/viralloc.h | 14 -- 1 file changed, 14 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index

[libvirt] [PATCH 5/9] qemu: use g_steal_pointer instead of VIR_STEAL_PTR

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/qemu/qemu_agent.c| 6 ++-- src/qemu/qemu_block.c| 20 ++-- src/qemu/qemu_blockjob.c | 6 ++-- src/qemu/qemu_capabilities.c | 14 - src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_command.c |

[libvirt] [PATCH 8/9] Use g_steal_pointer instead of VIR_STEAL_PTR everywhere

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/admin/admin_remote.c | 2 +- src/admin/admin_server_dispatch.c | 2 +- src/bhyve/bhyve_domain.c | 2 +- src/cpu/cpu_x86.c | 4 ++-- src/libvirt-domain.c | 8

[libvirt] [PATCH 9/9] internal: delete VIR_STEAL_PTR

2019-10-16 Thread Ján Tomko
Delete the macro to prevent its usage in new code. The GLib version should be used instead: p = g_steal_pointer(); Signed-off-by: Ján Tomko --- src/internal.h | 12 1 file changed, 12 deletions(-) diff --git a/src/internal.h b/src/internal.h index 722cdbc57c..fb17b87baa

[libvirt] [PATCH 3/9] internal: delete VIR_RETURN_PTR

2019-10-16 Thread Ján Tomko
Remove the macro definition to prevent its usage in new code. Signed-off-by: Ján Tomko --- src/internal.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/src/internal.h b/src/internal.h index 25df0560af..722cdbc57c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -225,21

[libvirt] [PATCH 6/9] tools: use g_steal_pointer instead of VIR_STEAL_PTR

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- tools/virsh-completer-domain.c| 12 ++-- tools/virsh-completer-host.c | 4 ++-- tools/virsh-completer-interface.c | 2 +- tools/virsh-completer-network.c | 4 ++-- tools/virsh-completer-nodedev.c | 4 ++-- tools/virsh-completer-nwfilter.c |

Re: [libvirt] [PATCH 1/3] conf/domain_conf: use virStringParseYesNohelper

2019-10-16 Thread maozy
Hi, Michal On 10/16/19 4:38 PM, Michal Privoznik wrote: On 10/16/19 4:39 AM, Mao Zhongyi wrote: This helper performs a conversion from a "yes|no" string to a corresponding boolean, and several conversions were already done, but there are still some omissions. For most of the remaining usages

Re: [libvirt] [PATCH v2 10/31] qemu: Introduce qemuMonitorCPUDefs struct

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:46PM +0200, Jiri Denemark wrote: It is a container for a CPU models list (qemuMonitorCPUDefInfo) and a number of elements in this list. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - v1 reviewed by Ján Tomko, but the patch had

Re: [libvirt] [PATCH 1/3] conf/domain_conf: use virStringParseYesNohelper

2019-10-16 Thread Michal Privoznik
On 10/16/19 12:10 PM, maozy wrote: Hi, Michal On 10/16/19 4:38 PM, Michal Privoznik wrote: On 10/16/19 4:39 AM, Mao Zhongyi wrote: This helper performs a conversion from a "yes|no" string to a corresponding boolean, and several conversions were already done, but there are still some

Re: [libvirt] [PATCH v3 00/10] use VIR_AUTO*/g_auto* all around qemu_driver.c

2019-10-16 Thread Daniel Henrique Barboza
I just realized by reading a patch from Jano that VIR_AUTOFREE is simply an alias for g_autofree. This means that it is not worth to add more VIR_AUTOFREE() macros, and that it is ok to mix g_autofree with other VIR_ macros such as VIR_AUTOUNREF(). Jano is also removing VIR_AUTOFREE() from the

Re: [libvirt] [PATCH v2 11/31] qemu: Flatten qemuMonitorCPUDefs.cpus

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:47PM +0200, Jiri Denemark wrote: Let's store qemuMonitorCPUDefInfo directly in the array of CPUs in qemuMonitorCPUDefs rather then using an array of pointers. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - trivial rebase

[libvirt] [PATCH 7/9] util: use g_steal_pointer instead of VIR_STEAL_PTR

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/util/vircgroupv1.c | 4 ++-- src/util/vircgroupv2.c | 2 +- src/util/virdbus.c | 12 +-- src/util/virdevmapper.c | 2 +- src/util/virerror.c | 2 +- src/util/virfile.c | 2 +-

[libvirt] [PATCH 2/9] Remove all usage of VIR_RETURN_PTR

2019-10-16 Thread Ján Tomko
Prefer: return g_steal_pointer(); Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 8 src/conf/secret_conf.c | 2 +- src/conf/storage_conf.c | 2 +- src/conf/virnetworkportdef.c | 2 +- src/libxl/xen_xl.c | 2 +- src/libxl/xen_xm.c |

[libvirt] [PATCH 0/9] GLib macros and where to find them (glib chronicles)

2019-10-16 Thread Ján Tomko
Ján Tomko (9): util: delete VIR_AUTOFREE Remove all usage of VIR_RETURN_PTR internal: delete VIR_RETURN_PTR conf: use g_steal_pointer instead of VIR_STEAL_PTR qemu: use g_steal_pointer instead of VIR_STEAL_PTR tools: use g_steal_pointer instead of VIR_STEAL_PTR util: use

[libvirt] [PATCH 4/9] conf: use g_steal_pointer instead of VIR_STEAL_PTR

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/conf/checkpoint_conf.c | 2 +- src/conf/cpu_conf.c | 18 ++-- src/conf/domain_addr.c | 4 +- src/conf/domain_capabilities.c | 4 +- src/conf/domain_conf.c | 138 +++

[libvirt] [RFC] Accepting PRs/MRs for libvirt on GitHub/GitLab

2019-10-16 Thread Andrea Bolognani
As we look to make the libvirt project easier to contribute to, one fact that certainly comes to mind is that we only accept patches via the mailing list. While the core developers are comfortable with the email-based workflow and swear by it, many perspective contributors are used to the PR/MR

Re: [libvirt] [PATCH v2 09/31] qemu: Change return type of virQEMUCapsFetchCPUDefinitions

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:45PM +0200, Jiri Denemark wrote: The function would return a valid virDomainCapsCPUModelsPtr with empty CPU models list if query-cpu-definitions exists in QEMU, but returns GenericError meaning it's not in fact implemented. This behaviour is a bit strange especially

Re: [libvirt] [PATCH v2 13/31] qemu: Add qemuMonitorCPUDefsCopy

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:49PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/qemu/qemu_monitor.c | 33 + src/qemu/qemu_monitor.h | 2 ++ 2 files changed, 35 insertions(+) Reviewed-by: Ján Tomko Jano

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

2019-10-16 Thread Sahid Orentino Ferdjaoui
On Fri, Sep 20, 2019 at 10:02:47AM +0200, Martin Kletzander wrote: > On Thu, Sep 19, 2019 at 05:48:49AM +, Linus Färnstrand wrote: > > * 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

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Eric Blake
On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: The challenge here is that we're in between fork + execve and want signal handlers back to their defaults at time of execve. If we set SIGPIPE to SIG_IGN and then execve() will that get reset back to SIG_DFL automatically ? Sadly, no. execve()

Re: [libvirt] [PATCH v2 02/31] domcapstest: Add test case for QEMU 4.2.0 on s390x

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:34:38PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch .../domaincapsschemadata/qemu_4.2.0.s390x.xml | 202 ++ tests/domaincapstest.c| 4 + 2 files changed, 206 insertions(+)

Re: [libvirt] [libvirt-rust PATCH 1/1] Make creating safe wrapper from raw pointer unsafe

2019-10-16 Thread Sahid Orentino Ferdjaoui
On Mon, Sep 30, 2019 at 12:10:49PM +0200, Martin Kletzander wrote: > On Wed, Sep 25, 2019 at 04:36:16PM +, Linus Färnstrand wrote: > > Giving an invalid pointer to the safe wrapper types causes > > undefined behavior when methods are later called on said wrapper > > > > Properly document

Re: [libvirt] [PATCH] qemu: caps: Use unique key for domCaps caching

2019-10-16 Thread Daniel Henrique Barboza
On 10/15/19 1:01 PM, Cole Robinson wrote: When searching qemuCaps->domCapsCache for existing domCaps data, we check for a matching pair of arch+virttype+machine+emulator. However for the hash table key we only use the machine string. So if the cache already contains: x86_64 + kvm + pc +

Re: [libvirt] [PATCH v3 00/10] use VIR_AUTO*/g_auto* all around qemu_driver.c

2019-10-16 Thread Ján Tomko
On Wed, Oct 16, 2019 at 09:24:13AM -0300, Daniel Henrique Barboza wrote: I just realized by reading a patch from Jano that VIR_AUTOFREE is simply an alias for g_autofree. This means that it is not worth to add more VIR_AUTOFREE() macros, and that it is ok to mix g_autofree with other VIR_ macros

[libvirt] [PATCH 1/2] qemu: fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos On musl libc "stderr" is a preprocessor macro whose expansion leads to compilation errors: In file included from qemu/qemu_process.c:66: qemu/qemu_process.c: In function 'qemuProcessQMPFree': qemu/qemu_process.c:8418:21: error: expected identifier before '(' token

Re: [libvirt] Fwd: libvirtd failing on MacOS in setgroups

2019-10-16 Thread Marcus Furlong
On Mon, 30 Sep 2019 at 21:05, Bruno Haible wrote: > > Daniel P. Berrangé wrote: > > > For what purpose is libvirt or QEMU using setgroups()? What goes wrong if > > > setgroups() fails? On macOS, as far as I can see, everything works as expected without it. So not sure if it's actually needed?

[libvirt] [PATCH 2/2] storage: fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos On musl _PATH_MOUNTED is defined in paths.h, not in mntent.h, which causes compilation errors: storage/storage_backend_fs.c: In function 'virStorageBackendFileSystemIsMounted': storage/storage_backend_fs.c:255:23: error: '_PATH_MOUNTED' undeclared (first use in this

[libvirt] [PATCH 0/2] Fix build with musl libc

2019-10-16 Thread casantos
From: Carlos Santos - Do not use 'stderr' as a field name, since it's a preprocessor macro in stdio.h. - Include paths.h for _PATH_MOUNTED, if it's not defined in mntent.h. Found while porting libvirt to Buildroot (https://buildroot.org/). Carlos Santos (2): qemu: fix build with musl libc

Re: [libvirt] [PATCH v3 06/10] qemu_driver: use VIR_AUTOFREE() with strings 1/3

2019-10-16 Thread Daniel Henrique Barboza
On 10/16/19 10:49 AM, Ján Tomko wrote: On Tue, Oct 15, 2019 at 05:08:48PM -0300, Daniel Henrique Barboza wrote: Using VIR_AUTOFREE() in all strings of qemu_driver.c make the code a bit tidier and smaller, sparing VIR_FREE() calls and sometimes a whole 'cleanup' label. These patches would

Re: [libvirt] [PATCH v3 06/10] qemu_driver: use VIR_AUTOFREE() with strings 1/3

2019-10-16 Thread Ján Tomko
On Tue, Oct 15, 2019 at 05:08:48PM -0300, Daniel Henrique Barboza wrote: Using VIR_AUTOFREE() in all strings of qemu_driver.c make the code a bit tidier and smaller, sparing VIR_FREE() calls and sometimes a whole 'cleanup' label. These patches would look much better split by: * individual

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 08:54:26AM -0400, John Ferlan wrote: > Recent changes moved some files to build-aux and created at least > one more. Really ? I wasn't aware that we'd moved the files listed in this change. > > Signed-off-by: John Ferlan > --- > .gitignore | 7 --- > 1 file

Re: [libvirt] [PATCH 00/10] Clean up error preservation/restoration

2019-10-16 Thread Michal Privoznik
On 10/15/19 7:37 PM, John Ferlan wrote: I was going through some old git trees and found this one started before I 'altered' my Red Hat career path. Seeing as no one has picked it up from https://wiki.libvirt.org/page/BiteSizedTasks - figured I may as well post it rather than throw it away ;-)

Re: [libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE

2019-10-16 Thread Michal Privoznik
On 10/16/19 2:09 PM, Ján Tomko wrote: Commit 1e2ae2e311c7453e7894e93688f8785736aa0618 deleted the last use of VIR_AUTOFREE but forgot to delete the macro definition. Signed-off-by: Ján Tomko --- src/util/viralloc.h | 14 -- 1 file changed, 14 deletions(-) diff --git

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: > On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: > > > > > The challenge here is that we're in between fork + execve and want signal > > handlers back to their defaults at time of execve. > > > > If we set SIGPIPE to SIG_IGN and then

[libvirt] [PATCH 2/3] docs: hacking: use for functions/names

2019-10-16 Thread Ján Tomko
Use the element more in the GLib section. Signed-off-by: Ján Tomko --- docs/hacking.html.in | 47 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 92826c5d44..ecf52ffc17 100644 ---

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread John Ferlan
On 10/16/19 10:08 AM, Daniel P. Berrangé wrote: > On Wed, Oct 16, 2019 at 08:54:26AM -0400, John Ferlan wrote: >> Recent changes moved some files to build-aux and created at least >> one more. > > Really ? I wasn't aware that we'd moved the files listed in > this change. > Well that's where

[libvirt] [PATCH 3/3] docs: hacking: add a conversion table for removed libvirt macros

2019-10-16 Thread Ján Tomko
Signed-off-by: Ján Tomko --- docs/hacking.html.in | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index ecf52ffc17..3b66c16761 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -1066,6 +1066,19 @@ BAD: should

[libvirt] [PATCH 1/3] docs: hacking: separate section about already deleted macros

2019-10-16 Thread Ján Tomko
Move the recently deleted libvirt macros into a separate section. Signed-off-by: Ján Tomko --- docs/hacking.html.in | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index de450b7cde..92826c5d44 100644 ---

Re: [libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 10:17:16AM -0400, John Ferlan wrote: > > > On 10/16/19 10:08 AM, Daniel P. Berrangé wrote: > > On Wed, Oct 16, 2019 at 08:54:26AM -0400, John Ferlan wrote: > >> Recent changes moved some files to build-aux and created at least > >> one more. > > > > Really ? I wasn't

[libvirt] [PATCH] build: Update .gitignore for build-aux files

2019-10-16 Thread John Ferlan
Recent changes moved some files to build-aux and created at least one more. Signed-off-by: John Ferlan --- .gitignore | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 85ead5c907..30610a37c9 100644 --- a/.gitignore +++ b/.gitignore @@

Re: [libvirt] [PATCH 0/9] GLib macros and where to find them (glib chronicles)

2019-10-16 Thread Michal Privoznik
On 10/16/19 2:09 PM, Ján Tomko wrote: Ján Tomko (9): util: delete VIR_AUTOFREE Remove all usage of VIR_RETURN_PTR internal: delete VIR_RETURN_PTR conf: use g_steal_pointer instead of VIR_STEAL_PTR qemu: use g_steal_pointer instead of VIR_STEAL_PTR tools: use g_steal_pointer

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Eric Blake
On 10/16/19 9:04 AM, Daniel P. Berrangé wrote: On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: The challenge here is that we're in between fork + execve and want signal handlers back to their defaults at time of execve. If we set

[libvirt] [PATCH 4/4] apparmor: let AppArmorSetSecurityImageLabel append rules

2019-10-16 Thread Christian Ehrhardt
There are currently broken use cases, e.g. snapshotting more than one disk at once like: $ virsh snapshot-create-as --domain eoan --disk-only --atomic --diskspec vda,snapshot=no --diskspec vdb,snapshot=no --diskspec vdc,file=/test/disk1.snapshot1.qcow,snapshot=external --diskspec

[libvirt] [PATCH 2/4] apparmor: drop useless call to get_profile_name

2019-10-16 Thread Christian Ehrhardt
reload_profile calls get_profile_name for no particular gain, lets remove that call. The string isn't used in that function later on and not registered/passed anywhere. It can only fail if it either can't allocate or if the virDomainDefPtr would have no uuid set (which isn't allowed). Thereby

[libvirt] [PATCH 3/4] apparmor: refactor AppArmorSetSecurityImageLabel

2019-10-16 Thread Christian Ehrhardt
A lot of the code in AppArmorSetSecurityImageLabel is a duplicate of what is in reload_profile, this refactors AppArmorSetSecurityImageLabel to use reload_profile instead. Signed-off-by: Christian Ehrhardt --- src/security/security_apparmor.c | 38 1 file

[libvirt] [PATCH 0/3] docs: hacking: document removed macro replacements (glib chronicles)

2019-10-16 Thread Ján Tomko
Make the GLib section more readable. Ján Tomko (3): docs: hacking: separate section about already deleted macros docs: hacking: use for functions/names docs: hacking: add a conversion table for removed libvirt macros docs/hacking.html.in | 71 +---

Re: [libvirt] [PATCH v3 06/10] qemu_driver: use VIR_AUTOFREE() with strings 1/3

2019-10-16 Thread Ján Tomko
On Wed, Oct 16, 2019 at 11:14:05AM -0300, Daniel Henrique Barboza wrote: On 10/16/19 10:49 AM, Ján Tomko wrote: On Tue, Oct 15, 2019 at 05:08:48PM -0300, Daniel Henrique Barboza wrote: Using VIR_AUTOFREE() in all strings of qemu_driver.c make the code a bit tidier and smaller, sparing

[libvirt] [PATCH 1/4] virt-aa-helper: clarify command line options

2019-10-16 Thread Christian Ehrhardt
While only used internally from libvirt the options still are misleading enough to cause issues every now and then. Group modes, options and an adding extra file and extend the wording of the latter which had the biggest lack of clarity. Both add a file to the end of the rules, but one

[libvirt] [PATCH 0/4] apparmor fixes triggered by multi disk snapshots

2019-10-16 Thread Christian Ehrhardt
Hi, the bugs [1][2] that made me debug into this actually only need the last patch (one line), but while coming along I found several opportunities for minor improvements of the apparmor code in libvirt. But that way it became a 4 patch series around apparmor. [1]:

[libvirt] [PATCH v2 3/3] qemu/qemu_migration_params: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks. Signed-off-by: Mao Zhongyi Signed-off-by:

[libvirt] [PATCH v2 1/3] conf/domain_conf: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
This helper performs a conversion from a "yes|no" string to a corresponding boolean, and several conversions were already done, but there are still some omissions. For most of the remaining usages in domain_conf.c only "yes" is explicitly checked for. This means all other values are implicitly

[libvirt] [PATCH v2 2/3] conf/network_conf: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks. Signed-off-by: Mao Zhongyi Signed-off-by:

[libvirt] [PATCH v2 0/3] use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks. v2->v1 p1: - ignore the return value of

[libvirt] [PATCH v4 2/2] qemu: Generate 'xres' and 'yres' for QEMU video devices

2019-10-16 Thread jcfaracco
From: Julio Faracco This commit let QEMU command line define 'xres' and 'yres' properties if XML contains both properties from video model: based on resolution fields 'x' and 'y'. There is a conditional structure inside qemuDomainDeviceDefValidateVideo() that validates if video model supports

[libvirt] [PATCH v4 0/2] Add resolution properties for QEMU video devices

2019-10-16 Thread jcfaracco
From: Julio Faracco This serie adds resolution ('x' and 'y') properties into XML definition for QEMU video devices to specify a default resolution. This specific case is not considering those attributes as a QEMU capabilities due to complexity of code versus test complexity versus a real gain.

Re: [libvirt] [PATCH 1/3] conf/domain_conf: usevirStringParseYesNohelper

2019-10-16 Thread maozy
On 10/16/19 7:02 PM, Michal Privoznik wrote: On 10/16/19 12:10 PM, maozy wrote: Hi, Michal On 10/16/19 4:38 PM, Michal Privoznik wrote: On 10/16/19 4:39 AM, Mao Zhongyi wrote: This helper performs a conversion from a "yes|no" string to a corresponding boolean, and several conversions were

[libvirt] [PATCH v4 1/2] conf: Add 'x' and 'y' resolution into video XML definition

2019-10-16 Thread jcfaracco
From: Julio Faracco This commit adds resolution element with parameters 'x' and 'y' into video XML domain group definition. Both, properties were added into an element called 'resolution' and it was added inside 'model' element. They are set as optional. This element does not follow QEMU

[libvirt] [PATCH] Apparmor: Support Xen scripts in libexec

2019-10-16 Thread Jim Fehlig
Upstream Xen has traditionally installed various hotplug and utility scripts in /etc/xen/scripts/. openSUSE is slowly moving all distribution provided configuration files and scripts from /etc to /usr. In the case of the Xen scripts provided under /etc/xen/scripts/, they will be moving to

Re: [libvirt] [RFC] Accepting PRs/MRs for libvirt on GitHub/GitLab

2019-10-16 Thread Peter Krempa
On Wed, Oct 16, 2019 at 17:08:20 +0100, Daniel Berrange wrote: > On Wed, Oct 16, 2019 at 05:03:31PM +0200, Ján Tomko wrote: > > On Wed, Oct 16, 2019 at 02:22:56PM +0200, Andrea Bolognani wrote: [...] > > Here it deviates from the usual mailing list workflow where the patch > > has (in theory) a

Re: [libvirt] [PATCH v3] util: Block SIGPIPE until execve in child process

2019-10-16 Thread Daniel P . Berrangé
On Wed, Oct 16, 2019 at 09:33:59AM -0500, Eric Blake wrote: > On 10/16/19 9:04 AM, Daniel P. Berrangé wrote: > > On Wed, Oct 16, 2019 at 06:50:33AM -0500, Eric Blake wrote: > > > On 10/16/19 4:02 AM, Daniel P. Berrangé wrote: > > > > > > > > > > > The challenge here is that we're in between fork

  1   2   >