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

2019-10-15 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. Cc: jdene...@redhat.com Cc:

[libvirt] [PATCH v2 3/3] qemu_process.c: use GLib macros

2019-10-15 Thread Daniel Henrique Barboza
Previous patches added VIR_AUTO* facilities in qemu_process.c to cleanup virObjectUnref() and VIR_FREE() calls. This patch now converts those VIR_AUTO* macros to their GLib alternatives, g_autoptr and g_autofree. The following functions weren't changed in this patch: - qemuProcessUpdateCPU -

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

2019-10-15 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 block SIGPIPE in virFork, and unblock it before execve. Signed-off-by: Wang Yechao --- v1 patch:

Re: [libvirt] [PATCH 00/30] storagefile, security: qcow2 data_file support

2019-10-15 Thread Han Han
On Wed, Oct 16, 2019 at 1:04 AM Cole Robinson wrote: > On 10/15/19 3:56 AM, Han Han wrote: > > Hello Cole, one issue is found: > > The qcow2 data file XTTRs is not cleaned on external snapshot when > > -blockdev is not enabled > > > > Versions: > > libvirt v5.8.0-134-g9d03e9adf1 > >

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

2019-10-15 Thread Daniel Henrique Barboza
The usual AUTOFREE() and AUTOUNREF() changes that allows for a bit of cleanup. A new patch was added to convert most of the VIR_AUTO* macros to GLib g_auto* ones. v1: https://www.redhat.com/archives/libvir-list/2019-September/msg01465.html Daniel Henrique Barboza (3): qemu_process: use

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

2019-10-15 Thread Eric Blake
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 stderr/stdout, that may generate SIGPIPE if journald has stopped. So block SIGPIPE in

Re: [libvirt] [PATCH 1/1] Add shrink flag to blockresize command

2019-10-15 Thread Han Han
On Tue, Oct 15, 2019 at 10:46 PM Cole Robinson wrote: > On 10/5/19 2:56 PM, martinsson.pat...@gmail.com wrote: > > From: patchon > > > > You probably want to fix this to match your signed-off-by name. > > > These commits simply adds the '--shrink' flag to the blockresize > I agree that an

Re: [libvirt] [PATCH v3 03/19] util: use glib memory allocation functions

2019-10-15 Thread Han Han
Not reproduced when build source before `make clean`. Please ignore that issue On Tue, Oct 15, 2019 at 10:20 AM Han Han wrote: > > > On Thu, Oct 10, 2019 at 6:54 PM Daniel P. Berrangé > wrote: > >> Convert the VIR_ALLOC family of APIs with use of the g_malloc family of >> APIs. Use of

[libvirt] [PATCH 2/2] qemu: cold-unplug of sound

2019-10-15 Thread Jidong Xia
With this patch users can cold unplug some sound devices. use "virsh detach-device vm sound.xml --config" command. Signed-off-by: Jidong Xia --- src/conf/domain_conf.c | 61 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 2 ++

Re: [libvirt] [PATCH 1/3] conf: Set rebootTimeout valid range to 0..0xffff

2019-10-15 Thread Michal Privoznik
On 10/15/19 7:23 AM, Han Han wrote: Hi Michal, Any more advice update? Well, as I've said earlier, since we document that -1 is accepted value and it means that it suppresses automatic reboots we need a way to preserve this behaviour. For instance, what happens if you don't put

Re: [libvirt] [virttools-planet PATCH] Add Fabiano Fidencio to Planet Virt-Tools

2019-10-15 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 08:45:24AM +0200, Fabiano Fidêncio wrote: > Signed-off-by: Fabiano Fidêncio > --- > updater/virt-tools/config.ini | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Daniel P. Berrangé and pushed to git Regards, Daniel -- |: https://berrange.com -o-

Re: [libvirt] [PATCH 00/35] Use more of GLib's macros

2019-10-15 Thread Ján Tomko
On Tue, Oct 15, 2019 at 10:40:35AM +0200, Michal Privoznik wrote: On 10/14/19 3:15 PM, Ján Tomko wrote: We do not need to define MIN and MAX if we include glib.h and it also provides some macros for __attribute__'s Ján Tomko (35): util: remove MIN and MAX macros apibuild: ignore GLib

Re: [libvirt] [PATCH 06/35] examples: use G_GNUC_UNUSED

2019-10-15 Thread Ján Tomko
On Tue, Oct 15, 2019 at 10:40:47AM +0200, Michal Privoznik wrote: On 10/14/19 3:15 PM, Ján Tomko wrote: Name the macro G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED to match the rest of libvirt code. Signed-off-by: Ján Tomko --- examples/c/misc/event-test.c | 140

[libvirt] [PATCH 1/2] qemu: cold-plug of sound

2019-10-15 Thread Jidong Xia
With this patch users can cold plug some sound devices. use "virsh attach-device vm sound.xml --config" command. Consider the following sound.xml for a domain: Signed-off-by: Jidong Xia --- src/qemu/qemu_driver.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

[libvirt] [PATCH 0/2] qemu: cold-plug and cold-unplug of sound

2019-10-15 Thread Jidong Xia
With this patch users can cold plug and unplug some sound devices. Jidong Xia (2): qemu: cold-plug of sound qemu: cold-unplug of sound src/conf/domain_conf.c | 61 src/conf/domain_conf.h | 2 ++ src/libvirt_private.syms | 2 ++

[libvirt] [virttools-planet PATCH] Add Fabiano Fidencio to Planet Virt-Tools

2019-10-15 Thread Fabiano Fidêncio
Signed-off-by: Fabiano Fidêncio --- updater/virt-tools/config.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini index 6b4b5ec..9375c82 100644 --- a/updater/virt-tools/config.ini +++ b/updater/virt-tools/config.ini @@ -194,3

Re: [libvirt] [virttools-planet PATCH] Add Fabiano Fidencio to Planet Virt-Tools

2019-10-15 Thread Andrea Bolognani
On Tue, 2019-10-15 at 08:45 +0200, Fabiano Fidêncio wrote: > Add Fabiano Fidencio to Planet Virt-Tools s/Fidencio/Fidêncio/ > Signed-off-by: Fabiano Fidêncio > --- > updater/virt-tools/config.ini | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/updater/virt-tools/config.ini

[libvirt] [PATCH] qemu: fix EFI nvram removal on domain undefine

2019-10-15 Thread Pavel Mores
When undefining a UEFI domain its nvram file has to be properly handled as well. It's mandatory to use one of --nvram and --keep-nvram options when 'virsh undefine ' is issued for a UEFI domain. To fix the bug as reported, virsh should return an error message if neither option is used and the

Re: [libvirt] [virttools-planet PATCH] Add Fabiano Fidencio to Planet Virt-Tools

2019-10-15 Thread Fabiano Fidêncio
On Tue, Oct 15, 2019 at 10:13 AM Andrea Bolognani wrote: > > On Tue, 2019-10-15 at 08:45 +0200, Fabiano Fidêncio wrote: > > Add Fabiano Fidencio to Planet Virt-Tools > > s/Fidencio/Fidêncio/ This would break git publish. :-) > > > Signed-off-by: Fabiano Fidêncio > > --- > >

Re: [libvirt] [PULL 01/19] util/hbitmap: strict hbitmap_reset

2019-10-15 Thread Kevin Wolf
Am 14.10.2019 um 20:10 hat John Snow geschrieben: > > > On 10/11/19 7:18 PM, John Snow wrote: > > > > > > On 10/11/19 5:48 PM, Eric Blake wrote: > >> On 10/11/19 4:25 PM, John Snow wrote: > >>> From: Vladimir Sementsov-Ogievskiy > >>> > >>> hbitmap_reset has an unobvious property: it rounds

Re: [libvirt] [PATCH 00/35] Use more of GLib's macros

2019-10-15 Thread Michal Privoznik
On 10/14/19 3:15 PM, Ján Tomko wrote: We do not need to define MIN and MAX if we include glib.h and it also provides some macros for __attribute__'s Ján Tomko (35): util: remove MIN and MAX macros apibuild: ignore GLib macros too use G_GNUC_NORETURN instead of ATTRIBUTE_NORETURN use

Re: [libvirt] [PATCH 24/35] security: use G_GNUC_UNUSED

2019-10-15 Thread Michal Privoznik
On 10/14/19 3:15 PM, Ján Tomko wrote: Use G_GNUC_UNUSED from GLib instead of ATTRIBUTE_UNUSED. Signed-off-by: Ján Tomko --- src/security/security_apparmor.c | 88 src/security/security_dac.c | 114 ++-- src/security/security_manager.c | 6 +-

Re: [libvirt] [PATCH 06/35] examples: use G_GNUC_UNUSED

2019-10-15 Thread Michal Privoznik
On 10/14/19 3:15 PM, Ján Tomko wrote: Name the macro G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED to match the rest of libvirt code. Signed-off-by: Ján Tomko --- examples/c/misc/event-test.c | 140 +-- 1 file changed, 70 insertions(+), 70 deletions(-) diff

Re: [libvirt] [PATCH 00/35] Use more of GLib's macros

2019-10-15 Thread Andrea Bolognani
On Tue, 2019-10-15 at 10:53 +0200, Ján Tomko wrote: > On Tue, Oct 15, 2019 at 10:40:35AM +0200, Michal Privoznik wrote: > > I've identified other macros of ours that might be worth converting too: > > > > ATTRIBUTE_FALLTHROUGH > > G_GNUC_FALLTHROUGH was introduced in GLib 2.60 so not yet > > >

Re: [libvirt] [PATCH] qemu: fix EFI nvram removal on domain undefine

2019-10-15 Thread Michal Privoznik
On 10/15/19 10:31 AM, Pavel Mores wrote: When undefining a UEFI domain its nvram file has to be properly handled as well. It's mandatory to use one of --nvram and --keep-nvram options when 'virsh undefine ' is issued for a UEFI domain. To fix the bug as reported, virsh should return an error

Re: [libvirt] [PULL 00/19] Bitmaps patches

2019-10-15 Thread Peter Maydell
On Fri, 11 Oct 2019 at 22:26, John Snow wrote: > > The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: > > Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' > into staging (2019-10-08 16:08:35 +0100) > > are available in the Git repository at: > >

Re: [libvirt] [virttools-planet PATCH] Add Fabiano Fidencio to Planet Virt-Tools

2019-10-15 Thread Ján Tomko
On Tue, Oct 15, 2019 at 10:20:12AM +0200, Fabiano Fidêncio wrote: On Tue, Oct 15, 2019 at 10:13 AM Andrea Bolognani wrote: On Tue, 2019-10-15 at 08:45 +0200, Fabiano Fidêncio wrote: > Add Fabiano Fidencio to Planet Virt-Tools s/Fidencio/Fidêncio/ This would break git publish. :-)

[libvirt] [PATCH 0/8] Use even morer of GLib's macros (glib chronicles)

2019-10-15 Thread Ján Tomko
Ján Tomko (8): syntax-check: mock-noinline: fix after G_GNUC attribute invocations syntax-check: prohibit_attribute_macros: generalize error Use G_GNUC_NO_INLINE instead of ATTRIBUTE_NOINLINE Use G_GNUC_PRINTF instead of ATTRIBUTE_FMT_PRINTF Document the ATTRIBUTE_FALLTHROUGH macro Use

[libvirt] [PATCH 2/8] syntax-check: prohibit_attribute_macros: generalize error

2019-10-15 Thread Ján Tomko
Instead of enumerating every single macro variant, just emit a more generic error. Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index c30d575e77..c0612a3319 100644

[libvirt] [PATCH 4/8] Use G_GNUC_PRINTF instead of ATTRIBUTE_FMT_PRINTF

2019-10-15 Thread Ján Tomko
Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 2 +- src/internal.h| 20 src/libxl/libxl_logger.c | 2 +- src/qemu/qemu_domain.h| 4 ++-- src/util/viraudit.h | 2 +- src/util/virbuffer.h

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

2019-10-15 Thread Ján Tomko
We try to keep the example programs independent of libraries other than libvirt. Rename the locally defined ARRAY_CARDINALITY macro to G_N_ELEMENTS which GLib provides, even though we don't actually include GLib. Signed-off-by: Ján Tomko --- examples/c/misc/event-test.c | 26

[libvirt] [RFC 1/1] util: convert virStorageSource class to use GObject

2019-10-15 Thread Daniel Henrique Barboza
Following up the directions provided in commit 16121a88a7, this patch converts virStorageSource to use GObject. All calls to virObjectRef were converted to g_object_ref. Calls to virObjectUnref were changed to use either g_object_unref or g_clear_object, depending on the context. Signed-off-by:

[libvirt] [RFC 0/1] convert virStorageSource to GObject

2019-10-15 Thread Daniel Henrique Barboza
I was hoping to quickly re-send the qemu_driver cleanups I've sent some time ago, now using Glib. I started by attempting to change the first VIR_AUTOUNREF() call in qemu_driver.c to g_autoptr(), which happens to be a virStorageSourcePtr type, then I realized that it wasn't that simple. Following

[libvirt] [PATCH 1/8] syntax-check: mock-noinline: fix after G_GNUC attribute invocations

2019-10-15 Thread Ján Tomko
We started using G_GNUC macros instead of ATTRIBUTE for some attributes. Adjust this syntax-check accordingly. Signed-off-by: Ján Tomko --- build-aux/mock-noinline.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-aux/mock-noinline.pl b/build-aux/mock-noinline.pl

[libvirt] [PATCH 3/8] Use G_GNUC_NO_INLINE instead of ATTRIBUTE_NOINLINE

2019-10-15 Thread Ján Tomko
Define the macro for older GLib versions. Signed-off-by: Ján Tomko --- build-aux/mock-noinline.pl | 2 +- build-aux/syntax-check.mk | 2 +- src/internal.h | 8 +--- src/qemu/qemu_capspriv.h| 2 +- src/rpc/virnetsocket.h | 4 ++--

[libvirt] [PATCH 5/8] Document the ATTRIBUTE_FALLTHROUGH macro

2019-10-15 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/internal.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/internal.h b/src/internal.h index 0825e63993..1f70123e47 100644 --- a/src/internal.h +++ b/src/internal.h @@ -135,6 +135,13 @@ # endif #endif +/** + * + * ATTRIBUTE_FALLTHROUGH + * + *

[libvirt] [PATCH 6/8] Use G_GNUC_FALLTHROUGH instead of ATTRIBUTE_FALLTHROUGH

2019-10-15 Thread Ján Tomko
Also define the macro for building with GLib older than 2.60 Signed-off-by: Ján Tomko --- build-aux/syntax-check.mk | 2 +- src/conf/domain_conf.c | 8 src/conf/network_conf.c | 2 +- src/conf/nwfilter_conf.c| 14 +++--- src/cpu/cpu_ppc64.c | 2 +-

Re: [libvirt] [PULL 01/19] util/hbitmap: strict hbitmap_reset

2019-10-15 Thread John Snow
On 10/15/19 4:44 AM, Kevin Wolf wrote: > Am 14.10.2019 um 20:10 hat John Snow geschrieben: >> >> >> On 10/11/19 7:18 PM, John Snow wrote: >>> >>> >>> On 10/11/19 5:48 PM, Eric Blake wrote: On 10/11/19 4:25 PM, John Snow wrote: > From: Vladimir Sementsov-Ogievskiy > >

Re: [libvirt] [RFC 0/1] convert virStorageSource to GObject

2019-10-15 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 09:42:45AM -0300, Daniel Henrique Barboza wrote: > I was hoping to quickly re-send the qemu_driver cleanups I've > sent some time ago, now using Glib. I started by attempting to > change the first VIR_AUTOUNREF() call in qemu_driver.c to > g_autoptr(), which happens to be a

Re: [libvirt] [RFC 0/1] convert virStorageSource to GObject

2019-10-15 Thread Peter Krempa
On Tue, Oct 15, 2019 at 09:42:45 -0300, Daniel Henrique Barboza wrote: > I was hoping to quickly re-send the qemu_driver cleanups I've > sent some time ago, now using Glib. I started by attempting to > change the first VIR_AUTOUNREF() call in qemu_driver.c to > g_autoptr(), which happens to be a

Re: [libvirt] [PATCH] qemu: fix EFI nvram removal on domain undefine

2019-10-15 Thread Pavel Mores
On Tue, Oct 15, 2019 at 01:51:32PM +0200, Michal Privoznik wrote: > On 10/15/19 10:31 AM, Pavel Mores wrote: > > When undefining a UEFI domain its nvram file has to be properly handled as > > well. It's mandatory to use one of --nvram and --keep-nvram options when > > 'virsh undefine ' is issued

<    1   2