Re: [libvirt] [PATCH 08/10] virrandom: Make virRandomBits better

2018-05-30 Thread Michal Privoznik
On 05/29/2018 10:32 PM, Eric Blake wrote: > On 05/29/2018 03:24 AM, Michal Privoznik wrote: >> Now that we have strong PRNG generator implemented in >> virRandomBytes() let's use that instead of gnulib's random_r. >> >> Problem with the latter is in way we seed it: current UNIX time >> and libvirtd

Re: [libvirt] [PATCH] vfio/pci: Default display option to "off"

2018-05-30 Thread Erik Skultety
On Tue, May 29, 2018 at 09:24:08AM -0600, Alex Williamson wrote: > [Cc +Erik,libvirt] > > Sorry, should have cc'd libvirt with this initially since display > support is under development. I think "off" is the better > compatibility option, but perhaps the damage is done since it was the > 2.12 def

Re: [libvirt] Entering freeze for libvirt-4.4.0

2018-05-30 Thread Andrea Bolognani
On Tue, 2018-05-29 at 19:05 +0200, Daniel Veillard wrote: > ci.centos.org seems to be raising a few issues with bindings, > like perl python and go Those issues seem to be caused by new APIs having been introduced in libvirt but not in the bindings yet, so they should probably not hold up the

Re: [libvirt] Entering freeze for libvirt-4.4.0

2018-05-30 Thread Daniel Veillard
On Wed, May 30, 2018 at 09:48:48AM +0200, Andrea Bolognani wrote: > On Tue, 2018-05-29 at 19:05 +0200, Daniel Veillard wrote: > > ci.centos.org seems to be raising a few issues with bindings, > > like perl python and go > > Those issues seem to be caused by new APIs having been introduced > in

Re: [libvirt] [PATCH] storage: Add specific check for LUKS encryption support

2018-05-30 Thread Erik Skultety
On Tue, May 29, 2018 at 11:35:00AM -0400, John Ferlan wrote: > Modify virStorageBackendLogicalLVCreate to ensure if encryption > is requested that only type LUKS is supported; otherwise, error. > > Signed-off-by: John Ferlan > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-lis

[libvirt] [PATCH] tests: initialize some variables

2018-05-30 Thread Ján Tomko
Found by cppcheck: [tests/metadatatest.c:284]: (error) Uninitialized variable: test [tests/objecteventtest.c:855]: (error) Uninitialized variable: test Signed-off-by: Ján Tomko --- tests/metadatatest.c| 2 +- tests/objecteventtest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) d

Re: [libvirt] [PATCH] tests: initialize some variables

2018-05-30 Thread Jiri Denemark
On Wed, May 30, 2018 at 10:13:25 +0200, Ján Tomko wrote: > Found by cppcheck: > [tests/metadatatest.c:284]: (error) Uninitialized variable: test > [tests/objecteventtest.c:855]: (error) Uninitialized variable: test > > Signed-off-by: Ján Tomko Could have been pushed as trivial :-) Reviewed-by:

Re: [libvirt] Entering freeze for libvirt-4.4.0

2018-05-30 Thread Andrea Bolognani
On Wed, 2018-05-30 at 09:50 +0200, Daniel Veillard wrote: > On Wed, May 30, 2018 at 09:48:48AM +0200, Andrea Bolognani wrote: > > On Tue, 2018-05-29 at 19:05 +0200, Daniel Veillard wrote: > > > ci.centos.org seems to be raising a few issues with bindings, > > > like perl python and go > > > >

Re: [libvirt] [PATCH] spec: Fix permissions of nwfilter XMLs

2018-05-30 Thread Erik Skultety
On Tue, May 29, 2018 at 11:11:15PM +0200, Jiri Denemark wrote: > The nwfilter XMLs in /etc are defined as %ghost in the spec file, which > means rpm will not install them, but it will record its existence and > permissions in the database. During installation the files are copied in > a %post scrip

[libvirt] VMX parser: limitation of numvcpus

2018-05-30 Thread Pino Toscano
Hi Matthias, while testing the recent improvements I did in the VMX parser for CPU topology (see https://bugzilla.redhat.com/1568148), our QE Ming Xie set a guest in ESXi 5.5 to 7 cores. The result was the error triggered by the following code: /* vmx:numvcpus -> def:vcpus */ if (virVMXGe

[libvirt] [PATCH] vmx: Remove check that numvcpus has to be an even number.

2018-05-30 Thread Richard W.M. Jones
This patch removes what appears to be an unnecessary check in the VMX driver which is preventing us from importing guests that have an odd number of vCPUs with virt-v2v. Unfortunately to test this it seems you need a real VMware server somewhere (substitute for ‘example.com’ below). Download the

[libvirt] [PATCH] vmx: Remove check that numvcpus has to be an even number.

2018-05-30 Thread Richard W.M. Jones
https://bugzilla.redhat.com/show_bug.cgi?id=1584091 It is possible to create a VMware guest with an odd number of vCPUs, but such guests cannot be accessed by libvirt because of this unnecessary check. I retained the sanity-check that numvcpus must be >= 1. Signed-off-by: Richard W.M. Jones ---

Re: [libvirt] [PATCH 04/10] virCryptoGenerateRandom: Don't allocate return buffer

2018-05-30 Thread Michal Privoznik
On 05/30/2018 02:46 AM, Eric Blake wrote: > On 05/29/2018 03:24 AM, Michal Privoznik wrote: >> To unify our vir*Random() functions we need to make >> virCryptoGenerateRandom NOT allocate return buffer. It should >> just fill given buffer with random data. >> >> Signed-off-by: Michal Privoznik >> -

Re: [libvirt] [PATCH] vmx: Remove check that numvcpus has to be an even number.

2018-05-30 Thread Peter Krempa
On Wed, May 30, 2018 at 10:33:45 +0100, Richard W.M. Jones wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1584091 > > It is possible to create a VMware guest with an odd number of vCPUs, > but such guests cannot be accessed by libvirt because of this > unnecessary check. > > I retained the

Re: [libvirt] [PATCH] vmx: Remove check that numvcpus has to be an even number.

2018-05-30 Thread Pino Toscano
On Wednesday, 30 May 2018 11:33:45 CEST Richard W.M. Jones wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1584091 > > It is possible to create a VMware guest with an odd number of vCPUs, > but such guests cannot be accessed by libvirt because of this > unnecessary check. > > I retained the

[libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Dou Liyang
Hi All, I am not sure about the update strategy of CPU models in libvirt. IMO, It's depend on the CPU model in qemu-kvm, if some CPU models were updated in qemu-kvm. Then, we should modify the src/cpu/cpu_map.xml of libvirt to synchronize? eg: commit cad8054ece28("cpu: Add cpu definition for

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Jiri Denemark
[Dropping random people from Cc] On Wed, May 30, 2018 at 18:00:56 +0800, Dou Liyang wrote: > Hi All, > > I am not sure about the update strategy of CPU models in libvirt. > > IMO, It's depend on the CPU model in qemu-kvm, if some CPU models > were updated in qemu-kvm. Then, we should modify the

Re: [libvirt] [PATCH] conf: Introduce align for hostmem-file

2018-05-30 Thread Ján Tomko
On Tue, May 29, 2018 at 08:38:52PM +0800, Jie Wang wrote: QEMU has add the 'align' option to 'memory-backend-file'. Expose this option to users by new element align. Signed-off-by: Jie Wang --- docs/formatdomain.html.in | 18 +++ docs/schemas/domaincommon.rng

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Dou Liyang
Hi Jiri, At 05/30/2018 06:14 PM, Jiri Denemark wrote: [Dropping random people from Cc] On Wed, May 30, 2018 at 18:00:56 +0800, Dou Liyang wrote: Hi All, I am not sure about the update strategy of CPU models in libvirt. IMO, It's depend on the CPU model in qemu-kvm, if some CPU models were up

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Jiri Denemark
On Wed, May 30, 2018 at 18:55:02 +0800, Dou Liyang wrote: > Hi Jiri, > > At 05/30/2018 06:14 PM, Jiri Denemark wrote: > > [Dropping random people from Cc] > > > > On Wed, May 30, 2018 at 18:00:56 +0800, Dou Liyang wrote: > >> Hi All, > >> > >> I am not sure about the update strategy of CPU models

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Dou Liyang
Hi Jiri, At 05/30/2018 07:08 PM, Jiri Denemark wrote: On Wed, May 30, 2018 at 18:55:02 +0800, Dou Liyang wrote: Hi Jiri, At 05/30/2018 06:14 PM, Jiri Denemark wrote: [Dropping random people from Cc] On Wed, May 30, 2018 at 18:00:56 +0800, Dou Liyang wrote: Hi All, I am not sure about the u

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Peter Krempa
[re-adding libvir-list] On Wed, May 30, 2018 at 19:36:10 +0800, Dou Liyang wrote: > Hi Peter, > > Sorry to trouble you offline. Please keep conversations on the list, so that it does not get lost in private inboxes. > Recently, I forced on the PCID feature in CPU and > found the SandyBridge di

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Jiri Denemark
On Wed, May 30, 2018 at 19:25:53 +0800, Dou Liyang wrote: > Hi Jiri, > > At 05/30/2018 07:08 PM, Jiri Denemark wrote: > > On Wed, May 30, 2018 at 18:55:02 +0800, Dou Liyang wrote: > >> Hi Jiri, > >> > >> At 05/30/2018 06:14 PM, Jiri Denemark wrote: > >>> [Dropping random people from Cc] > >>> > >>

Re: [libvirt] [PATCH 08/10] virrandom: Make virRandomBits better

2018-05-30 Thread Michal Privoznik
On 05/29/2018 03:44 PM, Martin Kletzander wrote: > On Tue, May 29, 2018 at 10:24:44AM +0200, Michal Privoznik wrote: >> Now that we have strong PRNG generator implemented in >> virRandomBytes() let's use that instead of gnulib's random_r. >> >> Problem with the latter is in way we seed it: current

[libvirt] [PATCH 06/38] qemu: domain: Setup disk encryption password secret via new helper

2018-05-30 Thread Peter Krempa
The encryption secret is setup only for LUKS and thus requires the new approach. Use qemuDomainSecretInfoNew for initializing it. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/q

[libvirt] [PATCH 07/38] qemu: domain: Use qemuDomainSecretInfoNewPlain only for unencrypted secrets

2018-05-30 Thread Peter Krempa
Move the logic that determines which secret shall be used into the caller and make this function work only for plain secrets. This untangles the control flow by only checking relevant data. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 94 -

[libvirt] [PATCH 10/38] qemu: Store and parse disk authentication and encryption secret alias

2018-05-30 Thread Peter Krempa
Rather than trying to figure out which alias was used, store it in the status XML. --- src/qemu/qemu_domain.c| 90 +-- tests/qemustatusxml2xmldata/modern-in.xml | 4 ++ 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_do

[libvirt] [PATCH 01/38] qemu: domain: Add helper to check if encrypted secrets can be used with a VM

2018-05-30 Thread Peter Krempa
This helper checks that the vm has the master key setup and libvirt supports the given encryption algorithm. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 19 +-- src/qemu/qemu_domain.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/qemu/q

[libvirt] [PATCH 13/38] qemu: hotplug: Don't try to infer secret object alias/presence

2018-05-30 Thread Peter Krempa
Now that we remember the alias we've used to attach the secret objects we should reuse them rather than trying to infer them from the disk configuration. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 43 --- 1 file changed, 12 insertions(+), 31

[libvirt] [PATCH 15/38] qemu: domain: Store and restore TLS object alias of a disk

2018-05-30 Thread Peter Krempa
Libvirt uses the stored alias to detach the tlx x509 object on disk unplug. As the alias was not stored, the object would not be detached if unplugging disks after libvirtd restart. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c| 5 + tests/qemustatusxml2xmldata/m

[libvirt] [PATCH 03/38] qemu: domain: Rename qemuDomainSecretDiskCapable

2018-05-30 Thread Peter Krempa
The function checks whether the storage source requires authentication secret setup. Rename it accordingly. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_domain.h | 2 +- src/qemu/qemu_hotplug.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff -

[libvirt] [PATCH 00/38] qemu: Refactor secret/TLS setup and add TLS for nbd

2018-05-30 Thread Peter Krempa
This series consists of the following changes: 1) refactors to handling of the TLS object and secret alias 2) storage of 'secret' object aliases in the status XML 3) fix of disk-unplug with TLS after libvirtd restart 4) Adding support for TLS for NBD disks (originally used to reproduce

[libvirt] [PATCH 12/38] qemu: domain: Regenerate auth/enc secret aliases when restoring status XML

2018-05-30 Thread Peter Krempa
Previously we did not store the aliases but rather re-generated them when unplug was necessary. This is very cumbersome since the knowledge when and which alias to use needs to be stored in the hotplug code as well. While this patch will not strictly improve this situation since there still will b

[libvirt] [PATCH 05/38] qemu: domain: Add new function to set up encrypted secrets only

2018-05-30 Thread Peter Krempa
Some code paths can't use the unencrypted secret. Add a helper which checks and sets up an encrypted secret only and reuse it when setting up the secret to decrypt the TLS private key in qemuDomainSecretInfoTLSNew. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 49 +

[libvirt] [PATCH 04/38] qemu: domain: Rename and fix docs for qemuDomainSecretInfoNew

2018-05-30 Thread Peter Krempa
Rename it to qemuDomainSecretInfoNewPlain and annotate that it also may set up a 'plain' secret in some cases. This will eventually be refactored further. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 37 +++-- 1 file changed, 19 insertions(+), 18 delet

[libvirt] [PATCH 17/38] qemu: domain: Properly setup data relevant for top disk image

2018-05-30 Thread Peter Krempa
qemuDomainPrepareDiskSourceChain should set up the disk zero detection mode only for the top level image. Since it's invoked also for the middle of the chain we need to check that it's really only the top level image. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 3 ++- 1 file changed

[libvirt] [PATCH 02/38] qemu: domain: Reuse code when preparing hostdev auth secrets

2018-05-30 Thread Peter Krempa
Use qemuDomainSecretStorageSourcePrepare in qemuDomainSecretHostdevPrepare as it uses a virStorageSource to prepare the authentication secret object data. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/s

[libvirt] [PATCH 08/38] qemu: domain: Add helpers for partially clearing qemuDomainSecretInfoPtr

2018-05-30 Thread Peter Krempa
It's desired to keep the alias around to allow referencing of the secret object used with qemu. Add set of APIs which will destroy all data except the alias. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 43 +++ src/qemu/qemu_domain.h | 2 ++ 2

[libvirt] [PATCH 18/38] qemu: domain: don't loop through images in qemuDomainPrepareDiskSourceChain

2018-05-30 Thread Peter Krempa
Convert the function to just prepare data for the disk. Callers need to do the looping since there's more to do than just copy the data around. The code path in qemuDomainPrepareDiskSource doesn't need to loop over the chain yet, since there currently is no chain at this point. This will be addres

[libvirt] [PATCH 11/38] tests: qemustatusxml2xml: Add test data for re-generating LUKS/auth aliases

2018-05-30 Thread Peter Krempa
Add tests for upcomming re-generation of aliases for the secret objects used by qemu when upgrading libvirt. Signed-off-by: Peter Krempa --- .../disk-secinfo-upgrade-in.xml| 507 + .../disk-secinfo-upgrade-out.xml | 507 ++

[libvirt] [PATCH 26/38] qemu: hotplug: Don't mandate passing of 'secAlias' in qemuDomainGetTLSObjects

2018-05-30 Thread Peter Krempa
For some reason the function returned an error if secAlias was not passed in. It's not an error, in fact it's desired. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c ind

[libvirt] [PATCH 14/38] qemu: hotplug: Use 'tlsAlias' to see whether to detach the disk

2018-05-30 Thread Peter Krempa
Using 'haveTLS' to do this is pointless if the alias is not set. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5e2ca1b988..f8f1d2c323 100644 --- a/src/qemu/qemu_h

[libvirt] [PATCH 09/38] qemu: domain: Don't delete aliases of secret objects associated with disks

2018-05-30 Thread Peter Krempa
We need to reference the secret objects by name when hot-unplugging disks. Don't remove the alias so that it does not need to be recalculated. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git

[libvirt] [PATCH 16/38] qemu: domain: Regenerate alias for the TLS x509 credential object

2018-05-30 Thread Peter Krempa
When restarting libvirt would previously lose the alias of the x509 certificate object. Upon unplug we would then not delete the corresponding objects. Restore the alias if we know it shoudl be there. Luckily for disks we don't support encrypted TLS nevironment, so there's no need to regenerate t

[libvirt] [PATCH 34/38] qemu: hotplug: Remove misleading comment in qemuDomainGetTLSObjects

2018-05-30 Thread Peter Krempa
'secinfo' is present also for migrations. Delete the misleading comment. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1b36e7fdfa..cb3d3f581a 100644 --- a/src/qemu/qemu_hotplug.

[libvirt] [PATCH 19/38] qemu: domain: Split validation and setup of the virStorageSource

2018-05-30 Thread Peter Krempa
Remove the call to the validating function from the function which sets stuff up. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 11 +++ src/qemu/qemu_domain.h | 6 ++ tests/qemublocktest.c | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu

[libvirt] [PATCH 21/38] qemu: domain: Separate setup of TLS for VXHS disks from qemuDomainPrepareDiskSourceTLS

2018-05-30 Thread Peter Krempa
Split out the code into a separate function so that all steps for a storage protocol are contained and the original function is easily extendable. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 51 -- 1 file changed, 29 insertions(+), 22

[libvirt] [PATCH 23/38] qemu: domain: Process only one object in qemuDomainPrepareDiskSourceTLS

2018-05-30 Thread Peter Krempa
Remove the loop from qemuDomainPrepareDiskSourceTLS and rename it to qemuDomainPrepareStorageSourceTLS. Currently there is no backing chain to prepare so fixing one device is equivalent. In the future it will be reused in a function which will do the looping. Signed-off-by: Peter Krempa --- src/

[libvirt] [PATCH 28/38] qemu: domain: Set up disk TLS alias when preparing TLS setup

2018-05-30 Thread Peter Krempa
Move the TLS object alias setup earlier. Also make sure that the alias is not overwritten on hotplug. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 3 --- src/qemu/qemu_domain.c | 14 ++ src/qemu/qemu_hotplug.c | 8 +++- 3 files changed, 13 insertions(+), 12 deleti

[libvirt] [PATCH 20/38] qemu: domain: aggregate setup of disk drive options for -drive

2018-05-30 Thread Peter Krempa
When using blockdev the approach to base aliases will change. Add a helper function that will aggregate all code which needs to be called with the disk alias for the -drive to setup internal data. qemuDomainSecretDiskPrepare wrapper is no longer necessary as the contents were moved to a function w

[libvirt] [PATCH 22/38] qemu: domain: Use switch statement in qemuDomainPrepareDiskSourceTLS

2018-05-30 Thread Peter Krempa
Select protocol using a swtich with all cases enumerated. This will simplify checking unsupported protocols and adding new support. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/q

[libvirt] [PATCH 29/38] qemu: command: Don't generate alias for TLS private key password secret

2018-05-30 Thread Peter Krempa
qemuBuildTLSx509CommandLine has no business guessing which alias should be used. The alias needs to be passed in. Note that there's a lingering bad design of this, since the secret object alias is based on the device name and not on the fact that the secret is used for decrypting of the TLS privat

[libvirt] [PATCH 25/38] conf: Don't encode matrix of storage protocols supporting TLS in the parser

2018-05-30 Thread Peter Krempa
Always parse the 'tls' source field and let the drivers decide whether they support it. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 544f63a2a9..51e

[libvirt] [PATCH 24/38] qemu: domain: Forbid TLS setup for disk protocols not supporting it

2018-05-30 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 5e8ff675c8..55e47a482d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9971,6 +9971,12 @@ qemuDomainPrepareSt

[libvirt] [PATCH 27/38] qemu: hotplug: Allow passing in NULL 'tlsAlias' to qemuDomainGetTLSObjects

2018-05-30 Thread Peter Krempa
Some callers will not need to generate the alias again. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8cfb81d545..f52e0c773d 100644 --- a/src/qemu/qemu_hotplug.

[libvirt] [PATCH 30/38] qemu: command: Pass in alias for TLS object to qemuBuildTLSx509CommandLine

2018-05-30 Thread Peter Krempa
Callers need to know the alias anyways so it does not make much sense to generate it inside of this function. Note that there's a lingering bad design of this, since the secret object alias is based on the device name and not on the fact that the secret is used for decrypting of the TLS private ke

[libvirt] [PATCH 33/38] qemu: hotplug: Pass around existing secret object alias from qemuDomainAddChardevTLSObjects

2018-05-30 Thread Peter Krempa
Setting up the 'secinfo' for the TLS private key password also generates the given alias, so we don't need to generate another one. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH 36/38] qemu: hotplug: Remove TLS alias generation from qemuDomainGetTLSObjects

2018-05-30 Thread Peter Krempa
Callers should generate the alias separately. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 14 +- src/qemu/qemu_hotplug.h | 2 -- src/qemu/qemu_migration_params.c | 6 -- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qem

[libvirt] [PATCH 37/38] tests: qemu: Rename disk-drive-network-tlsx509-vxhs test

2018-05-30 Thread Peter Krempa
Drop the 'vxhs' suffix so other network protocols using TLS can be put into the same test. Signed-off-by: Peter Krempa --- ...-drive-network-tlsx509-vxhs.args => disk-drive-network-tlsx509.args} | 0 ...sk-drive-network-tlsx509-vxhs.xml => disk-drive-network-tlsx509.xml} | 0 tests/qemuxml2argvt

[libvirt] [PATCH 31/38] qemu: command: Always setup TLS environment if src->haveTLS is on

2018-05-30 Thread Peter Krempa
We make sure that the disk supports TLS when preparing the environment so there's no need to duplicate checks. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_co

[libvirt] [PATCH 32/38] qemu: migration: Don't pass around secAlias

2018-05-30 Thread Peter Krempa
The alias of the secret for decrypting the TLS passphrase is useless besides for TLS setup. Stop passing it around. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c| 8 ++-- src/qemu/qemu_migration_params.c | 21 +++-- src/qemu/qemu_migration_params.h | 1 -

[libvirt] [PATCH 35/38] qemu: hotplug: Drop 'secAlias' output parameter from qemuDomainGetTLSObjects

2018-05-30 Thread Peter Krempa
No callers are using it. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 17 +++-- src/qemu/qemu_hotplug.h | 3 +-- src/qemu/qemu_migration_params.c | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qem

[libvirt] [PATCH 38/38] qemu: domain: Add support for TLS for NBD with default TLS env

2018-05-30 Thread Peter Krempa
Use the default TLS env if TLS is required for NBD. The rest of the implementation is rather simple since all pieces were in place. Note that separate configuration knobs in qemu.conf can be added later if it's desired to configure them. Signed-off-by: Peter Krempa --- docs/schemas/domaincommon

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Dou Liyang
Hi Peter, Thank you for reply. At 05/30/2018 08:00 PM, Peter Krempa wrote: [re-adding libvir-list] On Wed, May 30, 2018 at 19:36:10 +0800, Dou Liyang wrote: Hi Peter, Sorry to trouble you offline. Please keep conversations on the list, so that it does not get lost in private inboxes. Re

[libvirt] [PATCH 0/2] travis: Minor macOS improvements

2018-05-30 Thread Andrea Bolognani
Andrea Bolognani (2): travis: Move PATH to macOS-specific environment travis: Install and use ccache on macOS .travis.yml | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir

[libvirt] [PATCH 2/2] travis: Install and use ccache on macOS

2018-05-30 Thread Andrea Bolognani
As documented in [1], ccache needs to be installed and configured explicitly on macOS. [1] https://docs.travis-ci.com/user/caching/#ccache-cache Signed-off-by: Andrea Bolognani --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml inde

[libvirt] [PATCH 1/2] travis: Move PATH to macOS-specific environment

2018-05-30 Thread Andrea Bolognani
Now that we have separate sections for each build configuration, there's no reason to set PATH in the global environment. Signed-off-by: Andrea Bolognani --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f4dd0427a9..ddc902888

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Dou Liyang
At 05/30/2018 08:11 PM, Jiri Denemark wrote: On Wed, May 30, 2018 at 19:25:53 +0800, Dou Liyang wrote: Hi Jiri, At 05/30/2018 07:08 PM, Jiri Denemark wrote: On Wed, May 30, 2018 at 18:55:02 +0800, Dou Liyang wrote: Hi Jiri, At 05/30/2018 06:14 PM, Jiri Denemark wrote: [Dropping random peopl

[libvirt] [RFC PATCH 1/7] conf: Remove a redundant model/address-type check in mdev post parse

2018-05-30 Thread Erik Skultety
It's pointless to check the same thing multiple times. Fix the indentation along the way too. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 544f63a2

[libvirt] [RFC PATCH 2/7] qemu: command: Move graphics iteration to its own function

2018-05-30 Thread Erik Skultety
It should be the command line helper who takes care of the iteration rather than the caller. Signed-off-by: Erik Skultety --- src/qemu/qemu_command.c | 60 + 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_command.c b/

[libvirt] [RFC PATCH 5/7] qemu: caps: Add vfio-pci.display capability

2018-05-30 Thread Erik Skultety
QEMU 2.12 introduced a new vfio-pci device option 'display=on/off/auto'. Initially, libvirt is only going to support values on/off only, as we don't want to predict what the intended usage of the mediated device will be and most importantly, what kind of vfio display implementation to use - dmabuf

[libvirt] [RFC PATCH 7/7] qemu: command: Enable formatting vfio-pci.display option onto cmdline

2018-05-30 Thread Erik Skultety
Signed-off-by: Erik Skultety --- src/qemu/qemu_command.c| 24 +++- .../hostdev-mdev-display-spice-no-opengl.args | 32 ++ .../hostdev-mdev-display-spice-opengl.args | 31 + .../qemuxml2argvdata/hostdev-md

[libvirt] [RFC PATCH 3/7] conf: Introduce virDomainDefHasSpiceGL helper

2018-05-30 Thread Erik Skultety
This helper will later help us to make corresponding changes when building QEMU cmdline, depending on what implementation of vfio-pci display should be used - dmabuf (requires OpenGL) vs vfio region mapping (doesn't need OpenGL). Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 24 +++

[libvirt] [RFC PATCH 4/7] conf: Introduce new attribute 'display'

2018-05-30 Thread Erik Skultety
QEMU introduced a new type of display for mediated devices using vfio-pci backend which controls whether a mediated device can be used as a native rendering device as an alternative to an emulated video device. This patch adds the necessary bits to domain config handling in order to expose this fea

[libvirt] [RFC PATCH 6/7] qemu: domain: Set default vfio-pci display value depending on capability

2018-05-30 Thread Erik Skultety
If QEMU supports vfio-pci.display option, we default to 'off' as we're not trying to guess what a user's intentions with the mdev are. Perform this decision as part of driver-specific post parse callback. Signed-off-by: Erik Skultety --- src/qemu/qemu_domain.c | 32 ++

[libvirt] [RFC PATCH 0/7] Enable vfio-pci 'property' for mediated devices

2018-05-30 Thread Erik Skultety
Since QEMU 2.12 there's a new vfio-pci device property 'display' with values on/off/auto. This special kind of display allows using a mediated device which is a VGA compatible device for a display output. There are 2 different implementations of how the device output is handled, referred to as dmab

Re: [libvirt] [PATCH 08/10] virrandom: Make virRandomBits better

2018-05-30 Thread Martin Kletzander
On Wed, May 30, 2018 at 02:16:08PM +0200, Michal Privoznik wrote: On 05/29/2018 03:44 PM, Martin Kletzander wrote: On Tue, May 29, 2018 at 10:24:44AM +0200, Michal Privoznik wrote: Now that we have strong PRNG generator implemented in virRandomBytes() let's use that instead of gnulib's random_r

Re: [libvirt] [PATCH 10/10] vircrypto: Drop virCryptoGenerateRandom

2018-05-30 Thread Martin Kletzander
On Tue, May 29, 2018 at 10:24:46AM +0200, Michal Privoznik wrote: Now that virCryptoGenerateRandom() is plain wrapper over virRandomBytes() we can drop it in favour of the latter. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 - src/qemu/qemu_domain.c | 5 +++-- src/util/vi

Re: [libvirt] [PATCH 0/5] Add support for extended TSEG

2018-05-30 Thread Martin Kletzander
ping I wanted this to get into 4.4.0 :( I'll send update for this feature in docs/news.xml as a bribe... signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 1/2] tests: qemublock: Test NBD with TLS

2018-05-30 Thread Peter Krempa
Signed-off-by: Peter Krempa --- tests/qemublocktest.c| 1 + .../qemublocktestdata/xml2json/network-nbd-tls.json | 20 tests/qemublocktestdata/xml2json/network-nbd-tls.xml | 18 ++ 3 files changed, 39 insertions(+) create mode

[libvirt] [PATCH 0/2] qemu: block: Add more tests and support for pr-manager

2018-05-30 Thread Peter Krempa
Note that patch 1 can be applied only with the series adding TLS support for NBD. Patch 2 is independent. Peter Krempa (2): tests: qemublock: Test NBD with TLS qemu: block: Add support for 'pr-manager' in qemuBlockStorageSourceGetFileProps src/qemu/qemu_block.c

[libvirt] [PATCH 2/2] qemu: block: Add support for 'pr-manager' in qemuBlockStorageSourceGetFileProps

2018-05-30 Thread Peter Krempa
To keep feature parity, we need to be able to format the PR manager alias when using blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 + tests/qemublocktest.c | 1 + .../qemublocktestdata/xml2json/

[libvirt] [PATCH 0/2] Trivial memory leak fixes

2018-05-30 Thread Ján Tomko
Hopefully pushed as trivial by the time you're reading this message. Ján Tomko (2): qemu: free migEvent in qemuMigrationCapsCheck conf: fix vsock memory leaks src/conf/domain_conf.c | 2 ++ src/qemu/qemu_migration_params.c | 1 + 2 files changed, 3 insertions(+) -- 2.16.1 -- lib

[libvirt] [PATCH 2/2] conf: fix vsock memory leaks

2018-05-30 Thread Ján Tomko
Introduced by: commit d4abb7b45d48aba77c2464dbea95f02a43a60834 conf: introduce element commit b8b42ca036adbfaac1741c8efe389cd1403e220b qemu: add support for vhost-vsock-pci Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf

[libvirt] [PATCH 1/2] qemu: free migEvent in qemuMigrationCapsCheck

2018-05-30 Thread Ján Tomko
We allocate a temporary bitmap but never free it. Introduced by : qemu: Do not use qemuMonitorSetMigrationCapability Signed-off-by: Ján Tomko --- src/qemu/qemu_migration_params.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_p

Re: [libvirt] What is the strategy to update the CPU Models in src/cpu/cpu_map.xml based on?

2018-05-30 Thread Jiri Denemark
On Wed, May 30, 2018 at 21:11:35 +0800, Dou Liyang wrote: > Hi Peter, > > Thank you for reply. > > At 05/30/2018 08:00 PM, Peter Krempa wrote: > > > > [re-adding libvir-list] > > > > On Wed, May 30, 2018 at 19:36:10 +0800, Dou Liyang wrote: > >> Hi Peter, > >> > >> Sorry to trouble you offline.

Re: [libvirt] [PATCH 1/2] qemu: free migEvent in qemuMigrationCapsCheck

2018-05-30 Thread Peter Krempa
On Wed, May 30, 2018 at 16:08:06 +0200, Ján Tomko wrote: > We allocate a temporary bitmap but never free it. > > Introduced by : > qemu: Do not use qemuMonitorSetMigrationCapability > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_migration_params.c | 1 + > 1 file changed, 1 insertion(+)

Re: [libvirt] [PATCH 2/2] conf: fix vsock memory leaks

2018-05-30 Thread Peter Krempa
On Wed, May 30, 2018 at 16:08:07 +0200, Ján Tomko wrote: > Introduced by: > commit d4abb7b45d48aba77c2464dbea95f02a43a60834 > conf: introduce element > commit b8b42ca036adbfaac1741c8efe389cd1403e220b > qemu: add support for vhost-vsock-pci > > Signed-off-by: Ján Tomko > --- > src/conf/d

Re: [libvirt] [PATCH 1/5] docs: Tiny fix for the SMM description

2018-05-30 Thread John Ferlan
On 05/21/2018 11:00 AM, Martin Kletzander wrote: > The default is actually `on` when `` is specified. > > Signed-off-by: Martin Kletzander > --- > docs/formatdomain.html.in | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > , commit id d0e4be9d was wrong w/r/t the default... S

[libvirt] [PATCH 4/8] qemu: export vsock-related functions

2018-05-30 Thread Ján Tomko
Export qemuAssignDeviceVsockAlias, qemuBuildVsockDevStr and qemuProcessOpenVhostVsock for reuse in hotplug. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_alias.c | 2 +- src/qemu/qemu_alias.h | 2 ++ src/qemu/qemu_command.c | 2 +- src/qemu/q

[libvirt] [PATCH 0/8] vsock hotplug

2018-05-30 Thread Ján Tomko
Followup for: https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Ján Tomko (8): qemu: split out qemuBuildVsockDevStr qemuBuildVsockDevStr: allow passing a fdprefix export virDomainVsockDefFree qemu: export vsock-related functions qemu: implement vsock hotplug conf: introduce virDomain

[libvirt] [PATCH 2/8] qemuBuildVsockDevStr: allow passing a fdprefix

2018-05-30 Thread Ján Tomko
A string prefix for the file descriptor name. Domain startup uses the numeric value of fd without a prefix, but hotplug will need to use a prefix because file descriptor names passed via add-fd cannot start with a number. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomk

[libvirt] [PATCH 1/8] qemu: split out qemuBuildVsockDevStr

2018-05-30 Thread Ján Tomko
Split out the device string building to allow reusal in hotplug. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_command.c | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_comm

[libvirt] [PATCH 5/8] qemu: implement vsock hotplug

2018-05-30 Thread Ján Tomko
Allow hotplugging the vsock device. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 9 ++- src/qemu/qemu_hotplug.c | 70 + src/qemu/qemu_hotplug.h | 4 +++ 3 files changed, 82 insert

[libvirt] [PATCH 3/8] export virDomainVsockDefFree

2018-05-30 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6001635916..5405250ee9 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_p

[libvirt] [PATCH 7/8] qemu: implement vsock hotunplug

2018-05-30 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 5 +++- src/qemu/qemu_hotplug.c | 68 - src/qemu/qemu_hotplug.h | 3 +++ 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/sr

[libvirt] [PATCH 8/8] qemu: implement vsock coldplug/coldunplug

2018-05-30 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e030a9e095..6496fe4719 100644 --- a/src/qemu/q

[libvirt] [PATCH 6/8] conf: introduce virDomainVsockDefEquals

2018-05-30 Thread Ján Tomko
Introduce a function for comparing two vsock definitions. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/conf/domain_conf.c | 18 ++ src/conf/domain_conf.h | 3 +++ src/libvirt_private.syms | 1 + 3 files changed, 22 insertions(+) dif

Re: [libvirt] [PATCH 01/38] qemu: domain: Add helper to check if encrypted secrets can be used with a VM

2018-05-30 Thread Ján Tomko
On Wed, May 30, 2018 at 02:40:57PM +0200, Peter Krempa wrote: This helper checks that the vm has the master key setup and libvirt supports the given encryption algorithm. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 19 +-- src/qemu/qemu_domain.h | 2 ++ 2 files chang

Re: [libvirt] [PATCH 2/5] qemu: Move checks for SMM from command-line creation into validation phase

2018-05-30 Thread John Ferlan
On 05/21/2018 11:00 AM, Martin Kletzander wrote: > We are still hoping all of such checks will be moved there and this is one > small > step in that direction. > > One of the things that this is improving is the error message you get when > starting a domain with SMM and i440fx, for example.

  1   2   >