Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Peter Krempa
On Mon, Sep 30, 2019 at 15:53:35 +0100, Daniel Berrange wrote: > On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > > On Mon, 2019-09-30 at 13:41 +0100, Daniel P. Berrangé wrote: > > > On Mon, Sep 30, 2019 at 02:18:17PM +0200, Andrea Bolognani wrote: > > > > On Mon, 2019-09-30 at

Re: [libvirt] [PATCH 0/2] qemu: Sanitize update of 'current' checkpoint/snapshot

2019-09-30 Thread Michal Privoznik
On 9/30/19 4:42 PM, Peter Krempa wrote: See 1/2. Peter Krempa (2): qemu: snapshot: Don't update current snapshot until we're done qemu: checkpoint: Don't update current checkpoint until we are done src/qemu/qemu_checkpoint.c | 7 --- src/qemu/qemu_driver.c | 19

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Peter Krempa
On Mon, Sep 30, 2019 at 16:10:11 +0100, Daniel Berrange wrote: > On Mon, Sep 30, 2019 at 05:03:47PM +0200, Peter Krempa wrote: > > On Mon, Sep 30, 2019 at 15:53:35 +0100, Daniel Berrange wrote: > > > On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > > > > On Mon, 2019-09-30 at

Re: [libvirt] [PATCH v2 0/6] rewrite virt-host-validate to be data driven, using Go & YAML

2019-09-30 Thread Peter Krempa
On Mon, Sep 30, 2019 at 15:48:29 +0100, Daniel Berrange wrote: > On Mon, Sep 30, 2019 at 10:47:39AM +0200, Martin Kletzander wrote: > > On Fri, Sep 27, 2019 at 01:52:19PM +0100, Daniel P. Berrangé wrote: > > > This is a followup to a previous PoC patch I submitted a > > > month ago: [...] > >

Re: [libvirt] [PATCH v2 6/6] tools: make virt-host-validate check CPU vulnerabilities

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 05:10:10PM +0200, Andrea Bolognani wrote: > On Mon, 2019-09-30 at 15:30 +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 30, 2019 at 10:55:00AM +0200, Martin Kletzander wrote: > > > Given the fact that most of these could just be virFileReadValueUint() it > > > does > > >

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 05:24:00PM +0200, Peter Krempa wrote: > On Mon, Sep 30, 2019 at 16:10:11 +0100, Daniel Berrange wrote: > > On Mon, Sep 30, 2019 at 05:03:47PM +0200, Peter Krempa wrote: > > > On Mon, Sep 30, 2019 at 15:53:35 +0100, Daniel Berrange wrote: > > > > On Mon, Sep 30, 2019 at

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 05:17:32PM +0200, Andrea Bolognani wrote: > On Mon, 2019-09-30 at 15:53 +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > > > I see your point about backports being more painful when you have > > > a bunch of unrelated

Re: [libvirt] [PATCH v2] docs: attempt to document the general libvirt dev strategy

2019-09-30 Thread Andrea Bolognani
On Tue, 2019-09-24 at 16:33 +0100, Daniel P. Berrangé wrote: > + Throughout the document: s/meson/Meson/g s/M4/m4/g > + > +http://www.w3.org/1999/xhtml;> > + > +Libvirt Project Strategy s/Libvirt// (it's redundant here). > + > + > + This document attempts to outline the

Re: [libvirt] [PATCH v1 0/3] Adding the 'ccf-assist' pSeries capability

2019-09-30 Thread Daniel Henrique Barboza
Ping On 9/16/19 3:37 PM, Daniel Henrique Barboza wrote: Hi, This short series exposes, implements and documents a pSeries guest capability called Count Cache Flush Assist (ccf-assist), which was added in the Linux kernel since 5.1 and in QEMU since 4.0.0. The reason why this capability needs

Re: [libvirt] [PATCH v2] security: AppArmor profile fixes for swtpm

2019-09-30 Thread Michal Privoznik
On 9/24/19 9:25 PM, Chris Coulson wrote: The AppArmor profile generated by virt-aa-helper is too strict for swtpm. This change contains 2 small fixes: - Relax append access to swtpm's log file to permit write access instead. Append access is insufficient because the log is opened with O_CREAT. -

Re: [libvirt] [PATCH v2] docs: attempt to document the general libvirt dev strategy

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 03:27:30PM +0200, Michal Privoznik wrote: > On 9/24/19 5:33 PM, Daniel P. Berrangé wrote: > > There are various ideas / plans floating around for future libvirt work, > > some of which is actively in progress. Historically we've never captured > > this kind of information

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Andrea Bolognani
On Mon, 2019-09-30 at 13:41 +0100, Daniel P. Berrangé wrote: > On Mon, Sep 30, 2019 at 02:18:17PM +0200, Andrea Bolognani wrote: > > On Mon, 2019-09-30 at 13:56 +0200, Pavel Hrdina wrote: > > > Agreed, for now let's keep all the wrappers but eventually we can remove > > > them to make the code

Re: [libvirt] [PATCH 07/11] util: convert virIdentity class to use GObject

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:29PM +0100, Daniel P. Berrangé wrote: > Converting from virObject to GObject is reasonably straightforward, > as illustrated by this patch for virIdentity > > In the header file > > - Remove > > typedef struct _virIdentity virIdentity > > - Add > >

Re: [libvirt] [PATCH v2 0/6] rewrite virt-host-validate to be data driven, using Go & YAML

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 10:47:39AM +0200, Martin Kletzander wrote: > On Fri, Sep 27, 2019 at 01:52:19PM +0100, Daniel P. Berrangé wrote: > > This is a followup to a previous PoC patch I submitted a > > month ago: > > > > https://www.redhat.com/archives/libvir-list/2019-September/msg00036.html >

[libvirt] [PATCH 1/3] qemu: Add vhost-user-scsi/blk support

2019-09-30 Thread Li Feng
Vhost-user-scsi and vhost-user-blk is supported in Qemu, this patch add support in libvirt. Hotplug is also support here. Usage like this: Signed-off-by: Li Feng --- src/conf/domain_conf.c | 79 - src/conf/domain_conf.h

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-09-30 Thread Hu, Robert
> -Original Message- > From: Eduardo Habkost > Sent: Monday, September 30, 2019 22:11 > To: Jiri Denemark > Cc: libvir-list@redhat.com; qemu-de...@nongnu.org; Paolo Bonzini > ; Daniel P. Berrangé ; Kang, > Luwei ; thomas.lenda...@amd.com; Robert Hoo > ; Richard Henderson ; Jiri >

[libvirt] [PATCH 3/3] qemu: Add multiqueue support for vhost-user-scsi/blk

2019-09-30 Thread Li Feng
The format like this: Signed-off-by: Li Feng --- src/conf/device_conf.h | 5 + src/conf/domain_conf.c | 14 ++ src/qemu/qemu_command.c

[libvirt] [PATCH 2/3] vhost-user-scsi/blk: add xml validation check

2019-09-30 Thread Li Feng
Add vhost-user-scsi/blk xml schema to validate the correctness when editing the xml for the new chardev. Signed-off-by: Li Feng --- docs/schemas/domaincommon.rng | 48 +++ 1 file changed, 48 insertions(+) diff --git a/docs/schemas/domaincommon.rng

[libvirt] [PATCH 0/3] Add vhost-user-scsi/blk support

2019-09-30 Thread Li Feng
The latest qemu has support the vhost-user-scsi and vhost-user-blk backend for better performance. This patch let the libvirt could manage the vhost-user disks. Usage in xml like this: Li Feng (3): qemu: Add vhost-user-scsi/blk support

Re: [libvirt] [PATCH 08/11] src: convert over to use GRegex for regular exprssions

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:30PM +0100, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/conf/domain_event.c| 25 --- > src/libxl/libxl_capabilities.c | 44 -- > 2 files changed, 31 insertions(+), 38 deletions(-)

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 05:03:47PM +0200, Peter Krempa wrote: > On Mon, Sep 30, 2019 at 15:53:35 +0100, Daniel Berrange wrote: > > On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > > > On Mon, 2019-09-30 at 13:41 +0100, Daniel P. Berrangé wrote: > > > > On Mon, Sep 30, 2019 at

Re: [libvirt] [PATCH v2 6/6] tools: make virt-host-validate check CPU vulnerabilities

2019-09-30 Thread Andrea Bolognani
On Mon, 2019-09-30 at 15:30 +0100, Daniel P. Berrangé wrote: > On Mon, Sep 30, 2019 at 10:55:00AM +0200, Martin Kletzander wrote: > > Given the fact that most of these could just be virFileReadValueUint() it > > does > > not even make it easier to read or write the code. > > Errr,

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Andrea Bolognani
On Mon, 2019-09-30 at 15:53 +0100, Daniel P. Berrangé wrote: > On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > > I see your point about backports being more painful when you have > > a bunch of unrelated changes mixed in, but I would still prefer if > > we converted everything

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-09-30 Thread Paolo Bonzini
On 30/09/19 16:31, Hu, Robert wrote: >> This might be a problem if there are plans to eventually make KVM support >> pconfig, though. Paolo, Robert, are there plans to support pconfig in KVM >> in the >> future? > [Robert Hoo] > Thanks Eduardo for efforts in resolving this issue, introduced

Re: [libvirt] [PATCH 0/3] Add vhost-user-scsi/blk support

2019-09-30 Thread Michal Privoznik
On 9/30/19 8:54 AM, Li Feng wrote: The latest qemu has support the vhost-user-scsi and vhost-user-blk backend for better performance. This patch let the libvirt could manage the vhost-user disks. Usage in xml like this: This is not so nice

Re: [libvirt] [PATCH 1/2] qemu: snapshot: Don't update current snapshot until we're done

2019-09-30 Thread Ján Tomko
On Mon, Sep 30, 2019 at 04:42:45PM +0200, Peter Krempa wrote: Since commit f105627992e we store whether a snapshot is current globally rather than locally in the snapshot object. This means that we don't have to unset the current snapshot prior to taking/reverting the snapshot and we can do it

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Andrea Bolognani
On Mon, 2019-09-30 at 16:34 +0100, Daniel P. Berrangé wrote: > On Mon, Sep 30, 2019 at 05:24:00PM +0200, Peter Krempa wrote: > > On Mon, Sep 30, 2019 at 16:10:11 +0100, Daniel Berrange wrote: > > > It don't be in a half-done state forever. We can let things be converted > > > incrementally over

[libvirt] [PATCH] admin: fix memory leak of typed parameters getting client info

2019-09-30 Thread Daniel P . Berrangé
In the error code path, the temporary parameters are not freed. Signed-off-by: Daniel P. Berrangé --- src/admin/admin_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c index 248df3f795..0d6091937d 100644 ---

Re: [libvirt] [PATCH] qemu_capabilities: Put only unique FW images into domcaps

2019-09-30 Thread Andrea Bolognani
On Thu, 2019-09-12 at 15:31 +0200, Michal Privoznik wrote: > In the domain capabilities XML there are FW image paths printed. > There are two sources for the image paths (in order of > preference): > > 1) firmware descriptor files - as returned by > qemuFirmwareGetSupported() > > 2) a

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-09-30 Thread Jiri Denemark
On Mon, Sep 30, 2019 at 17:16:27 +0200, Paolo Bonzini wrote: > On 30/09/19 16:31, Hu, Robert wrote: > >> This might be a problem if there are plans to eventually make KVM support > >> pconfig, though. Paolo, Robert, are there plans to support pconfig in KVM > >> in the > >> future? > > [Robert

Re: [libvirt] [PATCH 07/11] util: convert virIdentity class to use GObject

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 03:04:38PM +0200, Ján Tomko wrote: > On Fri, Sep 27, 2019 at 06:17:29PM +0100, Daniel P. Berrangé wrote: > > Converting from virObject to GObject is reasonably straightforward, > > as illustrated by this patch for virIdentity > > > > The change would be much easier to see

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-09-30 Thread Eduardo Habkost
CCing qemu-devel and QEMU developers. On Mon, Sep 30, 2019 at 12:24:53PM +0200, Jiri Denemark wrote: > On Thu, Sep 26, 2019 at 18:43:05 -0300, Eduardo Habkost wrote: > > The pconfig feature never worked, and adding "pconfig=off" to the > > QEMU command-line triggers a regression in QEMU 3.1.1 and

Re: [libvirt] [PATCH v2 0/6] rewrite virt-host-validate to be data driven, using Go & YAML

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 12:03:22PM +0200, Andrea Bolognani wrote: > On Fri, 2019-09-27 at 13:52 +0100, Daniel P. Berrangé wrote: > > The really big difference though is that I replaced the use > > of XML data files with YAML data files. This was done with > > the aim of making the data more human

[libvirt] [PATCH v2 0/2] make attaching disk partition to VM illegal

2019-09-30 Thread Pavel Mores
This version addresses comments and objections to the original submission. Pavel Mores (2): qemu: make attaching disk partition to VM illegal remove a now redundant call to virDiskNameToIndex() src/qemu/qemu_command.c | 6 - src/qemu/qemu_domain.c

Re: [libvirt] [PATCH] clarify the xml example for NVDIMM more clealy

2019-09-30 Thread Michal Privoznik
On 9/23/19 12:06 PM, Luyao Zhong wrote: The NVDIMM backend file can be a normal file or a real device file, Current xml example and explainations may mislead users. So add more info about the NVDIMM related elements and update the xml examples. Signed-off-by: Luyao Zhong ---

[libvirt] [PATCH 2/2] qemu: checkpoint: Don't update current checkpoint until we are done

2019-09-30 Thread Peter Krempa
Similarly to the snapshot code there's no reason to modify current checkpoint until we are done creating the new one. Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c

[libvirt] [PATCH v2 1/2] qemu: make attaching disk partition to VM illegal

2019-09-30 Thread Pavel Mores
The way in which the qemu driver generates aliases for disks involves ignoring the partition number part of a target dev name. This means that all partitions of a block device and the device itself all end up with the same alias. If multiple such disks are specified in XML, the resulting name

[libvirt] [PATCH v2 2/2] remove a now redundant call to virDiskNameToIndex()

2019-09-30 Thread Pavel Mores
Parseability of disk name is now checked in qemuDomainDeviceDefValidateDisk(). Signed-off-by: Pavel Mores --- src/qemu/qemu_command.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 77470a6037..890d89b92c 100644 ---

Re: [libvirt] [PATCH 4/4] qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull

2019-09-30 Thread Peter Krempa
On Mon, Sep 30, 2019 at 16:22:34 +0200, Michal Privoznik wrote: > On 9/27/19 3:05 PM, Peter Krempa wrote: > > Use VIR_AUTORELEASE instead. > > > > Signed-off-by: Peter Krempa > > --- > > src/qemu/qemu_driver.c | 8 +++- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff

Re: [libvirt] [PATCH v2 6/6] tools: make virt-host-validate check CPU vulnerabilities

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 10:55:00AM +0200, Martin Kletzander wrote: > On Fri, Sep 27, 2019 at 01:52:25PM +0100, Daniel P. Berrangé wrote: > > Add a check reporting if any CPU vulnerabilities have not been mitigated > > by the kernel. It further reports whether it is safe to use Intel SMT > > for

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 04:05:57PM +0200, Andrea Bolognani wrote: > On Mon, 2019-09-30 at 13:41 +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 30, 2019 at 02:18:17PM +0200, Andrea Bolognani wrote: > > > On Mon, 2019-09-30 at 13:56 +0200, Pavel Hrdina wrote: > > > > Agreed, for now let's keep all

Re: [libvirt] [PATCH 07/11] util: convert virIdentity class to use GObject

2019-09-30 Thread Ján Tomko
On Fri, Sep 27, 2019 at 06:17:29PM +0100, Daniel P. Berrangé wrote: Converting from virObject to GObject is reasonably straightforward, as illustrated by this patch for virIdentity The change would be much easier to see if this patch did not contain the g_autofree changes and the removal of

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 09:02:36AM +0200, Peter Krempa wrote: > On Fri, Sep 27, 2019 at 18:17:28 +0100, Daniel Berrange wrote: > > Replace use of the gnulib base64 module with glib's own base64 API family. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > bootstrap.conf|

Re: [libvirt] [PATCH v2] docs: attempt to document the general libvirt dev strategy

2019-09-30 Thread Michal Privoznik
On 9/24/19 5:33 PM, Daniel P. Berrangé wrote: There are various ideas / plans floating around for future libvirt work, some of which is actively in progress. Historically we've never captured this kind of information anywhere, except in mailing list discussions. In particular guidelines in

Re: [libvirt] [PATCH 4/4] qemu: Don't repeat virDomainObjEndAPI in qemuDomainBlockPull

2019-09-30 Thread Michal Privoznik
On 9/27/19 3:05 PM, Peter Krempa wrote: > Use VIR_AUTORELEASE instead. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_driver.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index

Re: [libvirt] [PATCH 0/4] Automatic lockable object unlocking

2019-09-30 Thread Michal Privoznik
On 9/27/19 3:05 PM, Peter Krempa wrote: A spin-off from the refactors to checkpoints where Eric suggested that we might want to replace virDomainObjEndAPI. See patch 2 for the implementation and patch 3 for example use. Peter Krempa (4): util: object: Note that VIR_AUTOUNREF variables must

[libvirt] [PATCH 0/2] qemu: Sanitize update of 'current' checkpoint/snapshot

2019-09-30 Thread Peter Krempa
See 1/2. Peter Krempa (2): qemu: snapshot: Don't update current snapshot until we're done qemu: checkpoint: Don't update current checkpoint until we are done src/qemu/qemu_checkpoint.c | 7 --- src/qemu/qemu_driver.c | 19 --- 2 files changed, 26 deletions(-) --

[libvirt] [PATCH 1/2] qemu: snapshot: Don't update current snapshot until we're done

2019-09-30 Thread Peter Krempa
Since commit f105627992e we store whether a snapshot is current globally rather than locally in the snapshot object. This means that we don't have to unset the current snapshot prior to taking/reverting the snapshot and we can do it only when everything is done tsuccessfully. Signed-off-by:

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Laine Stump
On 9/30/19 10:05 AM, Andrea Bolognani wrote: On Mon, 2019-09-30 at 13:41 +0100, Daniel P. Berrangé wrote: On Mon, Sep 30, 2019 at 02:18:17PM +0200, Andrea Bolognani wrote: On Mon, 2019-09-30 at 13:56 +0200, Pavel Hrdina wrote: Agreed, for now let's keep all the wrappers but eventually we can

[libvirt] [PATCH v2 9/9] qemu_driver: VIR_AUTOFREE on other scalar pointers

2019-09-30 Thread Daniel Henrique Barboza
This patch uses VIR_AUTOFREE on instances of 'unsigned int *' and 'unsigned long long *' found in qemu_driver.c. Suggested-by: Erik Skultety Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH v2 8/9] qemu_driver: use VIR_AUTOFREE() with strings 3/3

2019-09-30 Thread Daniel Henrique Barboza
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. This is the last part of this change. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 99

[libvirt] [PATCH v2 1/9] qemu_driver: use VIR_AUTOUNREF() with virQEMUDriverConfigPtr 1/3

2019-09-30 Thread Daniel Henrique Barboza
virQEMUDriverConfigPtr can be auto-unref for the great majority of the uses made in qemu_driver, sparing us a virObjectUnref() call and sometimes a whole 'cleanup' label. This patch changes virQEMUDriverConfigPtr declarations to use VIR_AUTOUNREF(). 'cleanup' labels were deleted when applicable.

[libvirt] [PATCH v2 6/9] qemu_driver: use VIR_AUTOFREE() with strings 1/3

2019-09-30 Thread Daniel Henrique Barboza
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. This is a huge change due to the amount of char * declared in this file, thus let's split it in 3. This is the first part. Signed-off-by:

[libvirt] [PATCH v2 5/9] qemu_driver: use VIR_AUTOUNREF() with more pointer types

2019-09-30 Thread Daniel Henrique Barboza
This patch uses VIR_AUTOUNREF() with the following pointer types: - virQEMUCapsPtr - virConnect - qemuDomainSaveCookiePtr - virDomainCapsPtr - qemuBlockJobDataPtr* - virNetworkPtr - virSecurityManagerPtr 'cleanup' labels were deleted when possible. * instances being cleaned up with

[libvirt] [PATCH v2 2/9] qemu_driver: use VIR_AUTOUNREF() with virQEMUDriverConfigPtr 2/3

2019-09-30 Thread Daniel Henrique Barboza
virQEMUDriverConfigPtr can be auto-unref for the great majority of the uses made in qemu_driver, sparing us a virObjectUnref() call and sometimes a whole 'cleanup' label. This patch changes virQEMUDriverConfigPtr declarations to use VIR_AUTOUNREF(). 'cleanup' labels were deleted when applicable.

[libvirt] [PATCH v2 4/9] qemu_driver: use VIR_AUTOUNREF() with virCapsPtr

2019-09-30 Thread Daniel Henrique Barboza
virCapsPtr can be auto-unref for the great majority of the uses made in qemu_driver, sparing us a virObjectUnref() call and sometimes a whole 'cleanup' label. This patch changes virCapsPtr declarations to use VIR_AUTOUNREF(). 'cleanup' labels were deleted when possible. Suggested-by: Erik

[libvirt] [PATCH v2 7/9] qemu_driver: use VIR_AUTOFREE() with strings 2/3

2019-09-30 Thread Daniel Henrique Barboza
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. This is a huge change due to the amount of char * declared in this file, thus let's split it in 3. This is the second part. Signed-off-by:

[libvirt] [PATCH v2 3/9] qemu_driver: use VIR_AUTOUNREF() with virQEMUDriverConfigPtr 3/3

2019-09-30 Thread Daniel Henrique Barboza
virQEMUDriverConfigPtr can be auto-unref for the great majority of the uses made in qemu_driver, sparing us a virObjectUnref() call and sometimes a whole 'cleanup' label. This patch changes virQEMUDriverConfigPtr declarations to use VIR_AUTOUNREF(). 'cleanup' labels were deleted when applicable.

[libvirt] [PATCH v2 0/9] use VIR_AUTO* all around qemu_driver.c

2019-09-30 Thread Daniel Henrique Barboza
I am messing a lot with qemu_driver.c and other QEMU files due to a multifunction PCI feature I'm working on, ending up sometimes moving code here and there, sometimes copy and pasting parts of it, and spreading all these 'vices', namely using char* and VIR_FREE() and virQEMUDriverConfigPtr with

Re: [libvirt] [PATCH] admin: fix memory leak of typed parameters getting client info

2019-09-30 Thread Daniel Henrique Barboza
On 9/30/19 12:57 PM, Daniel P. Berrangé wrote: In the error code path, the temporary parameters are not freed. Signed-off-by: Daniel P. Berrangé --- Reviewed-by: Daniel Henrique Barboza src/admin/admin_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Andrea Bolognani
On Mon, 2019-09-30 at 13:13 -0400, Laine Stump wrote: > On 9/30/19 10:05 AM, Andrea Bolognani wrote: > > I see your point about backports being more painful when you have > > a bunch of unrelated changes mixed in, but I would still prefer if > > we converted everything at once and at the same time

[libvirt] [PATCH 1/1] qemu_hotplug: use VIR_AUTOUNREF() with virConnectPtr

2019-09-30 Thread Daniel Henrique Barboza
Signed-off-by: Daniel Henrique Barboza --- Checked other pointer types that can be autounref as well, just found these instances. src/qemu/qemu_hotplug.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

Re: [libvirt] [PATCH] rpc: fix escaping of shell path for netcat binary

2019-09-30 Thread Eric Blake
On 9/30/19 7:34 AM, Daniel P. Berrangé wrote: Consider having a nc binary in the path with a space in its name, for example '/tmp/fo o/nc' This results in libvirt running SSH with the following arg value "'if ''/tmp/fo o/nc'' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1;

[libvirt] [PATCH 0/2] qemu_process: use VIR_AUTO* all around

2019-09-30 Thread Daniel Henrique Barboza
The usual AUTOFREE() and AUTOUNREF() changes that allows for a bit of cleanup. Daniel Henrique Barboza (2): qemu_process: use VIR_AUTOFREE() qemu_process: use VIR_AUTOUNREF() src/qemu/qemu_process.c | 413 +++- 1 file changed, 149 insertions(+), 264

[libvirt] [PATCH 2/2] qemu_process: use VIR_AUTOUNREF()

2019-09-30 Thread Daniel Henrique Barboza
Change all feasible vir*Ptr pointers to be AUTOUNREF(), clearing up the 'cleanup' labels when possible. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_process.c | 295 +++- 1 file changed, 109 insertions(+), 186 deletions(-) diff --git

[libvirt] [PATCH 1/2] qemu_process: use VIR_AUTOFREE()

2019-09-30 Thread Daniel Henrique Barboza
Change all strings and scalar pointers to use VIR_AUTOFREE(), clearing up the 'cleanup' labels when possible. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_process.c | 118 ++-- 1 file changed, 40 insertions(+), 78 deletions(-) diff --git

Re: [libvirt] [PATCH] docs: document that C & Python are the preferred languages

2019-09-30 Thread Jim Fehlig
On 9/23/19 7:52 AM, Daniel P. Berrangé wrote: > On Thu, Sep 05, 2019 at 06:15:04PM +0100, Daniel P. Berrangé wrote: >> On Thu, Sep 05, 2019 at 12:30:27PM -0400, Laine Stump wrote: >>> (BTW, what does the removal of perl from libvirt say about continued >>> use of perl for libvirt-tck? There are a

Re: [libvirt] [PATCH] qemu: make attaching disk partition to VM illegal

2019-09-30 Thread Peter Krempa
On Fri, Sep 27, 2019 at 12:41:29 -0300, Daniel Henrique Barboza wrote: > > > On 9/27/19 12:11 PM, Pavel Mores wrote: > > The way in which the qemu driver generates aliases for disks involves > > ignoring the partition number part of a target dev name. This means that > > all partitions of a

Re: [libvirt] [PATCH] tools: fix regression passing command with virt-login-shell

2019-09-30 Thread Peter Krempa
On Fri, Sep 27, 2019 at 17:23:02 +0100, Daniel Berrange wrote: > It is documented that a command to run inside the container can be > passed with the -c arg. > > virt-login-shell -c "ls -l /" > > This fixes > > commit 4feeb2d986b98013ebfb1d41ab6b9007b6cce6e2 > Author: Daniel P. Berrangé

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Peter Krempa
On Fri, Sep 27, 2019 at 18:17:28 +0100, Daniel Berrange wrote: > Replace use of the gnulib base64 module with glib's own base64 API family. > > Signed-off-by: Daniel P. Berrangé > --- > bootstrap.conf| 1 - > src/conf/virsecretobj.c | 38

Re: [libvirt] [PATCH 01/11] build: probe for glib-2 library in configure

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:23PM +0100, Daniel P. Berrangé wrote: > Prepare for linking with glib by probing for it at configure > time. Per supported platforms target, the min glib versions on > relevant distros are: > > RHEL-8: 2.56.1 > RHEL-7: 2.50.3 > Debian (Buster): 2.58.3 >

Re: [libvirt] [PATCH] qemu: ensure vhostuser FD is initialized to -1

2019-09-30 Thread Daniel P . Berrangé
On Sat, Sep 28, 2019 at 10:39:49PM +0200, Michal Prívozník wrote: > On 9/27/19 6:36 PM, Daniel P. Berrangé wrote: > > The video private data was not initializing the vhostuser FD > > causing us to attempt to close FD 0 many times over. > > > > Fixes > > > > commit

Re: [libvirt] [PATCH 05/11] util: use glib string allocation/formatting functions

2019-09-30 Thread Ján Tomko
On Mon, Sep 30, 2019 at 10:37:53AM +0200, Peter Krempa wrote: On Fri, Sep 27, 2019 at 18:17:27 +0100, Daniel Berrange wrote: Convert the string duplication APIs to use the g_strdup family of APIs. Annoyingly our virVasprintf/virAsprintf functions return the character count, even though 90% of

Re: [libvirt] [PATCH] qemu: checkpoint: Do ACL check prior to snapshot interlocking

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 10:26:13AM +0200, Peter Krempa wrote: > The interlocking with snapshots is executed prior to the ACL check so if > a VM has snapshots invoking the checkpoint API may leak it's existance. > > Introduced with the qemuDomainCheckpointCreateXML API implementation in > commit

Re: [libvirt] [PATCH 1/5] nss: Compare addresses iff their family matches

2019-09-30 Thread Erik Skultety
On Sat, Sep 28, 2019 at 10:05:29PM +0200, Michal Privoznik wrote: > When parsing leases file, appendAddr() is called to append parsed > tuple (address, expiry time, family) into an array. Whilst doing > so, the array is searched for possible duplicate. This is done by > comparing each item of the

Re: [libvirt] [PATCH 04/11] util: use glib memory allocation functions

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:26PM +0100, Daniel P. Berrangé wrote: > Convert the VIR_ALLOC family of APIs with use of the g_malloc family of > APIs. Use of VIR_ALLOC related functions should be incrementally phased > out over time, allowing return value checks to be dropped. Use of > VIR_FREE

Re: [libvirt] [PATCH 2/5] nss: Drop needless free() in gethostbyname3()

2019-09-30 Thread Erik Skultety
On Sat, Sep 28, 2019 at 10:05:30PM +0200, Michal Privoznik wrote: > The findLease() function allocates @addr array iff no error > occurred and at least one satisfactory record was found. > Therefore, there is no need to call free() if findLease() failed, > or did not find any records as addr ==

Re: [libvirt] [PATCH v2 0/6] rewrite virt-host-validate to be data driven, using Go & YAML

2019-09-30 Thread Andrea Bolognani
On Fri, 2019-09-27 at 13:52 +0100, Daniel P. Berrangé wrote: > The really big difference though is that I replaced the use > of XML data files with YAML data files. This was done with > the aim of making the data more human friendly. XML is really > optimized for machines, not humans, so writing

Re: [libvirt] [PATCH 3/5] nss: Don't leak @addr in gethostbyname4()

2019-09-30 Thread Erik Skultety
On Sat, Sep 28, 2019 at 10:05:31PM +0200, Michal Privoznik wrote: > Similarly to gethostbyname3(), the @addr must be freed on return > from the function. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 04/11] util: use glib memory allocation functions

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 12:02:17PM +0200, Pavel Hrdina wrote: > On Fri, Sep 27, 2019 at 06:17:26PM +0100, Daniel P. Berrangé wrote: > > Convert the VIR_ALLOC family of APIs with use of the g_malloc family of > > APIs. Use of VIR_ALLOC related functions should be incrementally phased > > out over

Re: [libvirt] [PATCH 4/5] libvirt_nss.h: Separate function declarations with an empty line

2019-09-30 Thread Erik Skultety
On Sat, Sep 28, 2019 at 10:05:32PM +0200, Michal Privoznik wrote: > I find it more readable that way. > > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

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

2019-09-30 Thread Martin Kletzander
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 safety contract of using unsafe constructor --- Ideally it should not be exposed at

Re: [libvirt] [PATCH 04/11] util: use glib memory allocation functions

2019-09-30 Thread Pavel Hrdina
On Mon, Sep 30, 2019 at 11:08:09AM +0100, Daniel P. Berrangé wrote: > On Mon, Sep 30, 2019 at 12:02:17PM +0200, Pavel Hrdina wrote: > > On Fri, Sep 27, 2019 at 06:17:26PM +0100, Daniel P. Berrangé wrote: > > > Convert the VIR_ALLOC family of APIs with use of the g_malloc family of > > > APIs. Use

Re: [libvirt] [PATCH 5/5] tools: Record NSS dependency on symbols file

2019-09-30 Thread Erik Skultety
On Sat, Sep 28, 2019 at 10:05:33PM +0200, Michal Privoznik wrote: > If a symbol file for either of NSS modules is changed then > subsequent 'make' doesn't regenerate the library, because there > is no implicit dependency between the library and symbols file. > Put an explicit dependency into the

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-09-30 Thread Jiri Denemark
On Thu, Sep 26, 2019 at 18:43:05 -0300, Eduardo Habkost wrote: > The pconfig feature never worked, and adding "pconfig=off" to the > QEMU command-line triggers a regression in QEMU 3.1.1 and 4.0.0. > > Signed-off-by: Eduardo Habkost > --- > I'm sending this as an RFC because I couldn't test it

Re: [libvirt] [PATCH 04/11] util: use glib memory allocation functions

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 12:18:11PM +0200, Pavel Hrdina wrote: > On Mon, Sep 30, 2019 at 11:08:09AM +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 30, 2019 at 12:02:17PM +0200, Pavel Hrdina wrote: > > > On Fri, Sep 27, 2019 at 06:17:26PM +0100, Daniel P. Berrangé wrote: > > > > Convert the

Re: [libvirt] [PATCH v2 3/6] tools: define YAML rules for virt-host-validate checks

2019-09-30 Thread Peter Krempa
On Fri, Sep 27, 2019 at 13:52:22 +0100, Daniel Berrange wrote: > This commit defines a set of YAML rules that result in the same set of > logical checks as the existing hardcoded virt-host-validate > implementation does. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [libvirt] [PATCH] qemu: make attaching disk partition to VM illegal

2019-09-30 Thread Pavel Mores
On Mon, Sep 30, 2019 at 08:38:20AM +0200, Peter Krempa wrote: > On Fri, Sep 27, 2019 at 12:41:29 -0300, Daniel Henrique Barboza wrote: > > > > > > > +virReportError(VIR_ERR_CONFIG_UNSUPPORTED, > > > + _("can't attach disk partition '%s', please > > > attach whole

Re: [libvirt] [PATCH 02/11] build: link to glib, gobject, gio libraries

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:24PM +0100, Daniel P. Berrangé wrote: > Add the main glib.h to internal.h so that all common code can use it. > > Historically glib allowed applications to register an alternative > memory allocator, so mixing g_malloc/g_free with malloc/free was not > safe. > >

Re: [libvirt] [PATCH 03/11] remote: don't pull anonymous enums into rpc protocol structs

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:25PM +0100, Daniel P. Berrangé wrote: > The VIR_TYPED_PARAM_* enum fields are defined in libvirt-common.h, not > in the remote protcol, so shouldn't be part of the protocol structs > output check. This avoids similar problems hitting when we add use of > glib, which

Re: [libvirt] [PATCH 05/11] util: use glib string allocation/formatting functions

2019-09-30 Thread Peter Krempa
On Fri, Sep 27, 2019 at 18:17:27 +0100, Daniel Berrange wrote: > Convert the string duplication APIs to use the g_strdup family of APIs. > > Annoyingly our virVasprintf/virAsprintf functions return the character > count, even though 90% of our usage doesn't need it. To retain compat > with these

Re: [libvirt] [PATCH v2 0/6] rewrite virt-host-validate to be data driven, using Go & YAML

2019-09-30 Thread Martin Kletzander
On Fri, Sep 27, 2019 at 01:52:19PM +0100, Daniel P. Berrangé wrote: This is a followup to a previous PoC patch I submitted a month ago: https://www.redhat.com/archives/libvir-list/2019-September/msg00036.html The commit messages in the individual patches given quite a bit of detail, so I'll

Re: [libvirt] [PATCH v2 6/6] tools: make virt-host-validate check CPU vulnerabilities

2019-09-30 Thread Martin Kletzander
On Fri, Sep 27, 2019 at 01:52:25PM +0100, Daniel P. Berrangé wrote: Add a check reporting if any CPU vulnerabilities have not been mitigated by the kernel. It further reports whether it is safe to use Intel SMT for KVM guests or not, as several of the vulnerabilities are dangerous when combined

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

2019-09-30 Thread Daniel P . Berrangé
On Sat, Sep 28, 2019 at 01:36:15PM +0200, Bruno Haible wrote: > Marcus Furlong wrote: > > FWIW I compiled libvirt without the setgroups code on Mac and it > > worked as expected. Not sure what the implications of that are though? > > OK, then the fix would be to not use setgroups on Mac, and

Re: [libvirt] [PATCH 05/11] util: use glib string allocation/formatting functions

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 01:32:50PM +0200, Ján Tomko wrote: > On Mon, Sep 30, 2019 at 10:37:53AM +0200, Peter Krempa wrote: > > On Fri, Sep 27, 2019 at 18:17:27 +0100, Daniel Berrange wrote: > > > Convert the string duplication APIs to use the g_strdup family of APIs. > > > > > > Annoyingly our

[libvirt] [PATCH v2] qemu: ensure vhostuser FD is initialized to -1

2019-09-30 Thread Daniel P . Berrangé
The video private data was not initializing the vhostuser FD causing us to attempt to close FD 0 many times over. Fixes commit ca60ecfa8cc1bd85baf7137dd1864d5f00f019f0 Author: Marc-André Lureau Date: Mon Sep 23 14:44:36 2019 +0400 qemu: add qemuDomainVideoPrivate Since the test

Re: [libvirt] [PATCH 05/11] util: use glib string allocation/formatting functions

2019-09-30 Thread Pavel Hrdina
On Fri, Sep 27, 2019 at 06:17:27PM +0100, Daniel P. Berrangé wrote: > Convert the string duplication APIs to use the g_strdup family of APIs. > > Annoyingly our virVasprintf/virAsprintf functions return the character > count, even though 90% of our usage doesn't need it. To retain compat > with

[libvirt] [PATCH] qemu: sanity check vhost user FD before passing to QEMU

2019-09-30 Thread Daniel P . Berrangé
Ensure that the FD we're passing to QEMU is actually open, so we get a sane error message upfront instead of telling QEMU to use a closed FD. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_command.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_command.c

Re: [libvirt] [PATCH 05/11] util: use glib string allocation/formatting functions

2019-09-30 Thread Daniel P . Berrangé
On Mon, Sep 30, 2019 at 01:35:36PM +0200, Pavel Hrdina wrote: > On Fri, Sep 27, 2019 at 06:17:27PM +0100, Daniel P. Berrangé wrote: > > Convert the string duplication APIs to use the g_strdup family of APIs. > > > > Annoyingly our virVasprintf/virAsprintf functions return the character > > count,

Re: [libvirt] [PATCH 06/11] util: use glib base64 encoding/decoding APIs

2019-09-30 Thread Pavel Hrdina
On Mon, Sep 30, 2019 at 09:02:36AM +0200, Peter Krempa wrote: > On Fri, Sep 27, 2019 at 18:17:28 +0100, Daniel Berrange wrote: > > Replace use of the gnulib base64 module with glib's own base64 API family. > > > > Signed-off-by: Daniel P. Berrangé > > --- > > bootstrap.conf|

  1   2   >