Re: [libvirt] [PATCH 1/3] virNetDevOpenvswitchInterfaceStats: Optimize for speed

2019-07-12 Thread Michal Prívozník
On 7/12/19 6:28 PM, Ján Tomko wrote: > On Wed, Jul 03, 2019 at 09:19:18AM +0200, Michal Privoznik wrote: >> We run 'ovs-vsctl' nine times (first to find if interface is >> there and then eight times = for each stats member separately). >> This is very inefficient. I've found a way to run it once an

[libvirt] [PATCH] maint: RNG comment fix

2019-07-12 Thread Eric Blake
Typo'd at file creation in commit 0c97dc41. Signed-off-by: Eric Blake --- Pushing under the trivial rule docs/schemas/basictypes.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng index 9b3dcad4a5..70d2101b78 100644

[libvirt] [PATCH v3 1/2] qemu: Add bochs-display capability

2019-07-12 Thread Jonathon Jongsma
Check whether qemu supports the bochs-display device and set a capability. Update tests. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h | 3 +++ tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml |

[libvirt] [PATCH v3 2/2] qemu: add 'bochs' video display type

2019-07-12 Thread Jonathon Jongsma
Update schema and configuration to allow specifying new video type of 'bochs'. Add implementation and tests for qemu. Signed-off-by: Jonathon Jongsma --- docs/formatdomain.html.in | 5 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c

[libvirt] [PATCH v3 0/2] add support for bochs-video device

2019-07-12 Thread Jonathon Jongsma
Changes from v2: - fix version number in documentation - move bochs to its own case in virDomainVideoDefaultRAM() - use pcieFlags instead of pciFlags in qemuDomainDeviceCalculatePCIConnectFlags() - use DO_TEST_CAPS_LATEST() in test Jonathon Jongsma (2): qemu: Add bochs-display capability

[libvirt] [PATCH] tests: skip systemd activation test if FDs 3/4/5 are open

2019-07-12 Thread Daniel P . Berrangé
With systemd activation the passed in file descriptors are required to be numbered from STDERR_FILENO + 1 onwards. The unit tests thus require FDs 3, 4 and 5 to be available. This may not be the case in all environments in which the tests run. For example on RHEL7 it was seen that a library constr

Re: [libvirt] [PATCH] security: aa-helper: allow virt-aa-helper to read .vhd images

2019-07-12 Thread Jamie Strandboge
On Wed, 03 Jul 2019, Christian Ehrhardt wrote: > VHD images can be used as any other, so we should add them to the list > of types that virt-aa-helper can read when creating the per-guest rules > for backing files. > > Signed-off-by: Christian Ehrhardt > --- > src/security/apparmor/usr.lib.libv

Re: [libvirt] [PATCH 3/3] virCommand: use procfs to learn opened FDs

2019-07-12 Thread Eric Blake
On 7/3/19 2:19 AM, Michal Privoznik wrote: > When spawning a child process, between fork() and exec() we close > all file descriptors and keep only those the caller wants us to > pass onto the child. The problem is how we do that. Currently, we > get the limit of opened files and then iterate throu

Re: [libvirt] [PATCH 2/3] vircommand: Separate mass FD closing into a function

2019-07-12 Thread Ján Tomko
On Wed, Jul 03, 2019 at 09:19:19AM +0200, Michal Privoznik wrote: I will optimize this code a bit in the next commit. But for that it is better if the code lives in a separate function. Signed-off-by: Michal Privoznik --- src/util/vircommand.c | 52 --- 1

Re: [libvirt] [PATCH 1/3] virNetDevOpenvswitchInterfaceStats: Optimize for speed

2019-07-12 Thread Ján Tomko
On Wed, Jul 03, 2019 at 09:19:18AM +0200, Michal Privoznik wrote: We run 'ovs-vsctl' nine times (first to find if interface is there and then eight times = for each stats member separately). This is very inefficient. I've found a way to run it once and with a bit of help from virJSON module we ca

[libvirt] [PATCH v5 12/20] utils: Convert pollfd array to be allocated

2019-07-12 Thread Stefan Berger
Convert the struct pollfd *fds to be allocated rather than residing on the stack. This prepares it for the next patch where the size of the array of fds becomes dynamic. Signed-off-by: Stefan Berger Reviewed-by: Daniel P. Berrangé --- src/util/vircommand.c | 5 - 1 file changed, 4 insertion

[libvirt] [PATCH v5 13/20] utils: Mark inpipe as non-blocking

2019-07-12 Thread Stefan Berger
Mark a virCommand's inpipe (write-end of pipe) as non-blocking so that it will never block when we were to try to write too many bytes to it while it doesn't have the capacity to hold them. Signed-off-by: Stefan Berger --- src/util/vircommand.c | 7 +++ 1 file changed, 7 insertions(+) diff

[libvirt] [PATCH v5 17/20] tpm: Pass migration key passphrase via fd to swtpm

2019-07-12 Thread Stefan Berger
This patch now passes the passphrase as a migration key to swtpm. This now encrypts the state of the TPM while a VM is migrated between hosts or when suspended into a file. Since the migration key secret is the same as the state encryption secret, this now requires that the migration destination ho

[libvirt] [PATCH v5 09/20] tpm: Check whether previously found executables were updated

2019-07-12 Thread Stefan Berger
Check whether previously found executables were updated and if so look for them again. This helps to use updated features of swtpm and its tools upon updating them. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- src/qemu/qemu_tpm.c | 1 + src/util/virtpm.c | 34 +

[libvirt] [PATCH v5 02/20] tests: Add already existing test case tpm-emulator-tpm2

2019-07-12 Thread Stefan Berger
Add an already existing test case tpm-emulator-tpm2 to qemuxml2xmltest.c Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- tests/qemuxml2xmltest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c

[libvirt] [PATCH v5 19/20] docs: Extend Secret XML documentation with vtpm usage type

2019-07-12 Thread Stefan Berger
Extend the Secret XML documentation with vtpm usage type. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- docs/formatsecret.html.in | 61 +-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/docs/formatsecret.html.in b/docs/forma

[libvirt] [PATCH v5 20/20] docs: Extend TPM docs with new encryption element

2019-07-12 Thread Stefan Berger
Describe the encryption element in the TPM's domain XML. Signed-off-by: Stefan Berger --- docs/formatdomain.html.in | 12 1 file changed, 12 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a7a6ec32a5..1e27a3220b 100644 --- a/docs/formatdomain.

[libvirt] [PATCH v5 07/20] tpm: Move qemuTPMEmulatorInit to virTPMEmulatorInit in virtpm.c

2019-07-12 Thread Stefan Berger
Move qemuTPMEmulatorInit to virTPMEmulatorInit in virtpm.c and introduce a few functions to query the executables needed for virCommands. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- src/libvirt_private.syms | 4 ++ src/qemu/qemu_tpm.c | 83 -

[libvirt] [PATCH v5 14/20] utils: Extend virCommandProcessIO to include the send buffers

2019-07-12 Thread Stefan Berger
Extend virCommandProcessIO to include the send buffers in the poll loop. Signed-off-by: Stefan Berger --- src/util/vircommand.c | 62 ++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index bb9e

[libvirt] [PATCH v5 05/20] tests: Add test for TPM XML encryption parser and formatter

2019-07-12 Thread Stefan Berger
Add a test case for the TPM XML encryption parser and formatter. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- .../tpm-emulator-tpm2-enc.xml | 32 + .../tpm-emulator-tpm2-enc.xml | 36 +++ tests/qemuxml2xmltest.c

[libvirt] [PATCH v5 15/20] tests: Extend command test to transfer large data to process on multiple fds

2019-07-12 Thread Stefan Berger
Add a test case to commandtest.c to test the transfer of data to a process who received the read-end of pipes' file descriptors. Transfer large (128 kb) byte streams. Extend the commandhelper.c with support for --readfd command line parameter and convert the data receive loop to use poll and rece

[libvirt] [PATCH v5 16/20] tpm: Use fd to pass password to swtpm_setup and swtpm

2019-07-12 Thread Stefan Berger
Allow vTPM state encryption when swtpm_setup and swtpm support passing a passphrase using a file descriptor. This patch enables the encryption of the vTPM state only. It does not encrypt the state during migration, so the destination secret does not need to have the same password at this point. S

[libvirt] [PATCH v5 06/20] tests: Add tests for QEMU command line generation with encrypted TPM

2019-07-12 Thread Stefan Berger
The QEMU command line does not change when TPM state is encrypted compared to when it is plain. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- .../tpm-emulator-tpm2-enc.x86_64-latest.args | 35 +++ tests/qemuxml2argvtest.c | 1 + 2 files c

[libvirt] [PATCH v5 00/20] Add support for vTPM state encryption

2019-07-12 Thread Stefan Berger
This series of patches addresses the RFE in BZ 172830: https://bugzilla.redhat.com/show_bug.cgi?id=1728030 This series of patches adds support for vTPM state encryption by passing the read-end of a pipe's file descriptor to 'swtpm_setup' and 'swtpm' where they can read a passphrase from and derive

[libvirt] [PATCH v5 08/20] tpm: Refactor virTPMEmulatorInit to use loop

2019-07-12 Thread Stefan Berger
Refactor virTPMEmulatorInit to use a loop with parameters. This allows for easier extension later on. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- src/util/virtpm.c | 80 ++- 1 file changed, 37 insertions(+), 43 deletions(-) diff -

[libvirt] [PATCH v5 04/20] schema: Extend the TPM XML schema with support for encryption

2019-07-12 Thread Stefan Berger
Extend the TPM XML schema with support for an encryption node. Signed-off-by: Stefan Berger --- docs/schemas/domaincommon.rng | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 31db599ab9..78d72c08bf 100644 --- a/d

[libvirt] [PATCH v5 18/20] tpm: Check TPM XML device configuration changes after edit

2019-07-12 Thread Stefan Berger
Since swtpm does not support getting started without password once it was created with encryption enabled, we don't allow encryption to be removed. Similarly, we do not allow encryption to be added once swtpm has run. We also prevent chaning the type of the TPM backend since the encrypted state is

[libvirt] [PATCH v5 10/20] tpm: Parse the capabilities supported by swtpm and swtpm_setup

2019-07-12 Thread Stefan Berger
Run 'swtpm socket --print-capabilities' and 'swtpm_setup --print-capabilities' to get the JSON object of the features the programs are supporting and parse them into a bitmap. Signed-off-by: Stefan Berger --- src/libvirt_private.syms | 2 + src/util/virtpm.c| 134 ++

[libvirt] [PATCH v5 11/20] utils: Implement function to pass a buffer to send via a fd to virCommand

2019-07-12 Thread Stefan Berger
Implement virCommandSetSendBuffer() that allows the caller to pass a file descriptor and buffer to virCommand. virCommand will write the buffer into the file descriptor. That file descriptor could be the write end of a pipe or one of the file descriptors of a socketpair. The other file descriptor s

[libvirt] [PATCH v5 03/20] conf: Extend TPM XML parser with encryption support

2019-07-12 Thread Stefan Berger
Extend the TPM device XML parser and XML generator with emulator state encryption support. Signed-off-by: Stefan Berger --- src/conf/domain_conf.c | 31 ++- src/conf/domain_conf.h | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_

[libvirt] [PATCH v5 01/20] secret: Add support for usage type vTPM, extend schema and test case

2019-07-12 Thread Stefan Berger
Add support for usage type vTPM to secret. Extend the schema for the Secret to support the vTPM usage type and add a test case for parsing the Secret with usage type vTPM. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- docs/schemas/secret.rng

[libvirt] [PATCH 21/25] conf: export virDomainDiskBackingStoreFormat

2019-07-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 6 ++ src/libvirt_private.syms | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 50a01d4e03..fc0b07cf5a 100644 --- a/src/conf/do

[libvirt] [PATCH 24/25] qemu: blockjob: Unplug inherited storage chains when concluding blockjob

2019-07-12 Thread Peter Krempa
In cases when the disk frontend was unplugged while a blockjob was running the blockjob inherits the backing chain. When the blockjob is then terminated we need to unplug the chain as it will not be used any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 32

[libvirt] [PATCH 22/25] qemu: blockjob: Track orphaned backing chains in blockjob status XML

2019-07-12 Thread Peter Krempa
When the guest unplugs the disk frontend libvirt is responsible for deleting the backend. Since a blockjob may still have a reference to the backing chain when it is running we'll have to store the metadata for the unplugged disk for future reference. This patch adds 'chain' and 'mirrorChain' fiel

[libvirt] [PATCH 18/25] qemu: blockjob: Add modern block job event handler

2019-07-12 Thread Peter Krempa
Add the infrastructure to handle block job events in the -blockdev era. Some complexity is required as qemu does not bother to notify whether the job was concluded successfully or failed. Thus it's necessary to re-query the monitor. To minimize the possibility of stuck jobs save the state into th

[libvirt] [PATCH 23/25] qemu: Detect managed persistent reservations in block job orphan chains

2019-07-12 Thread Peter Krempa
The PR manager is a property of the format layer in qemu so we need to be able to track it also in the chains of orphaned block jobs. Add a helper for qemu to look also into the blockjob state. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 41

[libvirt] [PATCH 25/25] qemu: hotplug: Transfer ownership of backing chain to block job on disk unplug

2019-07-12 Thread Peter Krempa
When removing the disk fronted while any block job is still active we need to transfer the ownership of the backing chain to the job itself as the job still holds the reference to the chain members and thus attempts to remove them would fail. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug

[libvirt] [PATCH 20/25] conf: export virDomainDiskBackingStoreParse

2019-07-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 7 +++ src/libvirt_private.syms | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3323c9a5b1..50a01d4e03 100644 --- a/src/conf/d

[libvirt] [PATCH 19/25] qemu: process: Refresh -blockdev based blockjobs on reconnect to qemu

2019-07-12 Thread Peter Krempa
Refresh the state of the jobs and process any events that might have happened while libvirt was not running. The job state processing requires some care to figure out if a job needs to be bumped. For any invalid job try doing our best to cancel it. Signed-off-by: Peter Krempa --- src/qemu/qemu

[libvirt] [PATCH 17/25] qemu: Add handler for job state change event

2019-07-12 Thread Peter Krempa
Add support for handling the event either synchronously or asynchronously using the event thread. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 3 ++ src/qemu/qemu_domain.h | 1 + src/qemu/qemu_driver.c | 23 +++ src/qemu/qemu_process.c | 63 ++

[libvirt] [PATCH 16/25] qemu: blockjob: Add helper to convert monitor job status to internal state

2019-07-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 41 src/qemu/qemu_blockjob.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 5177a361ec..dd6071dae1 100644 --- a/src/qemu/qemu_bl

[libvirt] [PATCH 12/25] qemu: driver: Remove unnecessary saving of status XML

2019-07-12 Thread Peter Krempa
Now that the blockjob handling code deals with the status XML we don't need to save it explicitly when starting blockjobs. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c in

[libvirt] [PATCH 11/25] qemu: blockjob: Save status XML when modifying job state

2019-07-12 Thread Peter Krempa
Now that block job data is stored in the status XML portion we need to make sure that everything which changes the state also saves the status XML. The job registering function is used while parsing the status XML so in that case we need to skip the XML saving. Signed-off-by: Peter Krempa --- sr

[libvirt] [PATCH 09/25] qemu: blockjob: Add flag for invalid block job data

2019-07-12 Thread Peter Krempa
The job data saved in the XML may be partially invalid e.g. if something is missing. To prevent losing a domain with such a job add a flag to the job data so that job APIs can ignore such a job and we can just cancel it. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.h | 2 ++ 1 file cha

[libvirt] [PATCH 13/25] tests: qemustatusxml2xml: Add test case for block job tracking

2019-07-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- .../blockjob-blockdev-in.xml | 366 ++ .../blockjob-blockdev-out.xml | 1 + tests/qemuxml2xmltest.c | 2 + 3 files changed, 369 insertions(+) create mode 100644 tests/qemustatusxml2xmldata/

[libvirt] [PATCH 15/25] qemu: process: Don't trigger BLOCK_JOB* events with -blockdev

2019-07-12 Thread Peter Krempa
With blockdev we'll need to use the JOB_STATUS_CHANGE so gate the old events by the blockdev capability. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f39143d499..4e242016

[libvirt] [PATCH 14/25] qemu: blockjob: Add 'concluded' state for a block job

2019-07-12 Thread Peter Krempa
This new state is entered when qemu finished the job but libvirt does not know whether it was successful or not. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 2 +- src/qemu/qemu_blockjob.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.

[libvirt] [PATCH 08/25] qemu: blockjob: Export functions for allocating and registering job data

2019-07-12 Thread Peter Krempa
When parsing the status XML we need to register all existing jobs. Export the functions so that they are usable in other modules. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 4 ++-- src/qemu/qemu_blockjob.h | 10 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff

[libvirt] [PATCH 10/25] qemu: domain: Store blockjob data in the status XML

2019-07-12 Thread Peter Krempa
We need to store the block job state in the status XML so that we can properly recover any data when reconnecting after startup and also in the end to be able to do any transition of the backing chain that happened while libvirt was not connected to the monitor. First step is to note the name, typ

[libvirt] [PATCH 07/25] qemu: blockjob: Add string convertors for blockjob type and state enums

2019-07-12 Thread Peter Krempa
Later on we'll format these values into the status XML so the from/to string functions will come handy. The implementation also notes that these will be used in the status XML to avoid somebody changing the values. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 9 + src/qemu/

[libvirt] [PATCH 06/25] qemu: blockjob: Register new and running blockjobs in the global table

2019-07-12 Thread Peter Krempa
Add the job structure to the table when instantiating a new job and remove it when it terminates/fails. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 29 ++--- src/qemu/qemu_blockjob.h | 6 -- src/qemu/qemu_driver.c| 16 src/qemu/q

[libvirt] [PATCH 00/25] qemu: Properly track blockjobs (blockdev-add saga)

2019-07-12 Thread Peter Krempa
This series requires few patches I've posted, namely: https://www.redhat.com/archives/libvir-list/2019-July/msg00669.html https://www.redhat.com/archives/libvir-list/2019-June/msg01133.html which were not yet pushed upstream. For convenience you can fetch the patches including deps by: git fetch

[libvirt] [PATCH 02/25] qemu: domain: Add helper for saving config XML

2019-07-12 Thread Peter Krempa
Similarly to qemuDomainSaveStatus add a helper to save the config XML named qemuDomainSaveConfig. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 22 ++ src/qemu/qemu_domain.h | 1 + 2 files changed, 23 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/q

[libvirt] [PATCH 03/25] qemu: blockjob: Use VIR_AUTOUNREF in qemuBlockJobDataNew

2019-07-12 Thread Peter Krempa
Simplify error paths. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index b3bdbeb990..b45103f2f3 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qem

[libvirt] [PATCH 04/25] qemu: blockjob: Separate and unify block job (un)registration

2019-07-12 Thread Peter Krempa
Rename and move qemuBlockJobTerminate to qemuBlockJobUnregister and separate bits from qemuBlockJobDiskNew which register the job with the disk. This creates an unified interface for other APIs to use. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 62

[libvirt] [PATCH 05/25] qemu: domain: Add global table of blockjobs

2019-07-12 Thread Peter Krempa
Block jobs currently belong to disks only so we can look up the block job data for them in the corresponding disks. This won't be the case when using blockdev as certain jobs don't even correspond to a disk and most of them can run on a part of the backing chain. Add a global table of blockjobs wh

[libvirt] [PATCH 01/25] qemu: domain: Repurpose and export helper for saving domain status XML

2019-07-12 Thread Peter Krempa
Rename qemuDomainObjSaveJob and create a wrapper for it which does not require 'driver' to be passed and export it so that other palces can easily save the status XML without having to invoke virDomainSaveStatus which has unpleasing parameters. Signed-off-by: Peter Krempa --- src/qemu/qemu_domai

[libvirt] [PATCH] storage: rbd: do not attempt to dereference a non-pointer

2019-07-12 Thread Ján Tomko
My commit 9b7c4048fa0559fd81d57b7f7d13b1dccd6a99b2 was too blind and my librbd was not new enough to actually compile this part. Signed-off-by: Ján Tomko --- Pushed under the 'build breaker fix' rule whilst violating the 'do not push patches on a Friday afternoon' rule. src/storage/storage_back

Re: [libvirt] [libvirt-php PATCH 0/2] Add binding for virDomainInterfaceAddresses

2019-07-12 Thread Michal Privoznik
On 7/8/19 11:32 PM, Dawid Zamirski wrote: Hello, The following two patches add a new bingding for virDomainInterfaceAddresses. While working on it I have found that the PHP7 version of the VIRT_ARRAY_INIT macro was causing segfaults which I have fixed in the first patch wheread the actual implem

Re: [libvirt] [PATCHv2 5/9] qemu: monitor: Add support for 'job-cancel' command

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 06:26:16PM +0200, Peter Krempa wrote: This belongs to the new job management API which can manage also non-block based jobs. Since we'll need to be able to attempt to cancel jobs which potentially were not started (during reconnect) the 'quiet' flag allows to suppress erro

Re: [libvirt] [PATCH v2 3/3] conf: add 'bochs' video display type

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 04:05:33PM -0500, Jonathon Jongsma wrote: Update schema and configuration to allow specifying new video type of 'bochs'. Add implementation and tests for qemu. Usually we split the XML addition from the driver impl, that is: * conf: schema, documentation, XML parsing an

Re: [libvirt] [PATCH v2 2/3] qemu: minor refactor of video device string handling

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 04:05:32PM -0500, Jonathon Jongsma wrote: In preparation for adding the bochs display device, refactor the logic so that each branch handles a single device type and checks its parameters within that branch. In this case VGA and VMVGA are still grouped into the same branch

Re: [libvirt] [PATCH v2 1/3] qemu: Add bochs-display capability

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 04:05:31PM -0500, Jonathon Jongsma wrote: Check whether qemu supports the bochs-display device and set a capability. Update tests. Signed-off-by: Jonathon Jongsma --- src/qemu/qemu_capabilities.c | 4 src/qemu/qemu_capabilities.h

Re: [libvirt] [PATCH 4/4] docs: RBD pool only supports raw volumes

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 04:26:08PM +0200, Ján Tomko wrote: > Signed-off-by: Ján Tomko > --- > docs/storage.html.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |: https://berrange.com -o-https://www.flickr.com/photos/dber

Re: [libvirt] [PATCH 3/4] Revert "conf: Remove volOptions for VIR_STORAGE_POOL_RBD"

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 04:26:07PM +0200, Ján Tomko wrote: > This reverts commit 035db37394ad11a39d47f8bd2b6a8a2734283cbf > > Even though we only allow using RBD with raw volumes, > removing the options and the default format causes our > parser not to fill out the volume format and the backend co

Re: [libvirt] [PATCH 2/4] storage: rbd: actually index the array when iterating over it

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 04:26:06PM +0200, Ján Tomko wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1729292 > > Fixes: 3aa190f2a43a632b542a6ba751a6c3ab4d51f1dd > Signed-off-by: Ján Tomko > --- > src/storage/storage_backend_rbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Revie

Re: [libvirt] [PATCH 1/4] storage: rbd: use VIR_REALLOC in the loop

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 04:26:05PM +0200, Ján Tomko wrote: > If there are more than 16 images, the memory allocated in images > might be leaked on subsequent execution(s). > > Signed-off-by: Ján Tomko > --- > src/storage/storage_backend_rbd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(

[libvirt] [PATCH 2/4] storage: rbd: actually index the array when iterating over it

2019-07-12 Thread Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1729292 Fixes: 3aa190f2a43a632b542a6ba751a6c3ab4d51f1dd Signed-off-by: Ján Tomko --- src/storage/storage_backend_rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_

[libvirt] [PATCH 3/4] Revert "conf: Remove volOptions for VIR_STORAGE_POOL_RBD"

2019-07-12 Thread Ján Tomko
This reverts commit 035db37394ad11a39d47f8bd2b6a8a2734283cbf Even though we only allow using RBD with raw volumes, removing the options and the default format causes our parser not to fill out the volume format and the backend code rejects creating a non-raw volume. Re-introduce the volume option

[libvirt] [PATCH 0/4] Blind rbd driver fixes

2019-07-12 Thread Ján Tomko
Sadly I haven't had the time to get a working RBD setup but I believe these patches should fix some recently introduced bugs https://bugzilla.redhat.com/show_bug.cgi?id=1724065 https://bugzilla.redhat.com/show_bug.cgi?id=1729292 If you can test them, please do. Ján Tomko (4): storage: rbd: use

[libvirt] [PATCH 4/4] docs: RBD pool only supports raw volumes

2019-07-12 Thread Ján Tomko
Signed-off-by: Ján Tomko --- docs/storage.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/storage.html.in b/docs/storage.html.in index d242de7b93..e0e4edec1e 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in @@ -608,7 +608,7 @@ Valid volume forma

[libvirt] [PATCH 1/4] storage: rbd: use VIR_REALLOC in the loop

2019-07-12 Thread Ján Tomko
If there are more than 16 images, the memory allocated in images might be leaked on subsequent execution(s). Signed-off-by: Ján Tomko --- src/storage/storage_backend_rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage

Re: [libvirt] [PATCH 26/29] remote: refactor the code for choosing the UNIX socket path

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 03:36:56PM +0200, Michal Privoznik wrote: > On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: > > The ssh, libssh, libssh2 & unix transports all need to use a UNIX socket > > path, and duplicate some of the same logic for error checking. Pull this > > out into a separate method

Re: [libvirt] [PATCH 0/3] virnetworkobj: Couple of small fixes and improvements

2019-07-12 Thread Erik Skultety
On Tue, Jul 09, 2019 at 05:01:55PM +0200, Michal Privoznik wrote: > Almost trivial, not pushed though. > > Michal Prívozník (3): > virnetworkobj: Free retval of virNetworkObjGetPortStatusDir() > virnetworkobj: Drop needless cleanup label in virNetworkObjAddPort > virnetworkobj: Drop needless

Re: [libvirt] [PATCH 26/29] remote: refactor the code for choosing the UNIX socket path

2019-07-12 Thread Erik Skultety
On Fri, Jul 12, 2019 at 03:36:56PM +0200, Michal Privoznik wrote: > On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: > > The ssh, libssh, libssh2 & unix transports all need to use a UNIX socket > > path, and duplicate some of the same logic for error checking. Pull this > > out into a separate method

Re: [libvirt] Problem configuring selective dropping of root

2019-07-12 Thread Martin Kletzander
On Thu, Jul 11, 2019 at 01:15:26PM +0200, Bjoern Walk wrote: Martin Kletzander [2019-07-10, 03:55PM +0200]: Our Makefile specifies what to do on installation: $(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" so I guess this is a packaging issue. No idea where/how the arch pa

Re: [libvirt] [PATCH 24/29] remote: open secondary drivers via remote driver if needed

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 03:58:12PM +0200, Ján Tomko wrote: > On Thu, Jul 11, 2019 at 05:05:11PM +0100, Daniel P. Berrangé wrote: > > When the client has a connection to one of the hypervisor specific > > daemons (eg virtqemud), the app may still expect to use the secondary > > driver APIs (storage,

Re: [libvirt] [PATCH 24/29] remote: open secondary drivers via remote driver if needed

2019-07-12 Thread Peter Krempa
On Fri, Jul 12, 2019 at 15:37:12 +0200, Michal Privoznik wrote: > On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: > > When the client has a connection to one of the hypervisor specific > > daemons (eg virtqemud), the app may still expect to use the secondary > > driver APIs (storage, network, etc). N

Re: [libvirt] [PATCH 24/29] remote: open secondary drivers via remote driver if needed

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 05:05:11PM +0100, Daniel P. Berrangé wrote: When the client has a connection to one of the hypervisor specific daemons (eg virtqemud), the app may still expect to use the secondary driver APIs (storage, network, etc). None of these will be registered in the hypervisor daem

Re: [libvirt] [PATCH 10/29] remote: refactor & rename variables for building libvirtd

2019-07-12 Thread Daniel P . Berrangé
On Fri, Jul 12, 2019 at 03:36:58PM +0200, Michal Privoznik wrote: > On 7/11/19 6:04 PM, Daniel P. Berrangé wrote: > > The same make variables will be useful for building both libvirtd and > > the split daemons, so refactor & rename variables to facilitate reuse. > > > > Signed-off-by: Daniel P. Be

Re: [libvirt] [PATCH 26/29] remote: refactor the code for choosing the UNIX socket path

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: The ssh, libssh, libssh2 & unix transports all need to use a UNIX socket path, and duplicate some of the same logic for error checking. Pull this out into a separate method to increase code sharing. Signed-off-by: Daniel P. Berrangé --- src/remote

Re: [libvirt] [PATCH 09/29] remote: conditionalize IP socket config in augeas definitions

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:04 PM, Daniel P. Berrangé wrote: > Prepare for reusing libvirtd augeas defintions with other daemons by > making the config parameters for IP sockets conditionally defined by > the make rules. > > Signed-off-by: Daniel P. Berrangé > --- > build-aux/augeas-gentest.pl

Re: [libvirt] [PATCH 24/29] remote: open secondary drivers via remote driver if needed

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: When the client has a connection to one of the hypervisor specific daemons (eg virtqemud), the app may still expect to use the secondary driver APIs (storage, network, etc). None of these will be registered in the hypervisor daemon, so we must explici

Re: [libvirt] [PATCH 00/29] Split the libvirtd daemon into per-driver daemons

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:04 PM, Daniel P. Berrangé wrote: This is what all the driver refactoring I've done has been about enabling. We gain new daemons for each driver, for the primary virt drivers: virtlibxld virtlxcd virtqemud virtvboxd virtvzd And again for the secondary drivers vir

Re: [libvirt] [PATCH 10/29] remote: refactor & rename variables for building libvirtd

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:04 PM, Daniel P. Berrangé wrote: The same make variables will be useful for building both libvirtd and the split daemons, so refactor & rename variables to facilitate reuse. Signed-off-by: Daniel P. Berrangé --- src/remote/Makefile.inc.am | 95

Re: [libvirt] [PATCH 27/29] remote: switch to connect to per-driver daemons by default

2019-07-12 Thread Michal Privoznik
On 7/11/19 6:05 PM, Daniel P. Berrangé wrote: Historically URIs handled by the remote driver will always connect to the libvirtd UNIX socket. There will now be one daemon per driver, and each of these has its own UNIX sockets to connect to. It will still be possible to run the traditional monoli

Re: [libvirt] [PATCH 4/4] qemu: block: Split up qemuBlockStorageSourceAttachApply

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 04:56:05PM +0200, Peter Krempa wrote: Split up the addition of a storage source into the following sub-steps: 1) storage access dependancies (TLS transport, persistent reservation) dependencies 2) storage acccess node (file/gluster/nbd...) 3) format driver dependancies

Re: [libvirt] [PATCH 0/4] qemu: blockdev-related cleanups and refactors (blockdev-add saga)

2019-07-12 Thread Ján Tomko
On Thu, Jul 11, 2019 at 04:56:01PM +0200, Peter Krempa wrote: Peter Krempa (4): qemu: blockjob: Don't reset state when entering sync blockjob qemu: blockjob: Don't emit traditional disk events for jobs without disk qemu: Refactor variables for extracting flags in qemuDomainBlockCopyCommo

Re: [libvirt] [jenkins-ci PATCH] guests: Always install the freshest point release

2019-07-12 Thread Erik Skultety
On Wed, Jul 10, 2019 at 01:53:02PM +0200, Andrea Bolognani wrote: > On Wed, 2019-07-10 at 09:42 +0200, Andrea Bolognani wrote: > > On Tue, 2019-07-09 at 18:48 +0200, Erik Skultety wrote: > > > On Tue, Jul 09, 2019 at 06:15:39PM +0200, Andrea Bolognani wrote: > > > > diff --git a/guests/host_vars/li

Re: [libvirt] [PATCH v4 16/23] utils: Mark inpipe as non-blocking

2019-07-12 Thread Stefan Berger
On 7/12/19 4:24 AM, Daniel P. Berrangé wrote: On Thu, Jul 11, 2019 at 03:41:44PM -0400, Stefan Berger wrote: Mark a virCommand's inpipe (write-end of pipe) as non-blocking so that it will never block when we were to try to write too many bytes to it while it doesn't have the capacity to hold the

Re: [libvirt] [PATCH v4 17/23] utils: Extend virCommandProcessIO to include the send buffers

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:45PM -0400, Stefan Berger wrote: > Extend virCommandProcessIO to include the send buffers in the poll > loop. > > Signed-off-by: Stefan Berger > --- > src/util/vircommand.c | 63 ++- > 1 file changed, 62 insertions(+), 1 delet

Re: [libvirt] [PATCH v4 14/23] utils: Convert pollfd array to be allocated

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:42PM -0400, Stefan Berger wrote: > Convert the struct pollfd *fds to be allocated rather than residing > on the stack. This prepares it for the next patch where the size of > the array of fds becomes dynamic. > > Signed-off-by: Stefan Berger > --- > src/util/vircomm

Re: [libvirt] [PATCH v2 00/19] Enable proper use of systemd socket activation with libvirtd

2019-07-12 Thread Michal Privoznik
On 7/11/19 4:07 PM, Daniel P. Berrangé wrote: The libvirtd daemon has some support for systemd socket activation from: commit 27a7081c2968ca0d7fbd590629b5a5303851f4a3 Author: Martin Kletzander Date: Tue Jul 15 15:28:53 2014 +0200 daemon: support passing FDs from the calling pro

Re: [libvirt] [PATCH v2 11/19] remote: add systemd socket units for UNIX/TCP sockets

2019-07-12 Thread Michal Privoznik
On 7/11/19 4:07 PM, Daniel P. Berrangé wrote: We don't do socket activation of libvirtd, since we need to unconditionally start libvirtd in order to perform autostart. This doesn't mean we can't have systemd socket units. Some use cases will not need libvirt's autostart & are thus free to use act

Re: [libvirt] [PATCH v4 08/23] tpm: Move virtpm.c from utils dir to own tpm dir

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:36PM -0400, Stefan Berger wrote: > Move virtpm.c from utils dir to its own tpm dir. This change > is mostly driven by the later introduction of virtpm_conf.c where > the define function like XYZTypeFromString() that we cannot > include from utils dir. Apart from the e

Re: [libvirt] [PATCH v4 04/23] conf: Extend TPM XML parser with encryption support

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:32PM -0400, Stefan Berger wrote: > Extend the TPM device XML parser and XML generator with emulator > state encryption support. > > Signed-off-by: Stefan Berger > Reviewed-by: Marc-André Lureau > --- > src/conf/domain_conf.c | 40 +++

Re: [libvirt] [PATCH v4 03/23] util: Add VIR_STORAGE_ENCRYPTION_FORMAT_VTPM

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:31PM -0400, Stefan Berger wrote: > Add VIR_STORAGE_ENCRYPTION_FORMAT_VTPM with string 'vtpm' for > support of encrypting vTPM storage. This is a little odd. The virStorageEncryption APIs are for use with virtual disk backing file encryption, so I wouldn't expect to se

Re: [libvirt] [PATCH v4 01/23] secret: Add support for usage type vTPM, extend schema and test case

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:29PM -0400, Stefan Berger wrote: > Add support for usage type vTPM to secret. > Extend the schema for the Secret to support the vTPM usage type > and add a test case for parsing the Secret with usage type vTPM. > > Signed-off-by: Stefan Berger > Reviewed-by: Marc-And

Re: [libvirt] [PATCH v4 02/23] tests: Add already existing test case tpm-emulator-tpm2

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:30PM -0400, Stefan Berger wrote: > Add an already existing test case tpm-emulator-tpm2 to qemuxml2xmltest.c > > Signed-off-by: Stefan Berger > Reviewed-by: Marc-André Lureau > --- > tests/qemuxml2xmltest.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Danie

Re: [libvirt] [PATCH v4 16/23] utils: Mark inpipe as non-blocking

2019-07-12 Thread Daniel P . Berrangé
On Thu, Jul 11, 2019 at 03:41:44PM -0400, Stefan Berger wrote: > Mark a virCommand's inpipe (write-end of pipe) as non-blocking so that it > will never block when we were to try to write too many bytes to it while > it doesn't have the capacity to hold them. So this is the right way todo it. Why

  1   2   >