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

2019-10-07 Thread Christian Ehrhardt
On Mon, Oct 7, 2019 at 11:49 PM Cole Robinson wrote: > > This series is the first steps to teaching libvirt about qcow2 > data_file support, aka external data files or qcow2 external metadata. > > A bit about the feature: it was added in qemu 4.0. It essentially > creates a two part image file: a

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

2019-10-07 Thread jcfaracco
From: Julio Faracco Now, QEMU command line can define 'xres' and 'yres' if XML contains both properties from video model. This is generetaed if resolution was set. Code let QEMU handle if video model supports this feature. Signed-off-by: Julio Faracco --- src/qemu/qemu_command.c | 5 + 1

[libvirt] [PATCH v3 0/4] Add resolution properties for QEMU video devices

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

[libvirt] [PATCH v3 4/4] tests: Add separate tests for resolution 'x' and 'y'

2019-10-07 Thread jcfaracco
From: Julio Faracco New tests to verify resolution properties of a simple qxl video. Other video models supports 'xres' and 'yres' feature for QEMU. But a qxl test should be enough to cover this domain feature. Signed-off-by: Julio Faracco --- .../video-qxl-resolution.args |

[libvirt] [PATCH v3 3/4] conf: Add XML resolution support for video models

2019-10-07 Thread jcfaracco
From: Julio Faracco XML need to support both properties together. This commit adds XML support for video model if they are set. Domain configuration is able to parse this properties as 'x' and 'y'. Code is not using same label as QEMU: 'xres' and 'yres'. Signed-off-by: Julio Faracco ---

[libvirt] [PATCH v3 1/4] docs: Add 'x' and 'y' into video model XML definition

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

Re: [libvirt] [PATCH 0/4] PCI multifunction partial assignment support

2019-10-07 Thread Daniel Henrique Barboza
On 10/7/19 7:41 PM, Alex Williamson wrote: On Mon, 7 Oct 2019 18:11:32 -0300 Daniel Henrique Barboza wrote: (--- long post warning ---) This is a work that derived from the discussions I had with Laine Stump and Alex Williamson in [1]. I'll provide a quick gist below. -- Today,

Re: [libvirt] [PATCH 0/4] PCI multifunction partial assignment support

2019-10-07 Thread Alex Williamson
On Mon, 7 Oct 2019 18:11:32 -0300 Daniel Henrique Barboza wrote: > (--- long post warning ---) > > This is a work that derived from the discussions I had with > Laine Stump and Alex Williamson in [1]. I'll provide a quick > gist below. > > -- > > Today, Libvirt does not have proper

[libvirt] [PATCH 29/30] security: selinux: break out SetImageLabelRelative

2019-10-07 Thread Cole Robinson
This will be used for recursing into externalDataStore Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index

[libvirt] [PATCH 27/30] security: selinux: Add is_toplevel to SetImageLabelInternal

2019-10-07 Thread Cole Robinson
This will simplify future patches and make the logic easier to follow Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index

[libvirt] [PATCH 25/30] security: selinux: Simplify SetImageLabelInternal

2019-10-07 Thread Cole Robinson
All the SetFileCon calls only differ by the label they pass in. Rework the conditionals to track what label we need, and use a single SetFileCon call Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 31 ++- 1 file changed, 10 insertions(+), 21

[libvirt] [PATCH 28/30] security: selinux: Restore image label for externalDataStore

2019-10-07 Thread Cole Robinson
Rename the existing virSecuritySELinuxRestoreImageLabelInt to virSecuritySELinuxRestoreImageLabelSingle, and extend the new ImageLabelInt handle externalDataStore Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 28 1 file changed, 24

[libvirt] [PATCH 24/30] security: dac: Label externalDataStore

2019-10-07 Thread Cole Robinson
We mirror the labeling strategy that was used for its sibling image Signed-off-by: Cole Robinson --- src/security/security_dac.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 326b9b1a3c..2bbf773dd3

[libvirt] [PATCH 30/30] security: selinux: Label externalDataStore

2019-10-07 Thread Cole Robinson
We mirror the labeling strategy that was used for its top image Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index

[libvirt] [PATCH 23/30] security: dac: break out SetImageLabelRelative

2019-10-07 Thread Cole Robinson
This will be used for recursing into externalDataStore Signed-off-by: Cole Robinson --- src/security/security_dac.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index befa388791..326b9b1a3c

[libvirt] [PATCH 21/30] security: dac: Add is_toplevel to SetImageLabelInternal

2019-10-07 Thread Cole Robinson
This will simplify future patches and make the logic easier to follow Signed-off-by: Cole Robinson --- src/security/security_dac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index bcc781213e..6d0c8a9b1c 100644

[libvirt] [PATCH 16/30] storagefile: Don't access backingStoreRaw directly in FromBackingRelative

2019-10-07 Thread Cole Robinson
For the only usage, the rel == parent->backingStoreRaw, so drop the direct access Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 53fe4590b4..c47df6c200

[libvirt] [PATCH 18/30] storagefile: Add externalDataStore member

2019-10-07 Thread Cole Robinson
Add the plumbing to track a externalDataStoreRaw as a virStorageSource Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 9 + src/util/virstoragefile.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

[libvirt] [PATCH 26/30] security: selinux: Drop !parent handling in SetImageLabelInternal

2019-10-07 Thread Cole Robinson
The only caller always passes in a non-null parent Signed-off-by: Cole Robinson --- src/security/security_selinux.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 9d28bc5773..e384542c49 100644

[libvirt] [PATCH 14/30] storagefile: Parse qcow2 external data file

2019-10-07 Thread Cole Robinson
This is tracked as a qcow2 extension, like backing store format Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

[libvirt] [PATCH 22/30] security: dac: Restore image label for externalDataStore

2019-10-07 Thread Cole Robinson
Rename the existing virSecurityDACRestoreImageLabelInt to virSecurityDACRestoreImageLabelSingle, and extend the new ImageLabelInt handle externalDataStore Signed-off-by: Cole Robinson --- src/security/security_dac.c | 28 1 file changed, 24 insertions(+), 4

[libvirt] [PATCH 17/30] storagefile: Split out virStorageSourceNewFromChild

2019-10-07 Thread Cole Robinson
Future patches will use this for external data file handling Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 47 ++- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

[libvirt] [PATCH 19/30] storagefile: Fill in meta->externalDataStore

2019-10-07 Thread Cole Robinson
Add virStorageSourceNewFromExternalData, similar to virStorageSourceNewFromBacking and use it to fill in a virStorageSource for externalDataStore Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 35 +++ 1 file changed, 35 insertions(+) diff --git

[libvirt] [PATCH 20/30] security: dac: Drop !parent handling in SetImageLabelInternal

2019-10-07 Thread Cole Robinson
The only caller always passes in a non-null parent Signed-off-by: Cole Robinson --- src/security/security_dac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 4b4afef18a..bcc781213e 100644 ---

[libvirt] [PATCH 15/30] storagefile: Fill in meta->externalDataStoreRaw

2019-10-07 Thread Cole Robinson
Call qcow2GetExtensions to actually fill in the virStorageSource externalDataStoreRaw member Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 7e32d7619e..53fe4590b4

[libvirt] [PATCH 10/30] storagefile: Rename qcow2GetBackingStoreFormat

2019-10-07 Thread Cole Robinson
...to qcow2GetExtensions. We will extend it for more extension parsing in future patches Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

[libvirt] [PATCH 09/30] storagefile: Push extension_end calc to qcow2GetBackingStoreFormat

2019-10-07 Thread Cole Robinson
This is a step towards making this qcow2GetBackingStoreFormat into a generic qcow2 extensions parser Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 66 +-- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/src/util/virstoragefile.c

[libvirt] [PATCH 12/30] storagefile: Fix backing format \0 check

2019-10-07 Thread Cole Robinson
>From qemu.git docs/interop/qcow2.txt == String header extensions == Some header extensions (such as the backing file format name and the external data file name) are just a single string. In this case, the header extension length is the string length and the string is not '\0'

[libvirt] [PATCH 06/30] storagefile: Drop now unused isQCow2 argument

2019-10-07 Thread Cole Robinson
Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 9bf4c1178b..14551af4d2 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@

[libvirt] [PATCH 04/30] storagefile: qcow1: Let qcowXGetBackingStore fill in format

2019-10-07 Thread Cole Robinson
Letting qcowXGetBackingStore fill in format gives the same behavior we were opencoding in qcow1GetBackingStore Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/util/virstoragefile.c

[libvirt] [PATCH 07/30] storagefile: Use qcowXGetBackingStore directly

2019-10-07 Thread Cole Robinson
The qcow1 and qcow2 variants are identical, so remove the wrappers Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 27 +++ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

[libvirt] [PATCH 01/30] storagefile: Make GetMetadataInternal static

2019-10-07 Thread Cole Robinson
It is only used in virstoragefile.c Signed-off-by: Cole Robinson --- src/libvirt_private.syms | 1 - src/util/virstoragefile.c | 2 +- src/util/virstoragefile.h | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index

[libvirt] [PATCH 02/30] storagefile: qcow1: Check for BACKING_STORE_OK

2019-10-07 Thread Cole Robinson
Check explicitly for BACKING_STORE_OK and not its 0 value Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 51726006e7..1549067c48 100644 ---

[libvirt] [PATCH 08/30] storagefile: Push 'start' into qcow2GetBackingStoreFormat

2019-10-07 Thread Cole Robinson
This is a step towards making this qcow2GetBackingStoreFormat into a generic qcow2 extensions parser Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/util/virstoragefile.c

[libvirt] [PATCH 13/30] storagefile: Add externalDataStoreRaw member

2019-10-07 Thread Cole Robinson
Add the plumbing to track a qcow2 external data file path in virStorageSource Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 2 ++ src/util/virstoragefile.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index

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

2019-10-07 Thread Cole Robinson
This series is the first steps to teaching libvirt about qcow2 data_file support, aka external data files or qcow2 external metadata. A bit about the feature: it was added in qemu 4.0. It essentially creates a two part image file: a qcow2 layer that just tracks the image metadata, and a separate

[libvirt] [PATCH 03/30] storagefile: qcow1: Fix check for empty backing file

2019-10-07 Thread Cole Robinson
>From f772b3d91fd the intention of this code seems to be to set format=NONE when the image does not have a backing file. However 'buf' here is the whole qcow1 file header. What we want to be checking is 'res' which is the parsed backing file path. qcowXGetBackingStore sets this to NULL when

[libvirt] [PATCH 05/30] storagefile: Check version to determine if qcow2 or not

2019-10-07 Thread Cole Robinson
Rather than require a boolean to be passed in Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 905e70b1a9..9bf4c1178b 100644 ---

[libvirt] [PATCH 11/30] storagefile: Rename qcow2GetExtensions 'format' argument

2019-10-07 Thread Cole Robinson
To backingFormat, which makes it more clear. Move it to the end of the argument list which will scale nicer with future patches Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/virstoragefile.c

[libvirt] [PATCH 4/4] virhostdev: all functions of a PCI multifunction dev must be added

2019-10-07 Thread Daniel Henrique Barboza
This is the last piece for a full fledged PCI multifunction partial assignment support. Now that we have a defined XML format and QEMU is ignoring the existence of the hostdev that isn't being assigned, let's enforce that all functions must be declared in the domain XML for such devices. This will

[libvirt] [PATCH 1/4] utils: introducing PCI multifunction detection helpers

2019-10-07 Thread Daniel Henrique Barboza
This patch introduces two helpers that will be used in the next patches. One is virpci.c:virPCIDeviceIsMultifunction(), and the other is virhostdev.c:virHostdevIsPCIMultifunctionDevice(). As the name suggests, the idea is to detect if a given dev/hostdev is a PCI multifunction device.

[libvirt] [PATCH 3/4] qemu_command: ignore non-assigned PCI multifunction hostdevs

2019-10-07 Thread Daniel Henrique Barboza
Bulding up in the new attribute introduced by the previous patch, let's not assign a hostdev to a QEMU domain by avoiding the '-device' line to be created at all inside qemu_command.c. Since the device isn't going to be guest visible, makes little sense to assign alias and address to it, so let's

[libvirt] [PATCH 0/4] PCI multifunction partial assignment support

2019-10-07 Thread Daniel Henrique Barboza
(--- long post warning ---) This is a work that derived from the discussions I had with Laine Stump and Alex Williamson in [1]. I'll provide a quick gist below. -- Today, Libvirt does not have proper support for partial assignment of functions of passed-through PCI multifunction devices

[libvirt] [PATCH 2/4] Introducing assigned='yes|no' hostdev attribute

2019-10-07 Thread Daniel Henrique Barboza
The idea of having an attribute that declares that a hostdev is not to be assigned to the guest seems counterintuitive, but it has a niche use with multifunction PCI devices. The current use of this kind of device in Libvirt is to declare all of the functions in the XML. This is not ideal though

Re: [libvirt] [PATCH 1/1] IDE: deprecate ide-drive

2019-10-07 Thread John Snow
On 10/7/19 5:49 AM, Markus Armbruster wrote: > John Snow writes: > >> It's an old compatibility shim that just delegates to ide-cd or ide-hd. >> I'd like to refactor these some day, and getting rid of the super-object >> will make that easier. > > Device "scsi-disk" is similar. However,

Re: [libvirt] [jenkins-ci PATCH] guests: add glib2 as a package dependency for libvirt

2019-10-07 Thread Fabiano Fidêncio
On Mon, Oct 7, 2019 at 7:24 PM Daniel P. Berrangé wrote: > > Signed-off-by: Daniel P. Berrangé > --- > guests/vars/projects/libvirt+mingw32.yml | 1 + > guests/vars/projects/libvirt+mingw64.yml | 1 + > guests/vars/projects/libvirt.yml | 1 + > 3 files changed, 3 insertions(+) > > diff

[libvirt] [jenkins-ci PATCH] guests: add glib2 as a package dependency for libvirt

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- guests/vars/projects/libvirt+mingw32.yml | 1 + guests/vars/projects/libvirt+mingw64.yml | 1 + guests/vars/projects/libvirt.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/guests/vars/projects/libvirt+mingw32.yml

[libvirt] [PATCH v2 16/23] libxl: convert over to use GRegex for regular expressions

2019-10-07 Thread Daniel P . Berrangé
Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- src/libxl/libxl_capabilities.c | 42 +++--- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 73ae0b3fa1..65c68ffb52

[libvirt] [PATCH v2 07/23] src: add support for g_autoptr with virObject instances

2019-10-07 Thread Daniel P . Berrangé
Libvirt currently uses the VIR_AUTOUNREF macro for auto cleanup of virObject instances. GLib approaches things differently with GObject, reusing their g_autoptr() concept. This introduces support for g_autoptr() with virObject, to facilitate the conversion to GObject. Only virObject classes

[libvirt] [PATCH v2 23/23] build: remove use of usleep gnulib module in favour of g_usleep

2019-10-07 Thread Daniel P . Berrangé
The usleep function was missing on older mingw versions, but we can rely on it existing everywhere these days. It may only support times upto 1 second in duration though, so we'll prefer to use g_usleep instead. The commandhelper program is not changed since that can't link to glib. Fortunately

[libvirt] [PATCH v2 18/23] virsh: convert command line parsing to use GOptionContext

2019-10-07 Thread Daniel P . Berrangé
The GOptionContext API has the benefit over getopt_long that it will automatically handle --help output formatting. Signed-off-by: Daniel P. Berrangé --- tools/virsh.c | 304 +++--- 1 file changed, 137 insertions(+), 167 deletions(-) diff --git

[libvirt] [PATCH v2 02/23] build: link to glib library

2019-10-07 Thread Daniel P . Berrangé
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. This was feature was dropped in 2.46.0 with: commit

[libvirt] [PATCH v2 22/23] util: replace strerror/strerror_r with g_strerror

2019-10-07 Thread Daniel P . Berrangé
g_strerror is offers the safety/correctness benefits of strerror_r, with the API design convenience of strerror. Use of virStrerror should be eliminated through the codebase in favour of g_strerror. commandhelper.c is a special case as its a tiny single threaded test program, not linked to glib,

[libvirt] [PATCH v2 14/23] remote: convert methods using virIdentityPtr to auto free macros

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/remote/remote_daemon.c | 3 +-- src/remote/remote_daemon_dispatch.c | 35 ++--- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index

[libvirt] [PATCH v2 17/23] conf: convert over to use GRegex for regular expressions

2019-10-07 Thread Daniel P . Berrangé
Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- src/conf/domain_event.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index b33589f472..f7d1a38e46 100644 ---

[libvirt] [PATCH v2 20/23] virt-login-shell: convert command line parsing to use GOptionContext

2019-10-07 Thread Daniel P . Berrangé
The GOptionContext API has the benefit over getopt_long that it will automatically handle --help output formatting. Signed-off-by: Daniel P. Berrangé --- tools/virt-login-shell-helper.c | 76 +++-- 1 file changed, 26 insertions(+), 50 deletions(-) diff --git

[libvirt] [PATCH v2 21/23] virt-host-validate: convert command line parsing to use GOptionContext

2019-10-07 Thread Daniel P . Berrangé
The GOptionContext API has the benefit over getopt_long that it will automatically handle --help output formatting. Signed-off-by: Daniel P. Berrangé --- tools/virt-host-validate.c | 86 +++--- 1 file changed, 34 insertions(+), 52 deletions(-) diff --git

[libvirt] [PATCH v2 13/23] rpc: convert methods using virIdentityPtr to auto free macros

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/rpc/virnetserverclient.c | 47 ++ src/rpc/virnetserverprogram.c | 13 +++--- tests/virnetserverclienttest.c | 3 +-- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/rpc/virnetserverclient.c

[libvirt] [PATCH v2 10/23] util: convert virIdentity implementation and test suite to g_autoptr

2019-10-07 Thread Daniel P . Berrangé
To simplify the later conversion from virObject to GObject, introduce the use of g_autoptr to the virIdentity implementnation and test suite. Signed-off-by: Daniel P. Berrangé --- src/util/viridentity.c | 40 +++-- tests/viridentitytest.c | 44

[libvirt] [PATCH v2 11/23] access: convert polkit driver to auto free memory

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/access/viraccessdriverpolkit.c | 38 +++--- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c index e61ac6fa19..fbe7789ccd 100644 ---

[libvirt] [PATCH v2 15/23] util: convert virIdentity class to use GObject

2019-10-07 Thread Daniel P . Berrangé
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 #define VIR_TYPE_IDENTITY virIdentity_get_type () G_DECLARE_FINAL_TYPE (virIdentity,

[libvirt] [PATCH v2 05/23] util: convert virSystemdActivation to use VIR_DEFINE_AUTOPTR_FUNC

2019-10-07 Thread Daniel P . Berrangé
Using the standard macro will facilitate the conversion to glib's auto cleanup macros. Signed-off-by: Daniel P. Berrangé --- src/util/virsystemd.c | 10 +- src/util/virsystemd.h | 5 +++-- tests/virsystemdtest.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git

[libvirt] [PATCH v2 00/23] Integrate usage of glib into libvirt

2019-10-07 Thread Daniel P . Berrangé
This is a followup to a previous patch series: v0: https://www.redhat.com/archives/libvir-list/2019-August/msg01374.html v1: https://www.redhat.com/archives/libvir-list/2019-September/msg01331.html The focus in this glib series is - Wire up pieces to facilitate interoperability around

[libvirt] [PATCH v2 19/23] virt-admin: convert command line parsing to use GOptionContext

2019-10-07 Thread Daniel P . Berrangé
The GOptionContext API has the benefit over getopt_long that it will automatically handle --help output formatting. Signed-off-by: Daniel P. Berrangé --- tools/virt-admin.c | 210 ++--- 1 file changed, 101 insertions(+), 109 deletions(-) diff --git

[libvirt] [PATCH v2 08/23] conf: convert virSecretObj APIs to use autofree

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/conf/virsecretobj.c | 46 +++-- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index 7800912bff..aeae82332b 100644 --- a/src/conf/virsecretobj.c +++

[libvirt] [PATCH v2 06/23] util: rewrite auto cleanup macros to use glib's equivalent

2019-10-07 Thread Daniel P . Berrangé
To facilitate porting over to glib, this rewrites the auto cleanup macros to use glib's equivalent. As a result it is now possible to use g_autoptr/VIR_AUTOPTR, and g_auto/VIR_AUTOCLEAN, g_autofree/VIR_AUTOFREE interchangably, regardless of which macros were used to declare the cleanup types.

[libvirt] [PATCH v2 12/23] admin: convert admin server code to use auto free macros

2019-10-07 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/admin/admin_server.c | 204 --- 1 file changed, 85 insertions(+), 119 deletions(-) diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c index 0d6091937d..ba87f701c3 100644 --- a/src/admin/admin_server.c

[libvirt] [PATCH v2 09/23] util: use glib base64 encoding/decoding APIs

2019-10-07 Thread Daniel P . Berrangé
Replace use of the gnulib base64 module with glib's own base64 API family. Signed-off-by: Daniel P. Berrangé --- bootstrap.conf| 1 - configure.ac | 5 - src/conf/virsecretobj.c | 26 -- src/libvirt_private.syms

[libvirt] [PATCH v2 04/23] util: use glib string allocation/formatting functions

2019-10-07 Thread Daniel P . Berrangé
Convert the string duplication APIs to use the g_strdup family of APIs. We previously used the 'strdup-posix' gnulib module because mingw does not set errno to ENOMEM on failure We previously used the 'strndup' gnulib module because this function does not exist on mingw. We previously used the

[libvirt] [PATCH v2 03/23] util: use glib memory allocation functions

2019-10-07 Thread Daniel P . Berrangé
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 should be replaced with auto-cleanup whenever possible. We previously used the

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

2019-10-07 Thread Daniel P . Berrangé
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 Debian (Stretch): 2.50.3 OpenBSD (Ports): 2.58.3 FreeBSD (Ports): 2.56.3 OpenSUSE

Re: [libvirt] -blockdev bug (and some questions)

2019-10-07 Thread Peter Krempa
On Mon, Oct 07, 2019 at 09:34:39 -0400, Cole Robinson wrote: > On 10/7/19 2:07 AM, Peter Krempa wrote: > > On Sat, Oct 05, 2019 at 17:39:01 -0400, Cole Robinson wrote: [...] > > > More generally I have questions about why we track backingStore in the XML > > > for an offline VM anyways? I

Re: [libvirt] Limiting old version back compat for language bindings ?

2019-10-07 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 04:58:34PM +0200, Andrea Bolognani wrote: > On Mon, 2019-10-07 at 13:35 +0100, Daniel P. Berrangé wrote: > > On Mon, Oct 07, 2019 at 01:58:10PM +0200, Andrea Bolognani wrote: > > > Can't we follow the same policy as the main library? That would make > > > it more

Re: [libvirt] [PATCH] qemu: add pointer check in qemuMonitorLastError

2019-10-07 Thread Michal Privoznik
On 9/19/19 10:01 AM, Xu Yandong wrote: We found a exception when libvirt occurrs segmentation fault. thread 1 is waiting object lock in qemuConnectMonitor, qemu process exits and sends EOF event as well, so thread 2 invokes qemuMonitorLastError but pointer mon is NULL. Signed-off-by: Xu Yandong

[libvirt] [libvirt-dbus] [PATCH 1/2] Introduce Domain Snapshot Interface

2019-10-07 Thread Simon Kobyda
Signed-off-by: Simon Kobyda --- data/Makefile.am| 1 + data/org.libvirt.DomainSnapshot.xml | 7 +++ src/Makefile.am | 2 + src/connect.c | 6 +++ src/connect.h | 1 + src/domainsnapshot.c| 79

[libvirt] [libvirt-dbus] [PATCH 0/2] Implement Snaphots

2019-10-07 Thread Simon Kobyda
Implement snapshot interface and its APIs. Simon Kobyda (2): Introduce Domain Snapshot Interface Implement snapshots APIs data/Makefile.am| 1 + data/org.libvirt.Domain.xml | 26 +++ data/org.libvirt.DomainSnapshot.xml | 41 src/Makefile.am

Re: [libvirt] [PATCH 00/22] qemu: Store default CPU in domain XML

2019-10-07 Thread Andrea Bolognani
On Thu, 2019-10-03 at 16:00 +0200, Jiri Denemark wrote: > 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

[libvirt] [libvirt-dbus] [PATCH 2/2] Implement snapshots APIs

2019-10-07 Thread Simon Kobyda
Signed-off-by: Simon Kobyda --- data/org.libvirt.Domain.xml | 26 data/org.libvirt.DomainSnapshot.xml | 34 + src/domain.c| 158 + src/domainsnapshot.c| 204 +++- tests/Makefile.am

Re: [libvirt] [PATCH] build: ask for -std=gnu99 explicitly

2019-10-07 Thread Peter Krempa
On Mon, Oct 07, 2019 at 15:52:07 +0100, Daniel Berrange wrote: > On Mon, Oct 07, 2019 at 04:27:31PM +0200, Peter Krempa wrote: > > On Mon, Oct 07, 2019 at 15:09:52 +0100, Daniel Berrange wrote: > > > We previously got -std=gnu99 secretly enabled as a side-effect > > > of requesting the 'stdarg'

Re: [libvirt] Limiting old version back compat for language bindings ?

2019-10-07 Thread Andrea Bolognani
On Mon, 2019-10-07 at 13:35 +0100, Daniel P. Berrangé wrote: > On Mon, Oct 07, 2019 at 01:58:10PM +0200, Andrea Bolognani wrote: > > Can't we follow the same policy as the main library? That would make > > it more straightforward to reason about. Also note that our CI only > > runs jobs on the

Re: [libvirt] [PATCH] build: ask for -std=gnu99 explicitly

2019-10-07 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 04:27:31PM +0200, Peter Krempa wrote: > On Mon, Oct 07, 2019 at 15:09:52 +0100, Daniel Berrange wrote: > > We previously got -std=gnu99 secretly enabled as a side-effect > > of requesting the 'stdarg' gnulib module. We rely on some > > extensions from c99/gnu99 and while

Re: [libvirt] [PATCH 0/4] build: take full ownership of syntax-check from gnulib

2019-10-07 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 04:31:29PM +0200, Michal Privoznik wrote: > On 10/7/19 3:43 PM, Daniel P. Berrangé wrote: > > On Mon, Oct 07, 2019 at 03:03:51PM +0200, Michal Privoznik wrote: > > > On 10/3/19 12:51 PM, Daniel P. Berrangé wrote: > > > > Our syntax-check rule relies in various files

[libvirt] libvirt doc - missing entry in input devices section

2019-10-07 Thread Ruth Netser
The option is missing from code box under https://libvirt.org/formatdomain.html#elementsInput section. (Exists for the other devices). -- Ruty Netser -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

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

2019-10-07 Thread martinsson . patrik
From: patchon These commits simply adds the '--shrink' flag to the blockresize command to prevent accidental shrinking of a block device. This behaviour is already present on the vol-resize command and it makes sense to mimic that behaviour. Only implemented in the qemu-driver atm.

Re: [libvirt] [PATCH 0/4] build: take full ownership of syntax-check from gnulib

2019-10-07 Thread Michal Privoznik
On 10/7/19 3:43 PM, Daniel P. Berrangé wrote: On Mon, Oct 07, 2019 at 03:03:51PM +0200, Michal Privoznik wrote: On 10/3/19 12:51 PM, Daniel P. Berrangé wrote: Our syntax-check rule relies in various files imported during the gnulib bootstrap process. As we switch to meson & try to eliminate

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

2019-10-07 Thread martinsson . patrik
From: patchon This changes the behaviour when shrinking a block device. This should be a fairly uncommon thing to do (I think), so I don't think one have to worry about breaking anything when introducing the new flag (--shrink). This also mimics the existing behaviour of the vol-resize command,

Re: [libvirt] [PATCH] build: ask for -std=gnu99 explicitly

2019-10-07 Thread Peter Krempa
On Mon, Oct 07, 2019 at 15:09:52 +0100, Daniel Berrange wrote: > We previously got -std=gnu99 secretly enabled as a side-effect > of requesting the 'stdarg' gnulib module. We rely on some > extensions from c99/gnu99 and while RHEL-7 supports this, it > still defaults to gnu89. RHEL-7 also

Re: [libvirt] [PATCH] build: ask for -std=gnu99 explicitly

2019-10-07 Thread Fabiano Fidêncio
On Mon, Oct 7, 2019 at 4:16 PM Daniel P. Berrangé wrote: > > We previously got -std=gnu99 secretly enabled as a side-effect > of requesting the 'stdarg' gnulib module. We rely on some > extensions from c99/gnu99 and while RHEL-7 supports this, it > still defaults to gnu89. RHEL-7 also supports

Re: [libvirt] [PATCH] build: force -Werror for distcheck target

2019-10-07 Thread Fabiano Fidêncio
On Mon, Oct 7, 2019 at 4:16 PM Daniel P. Berrangé wrote: > > The 'make distcheck' target validates that a tarball builds and > is ready for release. We expect that libvirt builds cleanly on > all supported platforms, so we should be enabling -Werror when > running distcheck. > > This ensures that

Re: [libvirt] [PATCH 07/22] qemu: Introduce qemuMonitorCPUDefs struct

2019-10-07 Thread Ján Tomko
On Thu, Oct 03, 2019 at 04:00:25PM +0200, Jiri Denemark wrote: It is a container for a CPU models list (qemuMonitorCPUDefInfo) and a number of elements in this list. Surely introducing a new type with VIR_AUTOFREE_FUNC defined and not using it would look strange. But all the goto cleanup ->

[libvirt] [PATCH] build: force -Werror for distcheck target

2019-10-07 Thread Daniel P . Berrangé
The 'make distcheck' target validates that a tarball builds and is ready for release. We expect that libvirt builds cleanly on all supported platforms, so we should be enabling -Werror when running distcheck. This ensures that our CI systems in turn also use -Werror. Signed-off-by: Daniel P.

[libvirt] [PATCH] build: ask for -std=gnu99 explicitly

2019-10-07 Thread Daniel P . Berrangé
We previously got -std=gnu99 secretly enabled as a side-effect of requesting the 'stdarg' gnulib module. We rely on some extensions from c99/gnu99 and while RHEL-7 supports this, it still defaults to gnu89. RHEL-7 also supports some newer standards but declares them experimental/incomplete, so

Re: [libvirt] [PATCH 05/22] qemu: Use virQEMUCapsGetCPUDefinitions more

2019-10-07 Thread Ján Tomko
On Thu, Oct 03, 2019 at 04:00:23PM +0200, Jiri Denemark wrote: Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list

Re: [libvirt] [PATCH 04/22] qemu: Filter models in virQEMUCapsGetCPUDefinitions

2019-10-07 Thread Ján Tomko
On Thu, Oct 03, 2019 at 04:00:22PM +0200, Jiri Denemark wrote: 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:

Re: [libvirt] [PATCH 03/22] qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions

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

Re: [libvirt] [PATCH 0/4] build: take full ownership of syntax-check from gnulib

2019-10-07 Thread Daniel P . Berrangé
On Mon, Oct 07, 2019 at 03:03:51PM +0200, Michal Privoznik wrote: > On 10/3/19 12:51 PM, Daniel P. Berrangé wrote: > > Our syntax-check rule relies in various files imported during the gnulib > > bootstrap process. As we switch to meson & try to eliminate gnulib, we > > need to take ownership of

Re: [libvirt] -blockdev bug (and some questions)

2019-10-07 Thread Cole Robinson
On 10/7/19 2:07 AM, Peter Krempa wrote: On Sat, Oct 05, 2019 at 17:39:01 -0400, Cole Robinson wrote: Hi Peter + list, I'm testing libvirt -blockdev, using your enablement patches from here: https://www.redhat.com/archives/libvir-list/2019-September/msg00524.html I'm hitting an issue but the

Re: [libvirt] [PATCH 1/1] qemu_command: tidy up qemuBuildHostdevCommandLine loop

2019-10-07 Thread Ján Tomko
On Wed, Oct 02, 2019 at 09:37:38AM -0300, Daniel Henrique Barboza wrote: The current 'for' loop with 5 consecutive 'ifs' inside qemuBuildHostdevCommandLine can be a bit smarter: - all 5 'ifs' fails if hostdev->mode is not equal to VIR_DOMAIN_HOSTDEV_MODE_SUBSYS. This check can be moved to the

Re: [libvirt] [PATCH 0/4] build: take full ownership of syntax-check from gnulib

2019-10-07 Thread Michal Privoznik
On 10/3/19 12:51 PM, Daniel P. Berrangé wrote: Our syntax-check rule relies in various files imported during the gnulib bootstrap process. As we switch to meson & try to eliminate gnulib, we need to take ownership of syntax-check. This patch series follows the approach taken for libosinfo &

[libvirt] [RFC] default video device type

2019-10-07 Thread Pavel Mores
Hi, I'm looking into fixing https://bugzilla.redhat.com/show_bug.cgi?id=1668141 (as a short summary, if a graphics device is added to XML that has no video device, libvirt automatically adds a video device which is always of type 'cirrus' - even if the underlying qemu doesn't support cirrus).

  1   2   >