[libvirt] [PATCH 5/6] libvirt: Ensure modern APIs are implemented

2019-07-08 Thread Eric Blake
As shown in recent patches, several drivers provided only an older counterpart of an API, making it harder to uniformly use the newer preferred API form. We can prevent future instances of this by failing the driver at initialization time if a modern API is forgotten when an older API is present.

[libvirt] [PATCH 4/6] test: Add various vir*Flags API

2019-07-08 Thread Eric Blake
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Note that virDomainBlockStats does not trivially forward to virDomainBlockStatsFlags, so that one is omitted. Signed-off-by: Eric Blake ---

[libvirt] [PATCH 3/6] phyp: Add various vir*Flags API

2019-07-08 Thread Eric Blake
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/phyp/phyp_driver.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH 0/6] virDomainFlagsUndefine cleanups

2019-07-08 Thread Eric Blake
Pointed out by Peter in response to: https://www.redhat.com/archives/libvir-list/2019-July/msg00277.html Patches 1-5 fix a pre-existing problem in several drivers, then provides a way to ensure we don't encounter it again. Patch 6 is an example of what I plan to do to all the drivers that have

[libvirt] [PATCH 6/6] bhyve: Ignore no-op flags during virDomainUndefine

2019-07-08 Thread Eric Blake
We can ignore flags rather than rejecting them as unknown since a correct implementation of those flags is a no-op given that bhyve lacks managed save or snapshots. Signed-off-by: Eric Blake --- src/bhyve/bhyve_driver.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 2/6] esx: Add various vir*Flags API

2019-07-08 Thread Eric Blake
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/esx/esx_driver.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/esx/esx_driver.c

[libvirt] [PATCH 1/6] bhyve: Add various vir*Flags API

2019-07-08 Thread Eric Blake
Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/bhyve/bhyve_driver.c | 38 -- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git

Re: [libvirt] [PATCH 4/8] snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE flag

2019-07-08 Thread Eric Blake
On 7/8/19 2:56 AM, Peter Krempa wrote: > On Fri, Jul 05, 2019 at 23:37:31 -0500, Eric Blake wrote: >> We've been doing a terrible job of performing XML validation in our >> various API that parse XML with a corresponding schema (we started >> with domains back in commit dd69a14f, v1.2.12, but

Re: [libvirt] [PATCHv2] Do not keep empty log files for deleted domains

2019-07-08 Thread Jim Fehlig
On 7/8/19 7:51 PM, Jan Zerebecki wrote: > > > On 08/07/2019 23.28, Jim Fehlig wrote: >> On 7/8/19 12:28 PM, Jan Zerebecki wrote: >>> With logrotates copytruncate when e.g. domain1 doesn't exist anymore >>> /var/log/libvirt/qemu/domain1.log will still exist after rotation even >>> though it will

Re: [libvirt] [PATCHv2] Do not keep empty log files for deleted domains

2019-07-08 Thread Jan Zerebecki
On 08/07/2019 23.28, Jim Fehlig wrote: > On 7/8/19 12:28 PM, Jan Zerebecki wrote: >> With logrotates copytruncate when e.g. domain1 doesn't exist anymore >> /var/log/libvirt/qemu/domain1.log will still exist after rotation even >> though it will never be written to. When new domain names keep

Re: [libvirt] [PATCH 00/14] xen: Remove sexpr parsing and formatting support

2019-07-08 Thread Jim Fehlig
On 7/3/19 6:37 AM, Peter Krempa wrote: > The formatter support was unused from the time we dropped xend support. > Let's drop the formatter too along with all the unused code. Nice! I see the series has already been reviewed and will only add that AFAICT the xen community has not supported the

Re: [libvirt] [PATCHv2] Do not keep empty log files for deleted domains

2019-07-08 Thread Jim Fehlig
On 7/8/19 12:28 PM, Jan Zerebecki wrote: > With logrotates copytruncate when e.g. domain1 doesn't exist anymore > /var/log/libvirt/qemu/domain1.log will still exist after rotation even > though it will never be written to. When new domain names keep getting > used this leads to a lot of empty

Re: [libvirt] [PATCH 2/8] snapshot: Fix virDomainUndefineFlags docs regarding snapshots

2019-07-08 Thread Eric Blake
On 7/8/19 2:40 AM, Peter Krempa wrote: > On Fri, Jul 05, 2019 at 23:37:29 -0500, Eric Blake wrote: >> The docs talked about an active snapshot when they meant an active >> domain; they also claimed the flag was a no-op for hypervisors with no >> snapshot metadata even though the flag is rejected

[libvirt] [libvirt-php PATCH 1/2] Fix PHP7 VIRT_ARRAY_INIT macro implementation.

2019-07-08 Thread Dawid Zamirski
This is a PHP 7 compatibilty macro which was segfaulting due to the temporary variable being defined in the do..while scoped block (to swallow semicolon for macros), e.g: zval *arr; VIRT_ARRAY_INIT(arr); VIRT_ADD_ASSOC_STRING(arr, "foo", "bar"); // <= segfault here The VIRT_ARRAY_INIT above was

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

2019-07-08 Thread Dawid Zamirski
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 implementation of the binding is in the second

[libvirt] [libvirt-php PATCH 2/2] Add binding for virDomainInterfaceAddresses.

2019-07-08 Thread Dawid Zamirski
A straight-forward 1:1 mapping to the C API. Returns array in the following format: array ( 0 => array ( 'name' => 'vnet0', 'hwaddr' => '52:54:00:3a:cd:94', 'naddrs' => 1, 'addrs' => array ( 'addr' => '192.168.254.224', 'prefix' => 24, 'type' => 0, ),

Re: [libvirt] [PATCH v9 13/13] backup: Add virDomainCheckpointIsCurrent API

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:13 -0500, Eric Blake wrote: > It is possible, but tedious, to tell if a checkpoint is current by > parsing XML. As this operation may be performed with some frequency, As I've pointed out that there may be multiple and only partially active checkpoints, generalizing

Re: [libvirt] [PATCH v9 12/13] backup: Wire up qemu checkpoint commands over QMP

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:12 -0500, Eric Blake wrote: > Time to actually issue the QMP transactions that create and > delete persistent checkpoints. For create, we only need one > transaction: inside, we visit all disks affected by the > checkpoint, and create a new enabled bitmap, as well as

[libvirt] Problem configuring selective dropping of root

2019-07-08 Thread Stephan von Krawczynski
Hello list, I came across a fundamental flaw in the libvirt user configuration lately and try to find a solution now. Here is the problem: I run several qemu instances on arch linux all configured via libvirt. The default config as user nobody:kvm was fine up to the day I tried to use a host

Re: [libvirt] [PATCH v9 01/13] backup: Document new XML for checkpoints

2019-07-08 Thread Eric Blake
On 7/8/19 6:23 AM, Peter Krempa wrote: > On Sat, Jul 06, 2019 at 22:56:01 -0500, Eric Blake wrote: >> Prepare for new checkpoint APIs by describing the XML that will >> represent a checkpoint. The checkpoint XML is modeled heavily after >> virDomainSnapshotPtr. See the docs for more details. >>

[libvirt] [PATCHv2] Do not keep empty log files for deleted domains

2019-07-08 Thread Jan Zerebecki
With logrotates copytruncate when e.g. domain1 doesn't exist anymore /var/log/libvirt/qemu/domain1.log will still exist after rotation even though it will never be written to. When new domain names keep getting used this leads to a lot of empty logfiles. This may lead to slowdown or lack of free

Re: [libvirt] [PATCH v2] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Eric Blake
On 7/8/19 9:14 AM, Daniel P. Berrangé wrote: > The previously added AMD SEV doc was not linked from anywhere on the > website. Address this by introducing a new "Knowledge base" section > that can hold task oriented guide to various features. Moving the SEV, > disk locking and secure usage guides

[libvirt] [PATCH v9 07/10] backup: qemu: Implement framework for backup job APIs

2019-07-08 Thread Eric Blake
Still needs to actually kick off the right QMP commands, but at least allows validation of backup XML, including the fact that a backup job can survive a libvirtd restart. Atomically creating a checkpoint alongside the backup still needs implementing. Signed-off-by: Eric Blake ---

[libvirt] [PATCH v9 10/10] backup: Implement qemu incremental pull backup

2019-07-08 Thread Eric Blake
Complete wiring up incremental backup, by adding in support for creating a checkpoint at the same time as a backup (make the transaction have a few more steps) as well as exposing the dirty bitmap for a prior backup over NBD (requires creating a temporary bitmap, merging all appropriate bitmaps

[libvirt] [PATCH v9 05/10] backup: Parse and output backup XML

2019-07-08 Thread Eric Blake
Accept XML describing a generic block job, and output it again as needed. This may still need a few tweaks to match the documented XML and RNG schema. Signed-off-by: Eric Blake --- src/conf/backup_conf.h | 94 +++ src/conf/virconftypes.h | 3 + src/conf/Makefile.inc.am | 2 +

[libvirt] [PATCH v9 03/10] backup: Introduce virDomainBackup APIs

2019-07-08 Thread Eric Blake
Introduce a few new public APIs related to incremental backups. This builds on the previous notion of a checkpoint (without an existing checkpoint, the new API is a full backup, differing from virDomainBlockCopy in the point of time chosen and in operation on multiple disks at once); and also

[libvirt] [PATCH v9 09/10] backup: qemu: Wire up qemu full push backup commands over QMP

2019-07-08 Thread Eric Blake
Update the code to support push backups; for now, the destination file still has to be local, although the XML could be extended into supporting remote destinations (where we will have to use the full power of blockdev-add). This also touches up the event handling to inform the user when the job

[libvirt] [PATCH v9 04/10] backup: Implement backup APIs for remote driver

2019-07-08 Thread Eric Blake
This one is fairly straightforward - the generator already does what we need. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrangé --- src/remote/remote_driver.c | 3 ++ src/remote/remote_protocol.x | 53 +++- src/remote_protocol-structs | 28

[libvirt] [PATCH v9 06/10] backup: Implement virsh support for backup

2019-07-08 Thread Eric Blake
Introduce a few more new virsh commands for performing backup jobs. At this time, I did not opt for a convenience command 'backup-begin-as' that cobbles together appropriate XML from the user's command line arguments, but that may be a viable future extension. Similarly, since backup is a

[libvirt] [PATCH v9 08/10] backup: Wire up qemu full pull backup commands over QMP

2019-07-08 Thread Eric Blake
Time to actually issue the QMP transactions that start and stop backup commands (for now, just pull mode, not push). Starting a job has to kick off several pre-req steps, then a transaction, and additionally spawn an NBD server for pull mode; ending a job as well as failing partway through

[libvirt] [PATCH v9 01/10] backup: qemu: Implement VIR_DOMAIN_CHECKPOINT_XML_SIZE flag

2019-07-08 Thread Eric Blake
Once a checkpoint has been created, it is desirable to estimate the size of the disk delta that is represented between the checkpoint and the current operation. To do this, we have to scrape information out of QMP query-block on a request from the user. Signed-off-by: Eric Blake ---

[libvirt] [PATCH v9 00/10] work-in-progress: incremental backup

2019-07-08 Thread Eric Blake
This is the current state of my incremental backup work on top of the v9 checkpoint patches [1]. While everything compiles and my local tests are able to perform an incremental backup, I already know that the code needs a lot of cleanups before it can be accepted upstream; this is more of a

[libvirt] [PATCH v9 02/10] backup: Document new XML for backups

2019-07-08 Thread Eric Blake
Prepare for new backup APIs by describing the XML that will represent a backup. The XML resembles snapshots and checkpoints in being able to select actions for a set of disks, but has other differences. It can support both push model (the hypervisor does the backup directly into the destination

Re: [libvirt] [PATCH v2] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Eric Blake
On 7/8/19 9:14 AM, Daniel P. Berrangé wrote: > The previously added AMD SEV doc was not linked from anywhere on the > website. Address this by introducing a new "Knowledge base" section > that can hold task oriented guide to various features. Moving the SEV, > disk locking and secure usage guides

Re: [libvirt] [PATCH v9 11/13] backup: qemu: Implement metadata tracking for checkpoint APIs

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:11 -0500, Eric Blake wrote: > A lot of this work heavily copies from the existing snapshot > APIs. The interaction with qemu during create/delete still > needs to be implemented, but this takes care of all the libvirt > metadata (saving and restoring XML, and

Re: [libvirt] [jenkins-ci PATCH 2/5] guests: Update mappings for sheepdog

2019-07-08 Thread Daniel P . Berrangé
On Mon, Jul 08, 2019 at 06:05:36PM +0200, Andrea Bolognani wrote: > Debian has removed sheepdog from the distribution, and at this > point Debian 9 is now the only supported release that still > includes it. s/only supported release/only supported Debian release/ because Fedora still ships it

[libvirt] [jenkins-ci PATCH 4/5] guests: Build on Debian 10

2019-07-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- guests/playbooks/build/jobs/defaults.yml| 1 + guests/playbooks/build/projects/libvirt-dbus.yml| 3 +++ guests/playbooks/build/projects/libvirt-go-xml.yml | 1 + guests/playbooks/build/projects/libvirt-go.yml | 1 +

[libvirt] [jenkins-ci PATCH 0/5] guests: Add Debian 10

2019-07-08 Thread Andrea Bolognani
It was released, like, two full days ago! Let's get with the times already! :P Note that the libvirt-check job currently fails on Debian 10, but I have already posted a libvirt patch[1] addressing that issue. [1] https://www.redhat.com/archives/libvir-list/2019-July/msg00318.html Andrea

[libvirt] [jenkins-ci PATCH 5/5] jenkins: Build on Debian 10

2019-07-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- jenkins/jobs/defaults.yaml| 1 + jenkins/projects/libvirt-dbus.yaml| 3 +++ jenkins/projects/libvirt-go-xml.yaml | 1 + jenkins/projects/libvirt-go.yaml | 1 + jenkins/projects/libvirt-ocaml.yaml | 1 +

[libvirt] [jenkins-ci PATCH 2/5] guests: Update mappings for sheepdog

2019-07-08 Thread Andrea Bolognani
Debian has removed sheepdog from the distribution, and at this point Debian 9 is now the only supported release that still includes it. Signed-off-by: Andrea Bolognani --- guests/vars/mappings.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guests/vars/mappings.yml

[libvirt] [jenkins-ci PATCH 3/5] guests: Add Debian 10

2019-07-08 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- guests/host_vars/libvirt-debian-10/docker.yml | 2 + .../host_vars/libvirt-debian-10/install.yml | 2 + guests/host_vars/libvirt-debian-10/main.yml | 24 ++ guests/inventory | 1 + guests/vars/vault.yml

[libvirt] [jenkins-ci PATCH 1/5] guests: Update mappings for perl-Digest

2019-07-08 Thread Andrea Bolognani
Pretty much all current versions of Debian and Ubuntu ship the Digest module as part of the perl package, with Debian 9 being the only exception and having a separate package for it. Signed-off-by: Andrea Bolognani --- guests/vars/mappings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2

[libvirt] [PATCH] tests: Add getuid() to virnetdevbandwidthmock

2019-07-08 Thread Andrea Bolognani
When only geteuid() is mocked, the test crashes on Debian 10. Fatal: failed to reset uid: No such file or directory Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or

Re: [libvirt] New Feature: Identify Intel SGX support

2019-07-08 Thread Carvalho, Larkins L
Hello Eric, This was the initial announcement introducing new feature development. There are no questions from our end at this point. We will send more details regarding the feature in upcoming days. Thanks, Larkins -Original Message- From: Erik Skultety [mailto:eskul...@redhat.com]

Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Sahid Orentino Ferdjaoui
On Mon, Jul 08, 2019 at 01:04:59PM +0100, Daniel P. Berrangé wrote: > On Mon, Jul 08, 2019 at 01:12:06PM +0200, Michal Privoznik wrote: > > On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: > > > Neither the sasl_client_init or sasl_server_init methods are even > > > remotely threadsafe. They do a

[libvirt] [PATCH v2] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Daniel P . Berrangé
The previously added AMD SEV doc was not linked from anywhere on the website. Address this by introducing a new "Knowledge base" section that can hold task oriented guide to various features. Moving the SEV, disk locking and secure usage guides under this section. Signed-off-by: Daniel P.

[libvirt] [PATCH] logging: pass binary name not logfile name when enabling logging

2019-07-08 Thread Daniel P . Berrangé
Instead of having each caller pass in the desired logfile name, pass in the binary name instead. The logging code can then just derive a logfile name by appending ".log". Signed-off-by: Daniel P. Berrangé --- src/locking/lock_daemon.c | 2 +- src/logging/log_daemon.c | 2 +-

[libvirt] [PATCH] logging: ensure virtlogd rollover takes priority over logrotate

2019-07-08 Thread Daniel P . Berrangé
The virtlogd config is set to rollover logs every 2 MB. Normally a logrotate config file is also installed to handle cases where virtlogd is disabled. This is set to rollover weekly with no size constraint. As a result logrotate can interfere with virtlogd's, rolling over files that virtlogd has

Re: [libvirt] [PATCH v9 10/13] backup: Add virsh-checkpoints test

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:10 -0500, Eric Blake wrote: > Similar to virsh-snapshots (which also gets a minor tweak, to prove we > properly lock out one API from the other until later integration > efforts figure out the best way to proceed). Provides decent coverage > of the checkpoint API, the

Re: [libvirt] [PATCH] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Daniel P . Berrangé
On Mon, Jul 08, 2019 at 03:30:16PM +0200, Ján Tomko wrote: > On Mon, Jul 08, 2019 at 02:00:29PM +0100, Daniel P. Berrangé wrote: > > The previously added AMD SEV doc was not linked from anywhere on the > > website. Address this by introducing a new "Knowledge base" section > > that can hold task

Re: [libvirt] [PATCH v9 09/13] backup: test: Implement metadata tracking for checkpoint APIs

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:09 -0500, Eric Blake wrote: > A lot of this work heavily copies from the existing snapshot APIs. > The test driver doesn't really have to do anything more than just > expose an interface into libvirt metadata, making it possible to test > saving and restoring XML, and

Re: [libvirt] [PATCH] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Ján Tomko
On Mon, Jul 08, 2019 at 02:00:29PM +0100, Daniel P. Berrangé wrote: The previously added AMD SEV doc was not linked from anywhere on the website. Address this by introducing a new "Knowledge base" section that can hold task oriented guide to various features. Moving the SEV, disk locking and

Re: [libvirt] [PATCH v9 09/13] backup: test: Implement metadata tracking for checkpoint APIs

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:09 -0500, Eric Blake wrote: > A lot of this work heavily copies from the existing snapshot APIs. > The test driver doesn't really have to do anything more than just > expose an interface into libvirt metadata, making it possible to test > saving and restoring XML, and

Re: [libvirt] [PATCH v9 08/13] backup: Implement virsh support for checkpoints

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:08 -0500, Eric Blake wrote: > Introduce a bunch of new virsh commands for managing checkpoints in > isolation. More commands are needed for performing incremental > backups, but these commands were easy to implement by modeling heavily > after virsh-snapshot.c. There

Re: [libvirt] [PATCH 11/11] tests: qemublock: Add testing of 'blockdev-create' generators

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:35PM +0200, Peter Krempa wrote: Test the output against the schema and also against what we expect. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 170 ++ .../imagecreate/luks-encopts.json | 19 ++

Re: [libvirt] [PATCH 10/11] conf: snapshot: Provide a function to free virDomainSnapshotDiskDefPtr

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:34PM +0200, Peter Krempa wrote: Tests will need to parse such a definition so it also needs to be freed. Provide a function for it. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 11 +++ src/conf/snapshot_conf.h | 1 + 2 files changed, 12

Re: [libvirt] [PATCH 09/11] conf: snapshot: Export virDomainSnapshotDiskDefParseXML

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:33PM +0200, Peter Krempa wrote: Allow using it from the tests. Signed-off-by: Peter Krempa --- src/conf/snapshot_conf.c | 2 +- src/conf/snapshot_conf.h | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) Consider creating a new include file

Re: [libvirt] [PATCH 08/11] qemu: domain: Export qemuDomainPrepareStorageSourceBlockdev

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:32PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 9 + src/qemu/qemu_domain.h | 5 + 2 files changed, 6 insertions(+), 8 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature --

Re: [libvirt] [PATCH 07/11] qemu: block: Add generator for creating storage with blockdev-create

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:31PM +0200, Peter Krempa wrote: QEMU allows us to create storage on certain network protocols which allow image creation through their API. Wire up the generator for using it with libvirt as well as for local files. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 06/11] qemu: block: Add generator for image format creation properties

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:30PM +0200, Peter Krempa wrote: 'blockdev-add' allows us to use qemu to format images to our desired format. This patch implements helpers which convert a virStorageSourcePtr into JSON objects describing the required configuration. Signed-off-by: Peter Krempa ---

Re: [libvirt] [PATCH 05/11] qemu: block: Use 'auto-read-only' instead of 'read-only' for backing chain

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:29PM +0200, Peter Krempa wrote: To allow using -blockdev with blockjobs need to reopen files in read-write mode when modifying the backing chain. -EPARSE s/blockjobs need/blockjobs QEMU needs/ To achieve this we need to use 'auto-read-only' for the backing

[libvirt] [PATCH] docs: introduce a "knowledge base" for task oriented guides

2019-07-08 Thread Daniel P . Berrangé
The previously added AMD SEV doc was not linked from anywhere on the website. Address this by introducing a new "Knowledge base" section that can hold task oriented guide to various features. Moving the SEV, disk locking and secure usage guides under this section. Signed-off-by: Daniel P.

Re: [libvirt] [PATCH v9 05/13] backup: Allow for lists of checkpoint objects

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:05 -0500, Eric Blake wrote: > Create a new file for managing a list of checkpoint objects, borrowing > heavily from existing virDomainSnapshotObjList paradigms. > > Note that while checkpoints definitely have a use case for multiple snapshots? > children to a

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

2019-07-08 Thread Andrea Bolognani
On Wed, 2019-07-03 at 12:46 +0200, 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 > --- >

Re: [libvirt] [PATCH v9 04/13] backup: Parse and output checkpoint XML

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:04 -0500, Eric Blake wrote: > Add a new file checkpoint_conf.c that performs the translation to and > from new XML describing a checkpoint. The code shares a common base > class with snapshots, since a checkpoint similarly represents the > domain state at a moment in

Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Daniel P . Berrangé
On Mon, Jul 08, 2019 at 01:12:06PM +0200, Michal Privoznik wrote: > On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: > > Neither the sasl_client_init or sasl_server_init methods are even > > remotely threadsafe. They do a bunch of one-time initialization and > > merely use a simple integer counter to

Re: [libvirt] [PATCH 04/11] qemu: block: Extract formating of 'driver' attribute from child formatters

2019-07-08 Thread Ján Tomko
s/formating/fomatting/ On Thu, Jul 04, 2019 at 04:26:28PM +0200, Peter Krempa wrote: To allow reusing the formatters in the code for creating JSON properties for 'blockdev-create' we need to create everyhing except the 'driver' everything attribute. Use the new helper

Re: [libvirt] [PATCH 03/11] util: json: Introduce helper to prepend string into a virJSONValueObject

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:27PM +0200, Peter Krempa wrote: Libvirt treats the JSON objects as lists thus the values appear in the order they were added. To avoid too much changes introduce a helper which allows to prepend a string which will allow to keep certain outputs in order.

Re: [libvirt] [PATCH 02/11] tests: qemublock: Add testing of pure disk source specification JSON generator

2019-07-08 Thread Ján Tomko
On Thu, Jul 04, 2019 at 04:26:26PM +0200, Peter Krempa wrote: Add testing of the host specification part so that we can be sure that no image/host specific data will be present. Signed-off-by: Peter Krempa --- @@ -313,6 +341,40 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque) }

Re: [libvirt] [PATCH v9 01/13] backup: Document new XML for checkpoints

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:01 -0500, Eric Blake wrote: > Prepare for new checkpoint APIs by describing the XML that will > represent a checkpoint. The checkpoint XML is modeled heavily after > virDomainSnapshotPtr. See the docs for more details. > > Add testsuite coverage for some minimal

Re: [libvirt] [PATCH v9 02/13] backup: Introduce virDomainCheckpoint APIs

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:02 -0500, Eric Blake wrote: > Introduce a bunch of new public APIs related to backup checkpoints. > Checkpoints are modeled heavily after virDomainSnapshotPtr (both > represent a point in time of the guest), although a snapshot exists > with the intent of rolling back

Re: [libvirt] [PATCH v9 03/13] backup: Document nuances between different state capture APIs

2019-07-08 Thread Peter Krempa
On Sat, Jul 06, 2019 at 22:56:03 -0500, Eric Blake wrote: > Now that various new API have been added or are coming soon, it is > worth a landing page that gives an overview of capturing various > pieces of guest state, and which APIs are best suited to which tasks. > > Signed-off-by: Eric Blake

Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Michal Privoznik
On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: Neither the sasl_client_init or sasl_server_init methods are even remotely threadsafe. They do a bunch of one-time initialization and merely use a simple integer counter to avoid repeated work, not even using atomic increment/reads on the counter.

[libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Daniel P . Berrangé
Neither the sasl_client_init or sasl_server_init methods are even remotely threadsafe. They do a bunch of one-time initialization and merely use a simple integer counter to avoid repeated work, not even using atomic increment/reads on the counter. This can easily race in a threaded program.

[libvirt] [PATCH v2] libvirt: support block device storage type in virshParseSnapshotDiskspec

2019-07-08 Thread Liu Dayu
virsh snapshot-create-as supports 'file' storage type in --diskspec by default. But it doesn't support 'block' storage type in the virshParseSnapshotDiskspec(). So if a snapshot on a block device (e.g. LV) was created, the type of current running storage source in dumpxml is inconsistent with the

Re: [libvirt] [PATCH] m4: Fix check for yajl.pc

2019-07-08 Thread Daniel P . Berrangé
On Mon, Jul 08, 2019 at 09:59:42AM +0200, Andrea Bolognani wrote: > Commit 44b8df4cb4b3 introduced a check for yajl.pc that is > extremely similar to the one we already had in place for > readline.pc - so similar, in fact, that it's still looking > for readline.pc instead of yajl.pc :) > >

Re: [libvirt] [PATCH 7/8] snapshot: Add ListAll filters for current snapshot

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:34 -0500, Eric Blake wrote: > Add a new filter group VIR_DOMAIN_SNAPSHOT_LIST_CURRENT/NO_CURRENT, > which restricts the output based on whether a snapshot is the domain's > current snapshot. This is redundant with existing API (both > virDomainHasCurrentSnapshot and

Re: [libvirt] [PATCH 6/8] backup: Add support for filtering based on current moment

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:33 -0500, Eric Blake wrote: > Right now, the snapshot API permits at most one current snapshot, and > includes specific API for getting at that snapshot > (virDomainHasCurrentSnapshot, virDomainSnapshotCurrent, > virDomainSnapshotIsCurrent). However, with upcoming

Re: [libvirt] [PATCH 5/8] snapshot: Factor out redefine cycle validation

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:32 -0500, Eric Blake wrote: > The code to check whether a redefined snapshot/checkpoint XML is > attempting to create a cycle in the list of moments is lengthy, and > common between the two types of list. Therefore, it belongs in the > shared base file. > >

Re: [libvirt] [PATCH v4 00/25] Fix and enable owner remembering

2019-07-08 Thread Andrea Bolognani
On Fri, 2019-07-05 at 18:25 +0100, Daniel P. Berrangé wrote: > On Thu, Jul 04, 2019 at 08:22:04AM +0200, Michal Prívozník wrote: > > Interestingly, I'm unable to reproduce on my virtual FreeBSD. From the > > CI logs it looks like the test did not pick up XATTR functions from > > qemusecuritymock

[libvirt] [PATCH] m4: Fix check for yajl.pc

2019-07-08 Thread Andrea Bolognani
Commit 44b8df4cb4b3 introduced a check for yajl.pc that is extremely similar to the one we already had in place for readline.pc - so similar, in fact, that it's still looking for readline.pc instead of yajl.pc :) Signed-off-by: Andrea Bolognani --- m4/virt-yajl.m4 | 2 +- 1 file changed, 1

Re: [libvirt] [PATCH 4/8] snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE flag

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:31 -0500, Eric Blake wrote: > We've been doing a terrible job of performing XML validation in our > various API that parse XML with a corresponding schema (we started > with domains back in commit dd69a14f, v1.2.12, but didn't catch all > domain-related APIs, and

Re: [libvirt] [PATCH 3/8] snapshot: Add internal option to validate XML against schema

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:30 -0500, Eric Blake wrote: > Similar to VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA; for now used only by > the testsuite, but will be exposed in the public API in the next > patch. > > Signed-off-by: Eric Blake > --- > src/conf/snapshot_conf.h | 1 + >

Re: [libvirt] [PATCH 2/8] snapshot: Fix virDomainUndefineFlags docs regarding snapshots

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:29 -0500, Eric Blake wrote: > The docs talked about an active snapshot when they meant an active > domain; they also claimed the flag was a no-op for hypervisors with no > snapshot metadata even though the flag is rejected as unrecognized for > hypervisors with no

Re: [libvirt] [PATCH 1/8] snapshot: Rename qemu domain snapshot test files

2019-07-08 Thread Peter Krempa
On Fri, Jul 05, 2019 at 23:37:28 -0500, Eric Blake wrote: > Make it obvious that the domainsnapshotxml2xml test is only run when > compiling in support for qemu. > > Suggested-by: Peter Krempa > Signed-off-by: Eric Blake > --- ACK signature.asc Description: PGP signature -- libvir-list

[libvirt] [PATCH 23/23] tests: add slirp-helper qemuxml2argv test

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- .../net-user.x86_64-4.0.0.args| 34 +++ tests/qemuxml2argvtest.c | 16 + tests/testutilsqemu.h | 1 + 3 files changed, 51 insertions(+) create

[libvirt] [PATCH 20/23] qemu-command: use -net socket, fd= with slirp-helper

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau If a slirp-helper is associated with a network interface (after probing & preparing succesfully), pass the socket fd to QEMU and use "-net socket,fd=". Signed-off-by: Marc-André Lureau --- src/qemu/qemu_command.c | 35 +--

[libvirt] [PATCH 22/23] qemu-hotplug: handle hotplugging of slirp-helper

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_hotplug.c | 32 +--- src/qemu/qemu_monitor.c | 13 ++--- src/qemu/qemu_monitor.h | 3 ++- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH 21/23] qemu-process: prepare slirp-helper

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau When the network interface is of "user" type, and QEMU has the "-net socket,fd=" datagram support, call qemuInterfacePrepareSlirp() to probe and associate a slirp-helper with the interface. The usage of automated slirp-helper can be prevented with

[libvirt] [PATCH 19/23] qemu-extdevice: prepare, start and stop slirp-helper

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau If a slirp-helper is associated with a network interface, prepare/start/stop the process via qemu-extdevice. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_extdevice.c | 46 ++- src/qemu/qemu_extdevice.h | 8 ---

[libvirt] [PATCH 17/23] qemu: add a flag to the cookie to prevent slirp-helper setup

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau For VM started and migrated/saved without slirp-helpers, let's prevent the automatic setup (as it would fail to migrate otherwise). Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 12 ++-- src/qemu/qemu_domain.h | 1 + src/qemu/qemu_driver.c |

[libvirt] [PATCH 18/23] qemu-migration: prevent migration if slirp cannot be migrated

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_migration.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a11c6f1a9f..35fadfec44 100644 --- a/src/qemu/qemu_migration.c +++

[libvirt] [PATCH 14/23] qemu-conf: add configurable slirp-helper location

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau A slirp helper is a process that provides user-mode networking through a unix domain socket. It is expected to follow the following specification: https://gitlab.freedesktop.org/slirp/libslirp-rs/blob/master/src/bin/README.rst Signed-off-by: Marc-André Lureau ---

[libvirt] [PATCH 16/23] qemu-domain: save and restore slirp state

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Save & restore the slirp helper PID associated with a network interface & the probed features. Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 137 + src/qemu/qemu_domain.h | 2 +- 2 files changed, 138

[libvirt] [PATCH 15/23] qemu: add slirp helper unit

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau The unit provides the functions associated with a slirp-helper: - probing / checking capabilities - opening the socketpair - starting / stoping the helper - registering for dbus-vmstate migration Signed-off-by: Marc-André Lureau --- src/qemu/Makefile.inc.am | 2 +

[libvirt] [PATCH 12/23] domain-conf: add network def private data

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/conf/domain_conf.c | 21 - src/conf/domain_conf.h | 6 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3323c9a5b1..9e868b5337 100644

[libvirt] [PATCH 13/23] qemu: add qemuDomainNetworkPrivate

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- src/qemu/qemu_domain.c | 39 +++ src/qemu/qemu_domain.h | 12 2 files changed, 51 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH 10/23] qemu: add a DBus daemon helper unit

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Add a unit to start & stop a private dbus-daemon. The daemon is meant to be started on demand, and associated with a QEMU process. It is stopped when the QEMU process is stopped. Signed-off-by: Marc-André Lureau --- src/qemu/Makefile.inc.am | 4 +

[libvirt] [PATCH 11/23] qemu: add dbus-vmstate helper migration support

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Helper processes may have their state migrated with QEMU data stream thanks to the proposed object "dbus-vmstate". libvirt knows what helpers should be migrated. The "dbus-vmstate" is added when required, and given the list of helper Ids that must be present during

[libvirt] [PATCH 01/23] Add .editorconfig

2019-07-08 Thread marcandre . lureau
From: Marc-André Lureau Consistent code style across editors. Signed-off-by: Marc-André Lureau --- .editorconfig | 21 + 1 file changed, 21 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index

  1   2   >