[PATCH v2] util: basic support for VFIO variant drivers

2022-08-10 Thread Laine Stump
Before a PCI device can be assigned to a guest with VFIO, that device must be bound to the vfio-pci driver rather than to the device's normal driver. The vfio-pci driver provides APIs that permit QEMU to perform all the necessary operations to make the device accessible to the guest. There has

Re: [libvirt PATCH] schema: Add maxphysaddr element to hostcpu

2022-08-10 Thread Daniel P . Berrangé
On Wed, Aug 10, 2022 at 06:29:25PM +0200, Tim Wiederhake wrote: > On Tue, 2022-08-09 at 17:35 +0100, Daniel P. Berrangé wrote: > > On Tue, Aug 09, 2022 at 06:22:12PM +0200, Tim Wiederhake wrote: > > > The output of "virsh capabilities" was not conformant to the > > > capability.rng schema. Add the

Re: [libvirt PATCH] schema: Add maxphysaddr element to hostcpu

2022-08-10 Thread Tim Wiederhake
On Tue, 2022-08-09 at 17:35 +0100, Daniel P. Berrangé wrote: > On Tue, Aug 09, 2022 at 06:22:12PM +0200, Tim Wiederhake wrote: > > The output of "virsh capabilities" was not conformant to the > > capability.rng schema. Add the missing element to the schema. > > The RNG files are applied against

Re: [libvirt PATCH 2/3] scripts: Add $DESTDIR support to meson-install-web.py

2022-08-10 Thread Andrea Bolognani
On Tue, Aug 09, 2022 at 05:26:28PM +0200, Pavel Hrdina wrote: > On Tue, Jul 19, 2022 at 04:17:44PM +0200, Andrea Bolognani wrote: > > +destdir = os.getenv('DESTDIR') > > +if destdir: > > +destdir = Path(destdir) > > +if not destdir.is_absolute(): > > +print('$DESTDIR must be an

[libvirt PATCH v2 0/2] ci: Fix paths shown in the website

2022-08-10 Thread Andrea Bolognani
Compare https://abologna.gitlab.io/-/libvirt/-/jobs/2840280594/artifacts/website/manpages/virtqemud.html#files with https://libvirt.org/manpages/virtqemud.html#files Changes from [v1]: * don't use pathlib; * don't check whether DESTDIR is absolute. [v1]

[libvirt PATCH v2 1/2] scripts: Add $DESTDIR support to meson-install-web.py

2022-08-10 Thread Andrea Bolognani
meson already supports $DESTDIR natively, but in this case we're using a custom script and so we have to do some extra work ourselves. Signed-off-by: Andrea Bolognani --- scripts/meson-install-web.py | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[libvirt PATCH v2 2/2] ci: Fix paths shown in the website

2022-08-10 Thread Andrea Bolognani
Right now we're setting the prefix to a custom path, which results in paths like /builds/libvirt/libvirt/vroot/etc/libvirt/virtqemud.conf ending up in the generated HTML. In order to avoid that, set the prefix and other installation paths to reasonable default values by passing

Re: [libvirt PATCH 0/3] tests: Fix qemucapabilitiestest on macOS

2022-08-10 Thread Andrea Bolognani
On Wed, Aug 10, 2022 at 05:16:57PM +0200, Christophe de Dinechin wrote: > On 2022-08-10 at 16:29 +02, Andrea Bolognani wrote... > > We need to mock the function that probes for HVF support. > > > > Andrea Bolognani (3): > > tests: Use domaincapsmock in qemucapabilitiestest > > qemu: Make

Re: [libvirt PATCH 0/3] tests: Fix qemucapabilitiestest on macOS

2022-08-10 Thread Christophe de Dinechin
On 2022-08-10 at 16:29 +02, Andrea Bolognani wrote... > We need to mock the function that probes for HVF support. > > Andrea Bolognani (3): > tests: Use domaincapsmock in qemucapabilitiestest > qemu: Make virQEMUCapsProbeHVF() non-static > tests: Mock virQEMUCapsProbeHVF() > >

[PATCH 4/4] DO_NOT_APPLY_UPSTREAM: reproducer

2022-08-10 Thread Peter Krempa
To reproduce the problem apply this patch and run a block copy job: virsh blockcopy cd hda /tmp/ble.img --transient-job --pivot Prior to the fix the virsh call will hang and the VM will not be usable any more. --- src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [PATCH 0/3] qemu: Fix waiting for domain condition when qemu crashes

2022-08-10 Thread Ján Tomko
On a Wednesday in 2022, Peter Krempa wrote: See 3/4. 3/4 out of a 3-patch series, interesting. Peter Krempa (4): qemuProcessBeginStopJob: Add debug log when waking up all threads waiting on domain condition qemu: Replace virDomainObjWait with qemuDomainObjWait qemuDomainObjWait:

Re: [libvirt PATCH 0/3] tests: Fix qemucapabilitiestest on macOS

2022-08-10 Thread Ján Tomko
On a Wednesday in 2022, Andrea Bolognani wrote: We need to mock the function that probes for HVF support. Andrea Bolognani (3): tests: Use domaincapsmock in qemucapabilitiestest qemu: Make virQEMUCapsProbeHVF() non-static tests: Mock virQEMUCapsProbeHVF() src/qemu/qemu_capabilities.c | 4

[PATCH 1/4] qemuProcessBeginStopJob: Add debug log when waking up all threads waiting on domain condition

2022-08-10 Thread Peter Krempa
Aid in debugging of potentially stuck threads. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 478a46bff6..0f30247817 100644 --- a/src/qemu/qemu_process.c +++

Re: Test failures on macOS 12

2022-08-10 Thread Andrea Bolognani
On Mon, Aug 08, 2022 at 08:54:14PM +0200, Christophe de Dinechin wrote: > On Fri, May 06, 2022 at 03:00:14AM -0700, Andrea Bolognani wrote: > > The other issue is in qemuxml2argvtest: > > > > error : virCommandWait:2752 : internal error: Child process > >

[libvirt PATCH 0/3] tests: Fix qemucapabilitiestest on macOS

2022-08-10 Thread Andrea Bolognani
We need to mock the function that probes for HVF support. Andrea Bolognani (3): tests: Use domaincapsmock in qemucapabilitiestest qemu: Make virQEMUCapsProbeHVF() non-static tests: Mock virQEMUCapsProbeHVF() src/qemu/qemu_capabilities.c | 4 ++-- src/qemu/qemu_capabilities.h | 2 ++

[libvirt PATCH 3/3] tests: Mock virQEMUCapsProbeHVF()

2022-08-10 Thread Andrea Bolognani
Successfully returning without doing anything is what the function already does on non-Apple platforms. When building on macOS, however, the check for HVF availability will be performed. When running on bare metal, that will result in the QEMU_CAPS_HVF flag being added to the virQEMUCaps

[libvirt PATCH 2/3] qemu: Make virQEMUCapsProbeHVF() non-static

2022-08-10 Thread Andrea Bolognani
We need to do this so that we can mock it in the test suite. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 ++-- src/qemu/qemu_capabilities.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c

[libvirt PATCH 1/3] tests: Use domaincapsmock in qemucapabilitiestest

2022-08-10 Thread Andrea Bolognani
This doesn't change anything at the moment, but is necessary for the upcoming fix. Signed-off-by: Andrea Bolognani --- tests/qemucapabilitiestest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index

Re: [PATCH 1/5] qemu: beginJob: move saveStatus into private job callbacks

2022-08-10 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: It makes sense to move this to other hypervisor-based functions into the private job callback structure to make begin job general. Signed-off-by: Kristina Hanicova --- src/hypervisor/domain_job.h | 2 ++ src/qemu/qemu_domain.c | 1 +

[PATCH 0/3] qemu: Fix waiting for domain condition when qemu crashes

2022-08-10 Thread Peter Krempa
See 3/4. Peter Krempa (4): qemuProcessBeginStopJob: Add debug log when waking up all threads waiting on domain condition qemu: Replace virDomainObjWait with qemuDomainObjWait qemuDomainObjWait: Report error when VM is being destroyed DO_NOT_APPLY_UPSTREAM: reproducer

[PATCH 2/4] qemu: Replace virDomainObjWait with qemuDomainObjWait

2022-08-10 Thread Peter Krempa
The qemu code will need to check other qemu-private conditions when reporting success for waiting. Thus we must replace all use of it with a qemu-specific helper. For now the helper forwards directly to virDomainObjWait. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 2 +-

[PATCH 3/4] qemuDomainObjWait: Report error when VM is being destroyed

2022-08-10 Thread Peter Krempa
Since we started handing the monitor EOF event inside a job any code which uses virDomainObjWait would no longer properly abort in case when the VM crashed during the wait. This is because virDomainObjWait uses virDomainObjIsActive which checks 'vm->def->id' to see if the VM is still active.

[PATCH] qemu: Fix indentation

2022-08-10 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- Pushed as trivial. src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f8e70470f6..79ef8b88ef 100644 --- a/src/qemu/qemu_capabilities.c +++

Re: [PATCH v2 9/9] qemu: Place helper processes into the same trusted group

2022-08-10 Thread Michal Prívozník
On 7/13/22 18:25, Daniel P. Berrangé wrote: > On Mon, Jun 27, 2022 at 12:44:41PM +0200, Michal Privoznik wrote: >> Since the level of trust that QEMU has is the same level of trust >> that helper processes have there's no harm in placing all of them >> into the same group. >> >> Unfortunately,

Re: [PATCH 0/5] jobs: qemu & hypervisor: move hypervisor-based variables and functions

2022-08-10 Thread Ján Tomko
On a Wednesday in 2022, Kristina Hanicova wrote: *** BLURB HERE *** Kristina Hanicova (5): qemu: beginJob: move saveStatus into private job callbacks hypervisor: domain_job: add maxQueuedJobs qemu: remove unused driver and all its propagations qemu: refactor functions with removed driver if

[PATCH 5/5] hypervisor: domain_job: add JobData private callbacks into virDomainJobObj

2022-08-10 Thread Kristina Hanicova
We need this callback structure for qemu driver only, but it makes more sense to include it in the virDomainJobObj in case of other future additions than as a parameter of a beginJob functions. Signed-off-by: Kristina Hanicova --- src/ch/ch_domain.c | 2 +- src/hypervisor/domain_job.c

[PATCH 0/5] jobs: qemu & hypervisor: move hypervisor-based variables and functions

2022-08-10 Thread Kristina Hanicova
*** BLURB HERE *** Kristina Hanicova (5): qemu: beginJob: move saveStatus into private job callbacks hypervisor: domain_job: add maxQueuedJobs qemu: remove unused driver and all its propagations qemu: refactor functions with removed driver if possible hypervisor: domain_job: add JobData

[PATCH 2/5] hypervisor: domain_job: add maxQueuedJobs

2022-08-10 Thread Kristina Hanicova
This patch adds a new variable maxQueuedJobs into the job object as it is the last hypervisor-based part of the begin job. Since this patch, it will not be necessary to propagate driver structure into the job functions. Signed-off-by: Kristina Hanicova --- src/hypervisor/domain_job.h | 1 +

[PATCH 1/5] qemu: beginJob: move saveStatus into private job callbacks

2022-08-10 Thread Kristina Hanicova
It makes sense to move this to other hypervisor-based functions into the private job callback structure to make begin job general. Signed-off-by: Kristina Hanicova --- src/hypervisor/domain_job.h | 2 ++ src/qemu/qemu_domain.c | 1 + src/qemu/qemu_domainjob.c | 4 ++-- 3 files changed, 5

Re: [PATCH v2 8/9] qemu: Enable SCHED_CORE for domains and helper processes

2022-08-10 Thread Michal Prívozník
On 7/13/22 19:25, Daniel P. Berrangé wrote: > On Mon, Jun 27, 2022 at 12:44:40PM +0200, Michal Privoznik wrote: >> Despite all mitigations, side channel attacks when two processes >> run at two Hyper Threads of the same core are still possible. >> Fortunately, the Linux kernel came up with a

[PATCH 4/5] qemu: refactor functions with removed driver if possible

2022-08-10 Thread Kristina Hanicova
Signed-off-by: Kristina Hanicova --- src/qemu/qemu_domain.c| 3 +-- src/qemu/qemu_driver.c| 52 ++- src/qemu/qemu_hotplug.c | 12 +++-- src/qemu/qemu_migration.c | 39 ++--- src/qemu/qemu_snapshot.c | 3 +-- 5 files

Re: [PATCH 1/3] virprocess: define sched_attr and sched_setattr

2022-08-10 Thread Michal Prívozník
On 8/1/22 19:11, Sasha Algisi wrote: > In order to use SCHED_DEADLINE we need sched_setattr(), as > sched_setscheduler() does not support all the necessary parameters. > > Signed-off-by: Sasha Algisi > Signed-off-by: Dario Faggioli > --- > src/util/virprocess.c | 39

Re: [PATCH 2/3] virprocess: add the SCHED_DEADLINE scheduling policy

2022-08-10 Thread Michal Prívozník
On 8/1/22 19:11, Sasha Algisi wrote: > Tasks associated to virtual CPUs, IO Threads and Emulator processes > can be created with the SCHED_DEADLINE policy. The policy is described > in details here: https://docs.kernel.org/scheduler/sched-deadline.html > > It requires the following parameters

Re: [PATCH 3/3] domain_conf: add SCHED_DEADLINE support in the XML configuration

2022-08-10 Thread Michal Prívozník
On 8/1/22 19:11, Sasha Algisi wrote: > Users can set SCHED_DEADLINE as a scheduling policy. > > For example, for setting runtime = 1000, deadline = 1500 > and period = 2000 for vcpus 0-2: > > > ... > deadline="1500" period="2000"/> > ... > > > Update release

Re: [PATCH 0/3] qemu: add support for the SCHED_DEADLINE scheduling policy

2022-08-10 Thread Michal Prívozník
On 8/1/22 19:11, Sasha Algisi wrote: > Hello everyone, > > This patchset aims at adding support for the SCHED_DEADLINE Linux > scheduling policy for vcpus, io-threads and emulator processes. > > In fact, libvirt currently supports SCHED_OTHER, SCHED_BATCH, > SCHED_IDLE, SCHE_FIFO and SCHED_RR,