[libvirt] [PATCH v2] qapi: add dirty-bitmaps to query-named-block-nodes result

2019-07-15 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Let's add a possibility to query dirty-bitmaps not only on root nodes. It is useful when dealing both with snapshots and incremental backups. Signed-off-by: Vladimir Sementsov-Ogievskiy [Added deprecation and feature flag information. --js] Signed-off-by: John

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

2019-07-15 Thread Florian Weimer
* Eric Blake: > On 7/15/19 12:01 PM, Florian Weimer wrote: > >> glibc supports malloc after multi-threaded fork as an extension (or as >> a bug, because it makes malloc not async-signal-safe). > > It's not a bug for glibc to provide guarantees above what POSIX > requires, but I

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

2019-07-15 Thread Eric Blake
On 7/15/19 12:01 PM, Florian Weimer wrote: > glibc supports malloc after multi-threaded fork as an extension (or as > a bug, because it makes malloc not async-signal-safe). It's not a bug for glibc to provide guarantees above what POSIX requires, but IS a bug for application

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

2019-07-15 Thread Florian Weimer
* Eric Blake: > On 7/15/19 9:26 AM, Florian Weimer wrote: >> * Eric Blake: >> >>> On 7/14/19 12:23 AM, Florian Weimer wrote: * Eric Blake: > Does anyone know if glibc guarantees that opendir/readdir in between > multi-threaded fork() and exec() is safe, even though POSIX does no

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

2019-07-15 Thread Eric Blake
On 7/15/19 9:26 AM, Florian Weimer wrote: > * Eric Blake: > >> On 7/14/19 12:23 AM, Florian Weimer wrote: >>> * Eric Blake: >>> Does anyone know if glibc guarantees that opendir/readdir in between multi-threaded fork() and exec() is safe, even though POSIX does not guarantee that sa

Re: [libvirt] [PATCH] tests: don't assume "localhost" only resolves to 1/2 IPs

2019-07-15 Thread Michal Privoznik
On 7/15/19 5:58 PM, Daniel P. Berrangé wrote: On Debian derived distros "localhost" can resolve to the normal "127.0.0.1" and "::1", but it can also resolve to "127.0.1.1" Rewrite the code so that it doesn't assume a fixed number of IPs. Signed-off-by: Daniel P. Berrangé --- tests/virsystemd

[libvirt] [PATCH] tests: don't assume "localhost" only resolves to 1/2 IPs

2019-07-15 Thread Daniel P . Berrangé
On Debian derived distros "localhost" can resolve to the normal "127.0.0.1" and "::1", but it can also resolve to "127.0.1.1" Rewrite the code so that it doesn't assume a fixed number of IPs. Signed-off-by: Daniel P. Berrangé --- tests/virsystemdtest.c | 17 ++--- 1 file changed, 10

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:06PM +0200, Peter Krempa wrote: 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 woul

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:05PM +0200, Peter Krempa wrote: 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

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:04PM +0200, Peter Krempa wrote: 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/qe

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:03PM +0200, Peter Krempa wrote: 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 f

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:02PM +0200, Peter Krempa wrote: 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(-) Reviewed-by: Ján Tomko Jano signature.asc Descri

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:01PM +0200, Peter Krempa wrote: 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(-) Reviewed-by: Ján Tomko Jano signature.asc Descr

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:06:00PM +0200, Peter Krempa wrote: 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 bes

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:59PM +0200, Peter Krempa wrote: 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.

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:58PM +0200, Peter Krempa wrote: 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 +++

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:57PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 41 src/qemu/qemu_blockjob.h | 3 +++ 2 files changed, 44 insertions(+) Reviewed-by: Ján Tomko Jano signature.asc Description: P

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:55PM +0200, Peter Krempa wrote: 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 inser

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:56PM +0200, Peter Krempa wrote: 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(+) Reviewed-by: Ján Tomko

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

2019-07-15 Thread Michal Privoznik
On 7/14/19 6:41 AM, Dawid Zamirski wrote: Hi Michal, Yes, please feel free to add: Signed-off-by: Dawid Zamirski to both messages. I'll make sure it is included in my future submissions from now on. Cool! I've merged these. Thanks. Michal -- libvir-list mailing list libvir-list@redhat.com

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:54PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- .../blockjob-blockdev-in.xml | 366 ++ .../blockjob-blockdev-out.xml | 1 + tests/qemuxml2xmltest.c | 2 + 3 files changed, 369 in

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:53PM +0200, Peter Krempa wrote: Now that the blockjob handling code deals with the status XML we don't need to save it explicitly when starting blockjobs. There also seems to be unnecessary saving in qemuBlockJobEventProcessLegacy Signed-off-by: Peter Krempa --

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

2019-07-15 Thread Daniel P . Berrangé
On Sun, Jul 14, 2019 at 07:23:10AM +0200, Florian Weimer wrote: > * Eric Blake: > > > Does anyone know if glibc guarantees that opendir/readdir in between > > multi-threaded fork() and exec() is safe, even though POSIX does not > > guarantee that safety in general? > > glibc supports malloc after

Re: [libvirt] [PATCH 1/2] virsh-completer: Separate comma list construction into a function

2019-07-15 Thread Michal Privoznik
On 7/15/19 1:07 PM, Erik Skultety wrote: On Wed, Jun 19, 2019 at 01:50:14PM +0200, Michal Privoznik wrote: On 6/19/19 12:59 PM, Erik Skultety wrote: On Tue, Jun 18, 2019 at 03:46:15PM +0200, Michal Privoznik wrote: There are more arguments than 'shutdown --mode' that accept a list of strings s

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

2019-07-15 Thread Florian Weimer
* Eric Blake: > On 7/14/19 12:23 AM, Florian Weimer wrote: >> * Eric Blake: >> >>> Does anyone know if glibc guarantees that opendir/readdir in between >>> multi-threaded fork() and exec() is safe, even though POSIX does not >>> guarantee that safety in general? >> >> glibc supports malloc after

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

2019-07-15 Thread Eric Blake
On 7/14/19 12:23 AM, Florian Weimer wrote: > * Eric Blake: > >> Does anyone know if glibc guarantees that opendir/readdir in between >> multi-threaded fork() and exec() is safe, even though POSIX does not >> guarantee that safety in general? > > glibc supports malloc after multi-threaded fork as

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:43PM +0200, Peter Krempa wrote: 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 in

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:52PM +0200, Peter Krempa wrote: 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 ne

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:51PM +0200, Peter Krempa wrote: 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 no

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:42PM +0200, Peter Krempa wrote: 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 pa

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:50PM +0200, Peter Krempa wrote: 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

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:49PM +0200, Peter Krempa wrote: 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 ++

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:48PM +0200, Peter Krempa wrote: 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: Pete

Re: [libvirt] [PATCH] test_driver: implement virDomainSetMemoryParameters

2019-07-15 Thread Erik Skultety
On Thu, Jul 04, 2019 at 11:36:35PM +0200, Ilias Stamatis wrote: > Signed-off-by: Ilias Stamatis > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:47PM +0200, Peter Krempa wrote: 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 -

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:46PM +0200, Peter Krempa wrote: 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

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:45PM +0200, Peter Krempa wrote: 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 ---

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 06:05:44PM +0200, Peter Krempa wrote: Simplify error paths. Signed-off-by: Peter Krempa --- src/qemu/qemu_blockjob.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-lis

Re: [libvirt] [PATCH] test_driver: implement virDomainSetUserPassword

2019-07-15 Thread Erik Skultety
On Tue, Jul 09, 2019 at 06:13:44PM +0200, Ilias Stamatis wrote: > Signed-off-by: Ilias Stamatis > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] all: don't wait for driver lock during startup

2019-07-15 Thread Erik Skultety
On Mon, Jul 15, 2019 at 12:59:52PM +0100, Daniel P. Berrangé wrote: > When the drivers acquire their pidfile lock we don't want to wait if the > lock is already held. We need the driver to immediately report error, > causing the daemon to exit. > > Signed-off-by: Daniel P. Berrangé > --- Makes sen

Re: [libvirt] [PATCH] interface: fix driver name in state directory path

2019-07-15 Thread Erik Skultety
On Mon, Jul 15, 2019 at 01:00:16PM +0100, Daniel P. Berrangé wrote: > Typo meant we use 'nodedev' instead of 'interface'. This doesn't hurt > libvirtd because if a process tries to acquire a lock it already holds > it will succeed. It fails when nodedev & interface drivers are in > separate daemons

[libvirt] [PATCH] interface: fix driver name in state directory path

2019-07-15 Thread Daniel P . Berrangé
Typo meant we use 'nodedev' instead of 'interface'. This doesn't hurt libvirtd because if a process tries to acquire a lock it already holds it will succeed. It fails when nodedev & interface drivers are in separate daemons though. Signed-off-by: Daniel P. Berrangé --- src/interface/interface_ba

[libvirt] [PATCH] all: don't wait for driver lock during startup

2019-07-15 Thread Daniel P . Berrangé
When the drivers acquire their pidfile lock we don't want to wait if the lock is already held. We need the driver to immediately report error, causing the daemon to exit. Signed-off-by: Daniel P. Berrangé --- src/bhyve/bhyve_driver.c| 2 +- src/interface/interface_backend_netcf.c

Re: [libvirt] [PATCH 5/5] libvirt_nss: Report newer addresses first

2019-07-15 Thread Michal Privoznik
On 7/15/19 10:16 AM, Erik Skultety wrote: On Sat, Jul 13, 2019 at 12:58:38PM +0200, Michal Privoznik wrote: Ideally, a software that's translating domain names would iterate over all addresses the NSS returned, but some software does not bother (e.g. ping). What happens is that for instance when

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

2019-07-15 Thread Christian Ehrhardt
On Fri, Jul 12, 2019 at 7:02 PM Jamie Strandboge wrote: > > 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-

Re: [libvirt] [PATCH 1/2] virsh-completer: Separate comma list construction into a function

2019-07-15 Thread Erik Skultety
On Wed, Jun 19, 2019 at 01:50:14PM +0200, Michal Privoznik wrote: > On 6/19/19 12:59 PM, Erik Skultety wrote: > > On Tue, Jun 18, 2019 at 03:46:15PM +0200, Michal Privoznik wrote: > > > There are more arguments than 'shutdown --mode' that accept a > > > list of strings separated by commas. 'nodedev

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

2019-07-15 Thread Andrea Bolognani
On Fri, 2019-07-12 at 15:12 -0500, Jonathon Jongsma wrote: > 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

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

2019-07-15 Thread Ján Tomko
On Fri, Jul 12, 2019 at 03:12:14PM -0500, Jonathon Jongsma wrote: 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 te

Re: [libvirt] [PATCH 5/5] libvirt_nss: Report newer addresses first

2019-07-15 Thread Erik Skultety
On Sat, Jul 13, 2019 at 12:58:38PM +0200, Michal Privoznik wrote: > Ideally, a software that's translating domain names would iterate > over all addresses the NSS returned, but some software does not > bother (e.g. ping). What happens is that for instance when > installing a guest, it's assigned on

Re: [libvirt] [PATCH] qemu: Relax os.loader->type check when validating domain

2019-07-15 Thread Andrea Bolognani
On Sat, 2019-07-13 at 09:29 +0200, Michal Privoznik wrote: > When validating a domain among all the checks there are two that > concern VIR_DOMAIN_LOADER_TYPE_PFLASH specifically. The first > check ensures that on x86 ACPI is enabled when UEFI is requested, > the second ensures that UEFI is used wh

Re: [libvirt] [PATCH 4/5] libvirt_nss: Pass @name to appendAddr()

2019-07-15 Thread Erik Skultety
On Sat, Jul 13, 2019 at 12:58:37PM +0200, Michal Privoznik wrote: > In the nss plugin we have ERROR() macro which by default does > nothing. However, at compile time it can be made to report errors > (this is useful for debugging because by nature of NSS debugging > is hard). Anyway, the appendAddr

Re: [libvirt] [PATCH 3/5] libvirt_nss: Drop some needless cleanup labels

2019-07-15 Thread Erik Skultety
On Sat, Jul 13, 2019 at 12:58:36PM +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/5] libvirt_nss: Use VIR_AUTOPTR and VIR_AUTOFREE

2019-07-15 Thread Erik Skultety
On Sat, Jul 13, 2019 at 12:58:35PM +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/5] libvirt_nss: Use VIR_STEAL_PTR() in findLease()

2019-07-15 Thread Erik Skultety
On Sat, Jul 13, 2019 at 12:58:34PM +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- Reviewed-by: Erik Skultety -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list