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 reboot-timeou

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 > > --- > > updater/virt-tools/

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 b/update

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-https

[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 nvr

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 +- src/s

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 --git

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

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 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 macros

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 +

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 me

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. :-) Hopeful

[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 index

[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 ++-- src/util/vir

[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 + * + * s

[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 +- src

[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 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] [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: D

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 > > hbitmap_res

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 vi

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 f

[libvirt] [PATCH 2/2] tests: Add test case for empty 'network' cdrom

2019-10-15 Thread Peter Krempa
We don't allow such config in the schema but the code can handle that so add a test case supporting it. Signed-off-by: Peter Krempa --- ...m-empty-network-invalid.x86_64-latest.args | 34 +++ .../disk-cdrom-empty-network-invalid.xml | 30 tests/qemuxml2argvt

[libvirt] [PATCH 0/2] conf: Fix up empty 'network' cdroms

2019-10-15 Thread Peter Krempa
Peter Krempa (2): conf: Reset disk type if element is completely missing tests: Add test case for empty 'network' cdrom src/conf/domain_conf.c| 4 +++ ...m-empty-network-invalid.x86_64-latest.args | 34 +++ .../disk-cdrom-empty-network-invalid.xml

[libvirt] [PATCH 1/2] conf: Reset disk type if element is completely missing

2019-10-15 Thread Peter Krempa
The disk type is not part of source and thus it's parsed earlier. This bypasses the checks when parsing a disk type='network' if it's completely missing the source. Since there are possible active users of this (it was reported as a problem with openstack) fix it by resetting the disk type to '_FI

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

2019-10-15 Thread Michal Privoznik
On 10/15/19 3:15 PM, Pavel Mores wrote: 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

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

2019-10-15 Thread Daniel Henrique Barboza
On 10/15/19 9:55 AM, Daniel P. Berrangé wrote: 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_dri

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

2019-10-15 Thread Michal Privoznik
On 10/15/19 2:21 PM, Ján Tomko wrote: Ján Tomko (8): > Reviewed-by: Michal Privoznik Michal -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

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

2019-10-15 Thread Andrea Bolognani
On Tue, 2019-10-15 at 14:21 +0200, Ján Tomko wrote: > 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. [...] > -#define ARRA

Re: [libvirt] [PATCH 0/2] conf: Fix up empty 'network' cdroms

2019-10-15 Thread Michal Privoznik
On 10/15/19 3:35 PM, Peter Krempa wrote: Peter Krempa (2): conf: Reset disk type if element is completely missing tests: Add test case for empty 'network' cdrom src/conf/domain_conf.c| 4 +++ ...m-empty-network-invalid.x86_64-latest.args | 34 ++

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

2019-10-15 Thread Pavel Mores
On Tue, Oct 15, 2019 at 03:45:55PM +0200, Michal Privoznik wrote: > On 10/15/19 3:15 PM, Pavel Mores wrote: > > 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 ha

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

2019-10-15 Thread Cole Robinson
On 10/15/19 12:29 AM, Han Han wrote: > I find the issue cannot reproduced when `make clean` before build the > source. > It is not proper to build with an unclean source dir, right? > I don't use 'make clean' in libvirt.git but in other projects I have hit issues that required 'make clean', like

[libvirt] [PATCH v3 REBASE 00/12] hostdev: handle usb detach/attach on node

2019-10-15 Thread Nikolay Shirokovskiy
Diff to v2[1] version: - add 'replug' attribute for hostdev element to allow replug semantics - avoid accuiring domain lock in event loop thread on udev events as suggested by Peter - nit picks after review by Daniel Henrique Barboza * is used to mark patches that were 'Reviewed-by' by Daniel (s

[libvirt] [PATCH v3 REBASE 09/12] qemu: handle host usb device plug/unplug when libvirtd is down

2019-10-15 Thread Nikolay Shirokovskiy
Somebody can easily unplug usb device from host while libvirtd is being stopped. Also usb device can be plugged or unplugged/plugged back and so forth. Let's handle such cases. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_process.c | 56

[libvirt] [PATCH v3 REBASE 06/12] qemu: handle libvirtd restart after host usb device unplug

2019-10-15 Thread Nikolay Shirokovskiy
It is possible for libvirtd to go down before DEVICE_DELETED event is delivered upon usb hostdev unplug and to receive the event after the libvirtd is up. In order to handle this case we need to save usb hostdev deleteAction in status file. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel

[libvirt] [PATCH v3 REBASE 10/12] qemu: don't mess with non mandatory hostdevs on reattaching

2019-10-15 Thread Nikolay Shirokovskiy
First I don't want to add code to handle dummy device that is used when host usb device is not present at the moment of starting/migrating etc. Second supporting non mandatory policies would require to handle races when host usb device is plugged to host and libvirtd starts adding device but if in

[libvirt] [PATCH v3 REBASE 03/12] qemu: support host usb device unplug

2019-10-15 Thread Nikolay Shirokovskiy
Handle host usb device unplug in DEVICE_DELETED handle execution path. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_hotplug.c | 38 +++--- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_h

[libvirt] [PATCH v3 REBASE 12/12] conf: parse hostdev missing flag

2019-10-15 Thread Nikolay Shirokovskiy
We want to keep this flag across libvirtd restarts. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d185730023..35006cac8c 100644 -

[libvirt] [PATCH v3 REBASE 04/12] qemu: support usb hostdev plugging back

2019-10-15 Thread Nikolay Shirokovskiy
We are going to use qemuDomainAttachHostUSBDevice when host usb device is plugged back to node. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_hotplug.c | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a

[libvirt] [PATCH v3 REBASE 01/12] conf: add replug option for usb hostdev

2019-10-15 Thread Nikolay Shirokovskiy
If usb device attached to a domain is unplugged from host and then plugged back then it will no longer be available in guest. We are going to support this case so that device will be detached from qemu on unplug and attached back on replug. As sometimes this behaviour is not desirable and for backc

[libvirt] [PATCH v3 REBASE 08/12] qemu: hotplug: update device list on device deleted event

2019-10-15 Thread Nikolay Shirokovskiy
I guess this is the missing piece for [1]. It did not hurt before (like we didn't even see any errors/warns in logs) because in qemuProcessUpdateDevices function virDomainDefFindDevice does not find device deleted from libvirt config. But now in case of unpluggind usb device from host we leave devi

[libvirt] [PATCH v3 REBASE 05/12] qemu: handle host usb device add/del udev events

2019-10-15 Thread Nikolay Shirokovskiy
Now when code handling attaching/detaching usb hostdev is appropriately changed use it to handle host usb device udev add/del events. As device adding/deleting needs acquiring job condition it is done in thread pool rather in event loop thread itself where udev events are delivered. However implem

[libvirt] [PATCH v3 REBASE 11/12] qemu: handle detaching of unplugged hostdev

2019-10-15 Thread Nikolay Shirokovskiy
If hostdev is unplugged we don't need to delete it's correspondent device from qemu etc. Just remove it from config immediately. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_hotplug.c | 16 +++- src/util/virhostdev.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-

[libvirt] [PATCH v3 REBASE 02/12] qemu: track hostdev delete intention

2019-10-15 Thread Nikolay Shirokovskiy
So we are going to support replug of usb device on host. We need to delete device from qemu when the device is unplugged on host and to add device when the device is plugged back. As to deleting let's use same code as when we detach device from domain. But we need to keep the usb hostdev etc in lib

[libvirt] [PATCH v3 REBASE 07/12] qemu: handle race on device deletion and usb host device plugging

2019-10-15 Thread Nikolay Shirokovskiy
Imagine host usb device is unplugged from host and as a result we send command to qemu to delete appropriate device. Then before qemu device is deleted host usb device is plugged back. Currently code supposes there is no remnant device in qemu and will try to add new device and the attempt will fai

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

2019-10-15 Thread Cole Robinson
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 > command to prevent accidental shrinking of a block device. This > behaviour is already pr

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

2019-10-15 Thread Ján Tomko
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: 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 tho

[libvirt] [PATCH 1/9] util: xml: use g_auto directly for VIR_XPATH_NODE_AUTORESTORE

2019-10-15 Thread Ján Tomko
Since commit 44e7f029159ed701b4a1739ac711507ee53790ed util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOCLEAN is just an alias for g_auto. Use the GLib macros directly instead of our custom aliases. Signed-off-by: Ján Tomko --- src/util/virxml.h | 6 +++--- 1 file changed,

[libvirt] [PATCH 8/9] Delete virObjectAutoUnref

2019-10-15 Thread Ján Tomko
Signed-off-by: Ján Tomko --- src/libvirt_private.syms | 1 - src/util/virobject.c | 14 -- src/util/virobject.h | 15 --- 3 files changed, 30 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7d62df8086..0da02bb8bd 100644 --- a/s

[libvirt] [PATCH 2/9] virbuffer: use g_auto directly for virBuffer

2019-10-15 Thread Ján Tomko
Since commit 44e7f029159ed701b4a1739ac711507ee53790ed util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOCLEAN is just an alias for g_auto. Use the GLib macros directly instead of our custom aliases. Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 100 +++

[libvirt] [PATCH 4/9] Use G_DEFINE_AUTOPTR_CLEANUP_FUNC instead of VIR_DEFINE_AUTOPTR_FUNC

2019-10-15 Thread Ján Tomko
Since commit 44e7f029159ed701b4a1739ac711507ee53790ed util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOPTR aliases to g_autoptr. Replace all uses of VIR_DEFINE_AUTOPTR_FUNC with G_DEFINE_AUTOPTR_CLEANUP_FUNC in preparation for replacing the rest. Signed-off-by: Ján Tomko --

[libvirt] [PATCH 6/9] Define G_DEFINE_AUTOPTR_CLEANUP_FUNC for virDomainCheckpointDef

2019-10-15 Thread Ján Tomko
Allow g_autoptr to be used instead of VIR_AUTOUNREF. Signed-off-by: Ján Tomko --- src/conf/checkpoint_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h index 2be041ff56..982096abed 100644 --- a/src/conf/checkpoint_conf.h +++ b/src/

[libvirt] [PATCH 9/9] Remove virautoclean.h

2019-10-15 Thread Ján Tomko
Now that we no longer use any of the macros from this file, remove it. This also removes a typo. Signed-off-by: Ján Tomko --- src/conf/domain_capabilities.h | 1 - src/conf/storage_conf.h | 1 - src/qemu/qemu_firmware.h | 1 - src/qemu/qemu_migration_params.h | 1 - src/q

[libvirt] [PATCH 7/9] Use g_autoptr instead of VIR_AUTOUNREF

2019-10-15 Thread Ján Tomko
Now that all the types using VIR_AUTOUNREF have a cleanup func defined to virObjectUnref, use g_autoptr instead of VIR_AUTOUNREF. Signed-off-by: Ján Tomko --- src/conf/checkpoint_conf.c | 2 +- src/conf/domain_conf.c | 24 src/esx/esx_drive

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

2019-10-15 Thread Ján Tomko
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 instead of VIR_AUTOPTR Define G_DEFINE_AUTO

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

2019-10-15 Thread Jiri Denemark
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(+) create mode 100644 tests/domaincapsschemadata/qemu_4.2.0.s390

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

2019-10-15 Thread Jiri Denemark
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 virQEMUCapsGetCPUDefinitions because the internals of this function w

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

2019-10-15 Thread Jiri Denemark
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(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index b0fdd15d6c..32

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

2019-10-15 Thread Jiri Denemark
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 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_4.2.

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

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7d62df8086..1af18b880b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.sy

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

2019-10-15 Thread Jiri Denemark
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(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 87a9d06d45..8d86112f30

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

2019-10-15 Thread Jiri Denemark
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 after such virDomainCapsCPUModels structure is stored in capabili

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

2019-10-15 Thread Jiri Denemark
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: - new patch src/qemu/qemu_capabilities.c | 28 ++

[libvirt] [PATCH v2 17/31] qemu: Split virQEMUCapsFetchCPUModels

2019-10-15 Thread Jiri Denemark
Most of the code moved to a new virQEMUCapsFetchCPUDefinitions function and the existing virQEMUCapsFetchCPUModels just becomes a small wrapper around virQEMUCapsFetchCPUDefinitions and virQEMUCapsCPUDefsToModels. Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch src/qemu/

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

2019-10-15 Thread Jiri Denemark
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 probing code. Signed-off-by: Jiri Denemark --- Notes: Versi

[libvirt] [PATCH v2 20/31] conf: Drop virDomainCapsCPUModelsAddSteal

2019-10-15 Thread Jiri Denemark
Both virDomainCapsCPUModelsAdd and virDomainCapsCPUModelsAddSteal are so simple we can just squash the code in a single function. Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 33 ++--- src/conf/domain_capabi

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

2019-10-15 Thread Jiri Denemark
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 src/qemu/qemu_capabilities.c | 3 + src/qemu/qemu_monitor.c | 2 + src/qe

[libvirt] [PATCH v2 07/31] qemu: Use virQEMUCapsGetCPUDefinitions more

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e6a7ee4f14..b6

[libvirt] [PATCH v2 00/31] qemu: Store default CPU in domain XML

2019-10-15 Thread Jiri Denemark
When starting a domain without a CPU model specified in the domain XML, QEMU will choose a default one. Which is fine unless the domain gets migrated to another host because libvirt doesn't perform any CPU ABI checks and the virtual CPU provided by QEMU on the destination host can differ from the o

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

2019-10-15 Thread Jiri Denemark
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 a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c638077aa8..9dcba4ef38 1

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

2019-10-15 Thread Jiri Denemark
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 ++ ...fault-cpu-tcg-virt-4.2.aarch64-latest.args | 38 +++ .../aarch64-defau

[libvirt] [PATCH v2 22/31] qemu: Probe for default CPU types

2019-10-15 Thread Jiri Denemark
QEMU 4.2.0 will report default CPU types used by each machine type and we will want to start using it. Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change except for updated test results src/qemu/qemu_capabilities.c | 15 ++- src/qemu/qemu_monitor.c

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

2019-10-15 Thread Jiri Denemark
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(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index d3447dd2f3..418bdcec92 100644 -

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

2019-10-15 Thread Jiri Denemark
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 changed, 37 deletions(-) diff --git a/src/conf/domain_capabiliti

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

2019-10-15 Thread Jiri Denemark
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 + ...ault-cpu-kvm-pseries-3.1.ppc64-latest.args | 38 .../ppc64-default-cpu-kv

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

2019-10-15 Thread Jiri Denemark
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 src/qemu/qemu_capabilities.c | 14 +++--- src/qemu/qemu_moni

[libvirt] [PATCH v2 06/31] qemu: Filter models in virQEMUCapsGetCPUDefinitions

2019-10-15 Thread Jiri Denemark
Some callers of virQEMUCapsGetCPUDefinitions will need to filter the returned list of CPU models. Let's add the filtering parameters directly to virQEMUCapsGetCPUDefinitions to avoid copying the CPU models list twice. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2:

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

2019-10-15 Thread Jiri Denemark
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 to be changed because of the previous patch src/qemu/qem

[libvirt] [PATCH v2 15/31] qemu: Introduce virQEMUCapsCPUDefsToModels

2019-10-15 Thread Jiri Denemark
The function translates qemuMonitorCPUDefsPtr (used by QEMU caps probing code) into virDomainCapsCPUModelsPtr used by domain capabilities. Signed-off-by: Jiri Denemark --- Notes: Version 2: - trivial rebase src/qemu/qemu_capabilities.c | 71 +--- 1 file

[libvirt] [PATCH v2 04/31] conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd

2019-10-15 Thread Jiri Denemark
All callers use nameLen == -1 anyway. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 7 +++ src/conf/domain_capabilities.h | 1 - src/qemu/qemu_capabilities.c | 2 +- tests/cputest.c| 4 ++--

[libvirt] [PATCH v2 14/31] qemu: Use VIR_AUTOFREE in virQEMUCapsLoadCPUModels

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 58 +++- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c inde

[libvirt] [PATCH v2 24/31] qemu: Drop unused virQEMUCapsGetDefaultMachine

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 12 src/qemu/qemu_capabilities.h | 1 - 2 files changed, 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dd7ea9ae86..bd54c1751c 100

[libvirt] [PATCH v2 23/31] qemu: Introduce virQEMUCapsGetMachineDefaultCPU

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- Notes: Version 2: - fix crash with CPUs without type src/qemu/qemu_capabilities.c | 36 src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 39 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qe

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

2019-10-15 Thread Jiri Denemark
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 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -151,6 +151,7 @@ vi

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

2019-10-15 Thread Jiri Denemark
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 ++ ...t-cpu-tcg-ccw-virtio-4.2.s390x-latest.args | 31 +++ .../s390-default-

[libvirt] [PATCH v2 30/31] qemuxml2*test: Add test cases for default CPU models on x86_64

2019-10-15 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- Notes: Version 2: - new patch ...-default-cpu-kvm-pc-4.2.x86_64-latest.args | 36 +++ .../x86_64-default-cpu-kvm-pc-4.2.xml | 24 ...default-cpu-kvm-q35-4.2.x86_64-latest.args | 41 + .../x86_64-default-cpu-kvm-q35-4.

[libvirt] [PATCH v2 31/31] qemu: Store default CPU in domain XML

2019-10-15 Thread Jiri Denemark
When starting a domain without a CPU model specified in the domain XML, QEMU will choose a default one. Which is fine unless the domain gets migrated to another host because libvirt doesn't perform any CPU ABI checks and the virtual CPU provided by QEMU on the destination host can differ from the o

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

2019-10-15 Thread Cole Robinson
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 + /usr/bin/qemu-kvm But a new VM is defined with

Re: [libvirt] [PATCH v2 2/6] qemu: use VIR_AUTOUNREF in qemuDomainDeviceDefValidate()

2019-10-15 Thread Cole Robinson
On 10/11/19 5:27 PM, Jonathon Jongsma wrote: > This allows us to simplify the function and avoid jumping to 'cleanup'. > > Signed-off-by: Jonathon Jongsma > --- > src/qemu/qemu_domain.c | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/src/qemu/qemu_domain.c

Re: [libvirt] [PATCH v2 4/6] qemu: consolidate video validation

2019-10-15 Thread Cole Robinson
On 10/11/19 5:27 PM, Jonathon Jongsma wrote: > Move video validation logic from qemuProcessStartValidateVideo() to > qemuDomainDeviceDefValidateVideo() (which is in fact called from the > aforementioned function). > As mentioned in the other response, this patch adds a lot of test suite breakage.

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

2019-10-15 Thread Cole Robinson
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 > qemu-kvm-4.1.0-13.module+el8.1.0+4313+ef76ec61.x86_64 > > Steps: > 1. Convert a OS

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

2019-10-15 Thread Daniel P . Berrangé
On Tue, Oct 15, 2019 at 10:51:39AM -0300, Daniel Henrique Barboza wrote: > > > On 10/15/19 9:55 AM, Daniel P. Berrangé wrote: > > 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,

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

2019-10-15 Thread Daniel P . Berrangé
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: > > 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

  1   2   >