[PATCH 3/3] meson: Drop userfaultfd_sysctl option

2024-02-14 Thread Andrea Bolognani
It was introduced to make installation of the corresponding file conditional based on the build platform, but we've already changed the spec file so that all the decisions on the matter happen there, which makes having yet another meson option for the purpose unnecessary. Signed-off-by: Andrea

[PATCH 2/3] rpm: Always enable userfaultfd_sysctl

2024-02-14 Thread Andrea Bolognani
Instead of enabling the feature conditionally, always enable it and then remove the installed file when building on a platform that doesn't need it. We already perform the complementary check to decide whether the file should be included in the package. Signed-off-by: Andrea Bolognani ---

[PATCH 0/3] meson: Drop userfaultfd_sysctl option

2024-02-14 Thread Andrea Bolognani
Recently introduced as part of [1]. We can skip the meson part for this one, and deal with everything in the spec file only. Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/1176890275 [1]

[PATCH 1/3] rpm: Always enable sysctl_config

2024-02-14 Thread Andrea Bolognani
We currently rely on it being enabled by default. Signed-off-by: Andrea Bolognani --- libvirt.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 49ce717e1b..af2ba20c02 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1368,6 +1368,7 @@

Re: [PATCH v2 10/11] nodedev: Implement virNodeDeviceUpdateXML

2024-02-14 Thread Jonathon Jongsma
On 2/13/24 3:04 AM, Boris Fiuczynski wrote: On 2/9/24 23:45, Jonathon Jongsma wrote: On 2/7/24 7:39 AM, Boris Fiuczynski wrote: Implement the API functions in the node device driver by using mdevctl modify with the options defined and live. Instead of increasing the minimum mdevctl version to

Re: [PATCH v2 09/11] api: add virNodeDeviceUpdate()

2024-02-14 Thread Jonathon Jongsma
On 2/14/24 6:59 AM, Boris Fiuczynski wrote: On 2/13/24 14:43, Boris Fiuczynski wrote: Tangentially related: Almost all of the other API objects can update their persistent definition from an XML file by calling the $(OBJECT)DefineXML command to replace the existing definition. The Node

[PATCH v2 17/17] qemu: Use qemu-xhci by default on RISC-V

2024-02-14 Thread Andrea Bolognani
Currently we fall back to the x86-derived default of piix3-uhci, which is a USB1 controller that's not virtualization-friendly and overall a terrible choice for a modern architecture. The fact that we didn't choose a better default when RISC-V support was introduced was an oversight which is now

[PATCH v2 16/17] qemu: Clean up qemuDomainDefaultUSBControllerModel()

2024-02-14 Thread Andrea Bolognani
Just like qemuDomainDefaultSCSIControllerModel() before that, split the function into an internal part and a trivial public wrapper. This allows us to rewrite the internal logic in the much more compact and readable if (condition) return value; if (other_condition) return

[PATCH v2 15/17] qemu: Extend qemuDomainDefaultUSBControllerModel()

2024-02-14 Thread Andrea Bolognani
In addition to the code in qemuDomainControllerDefPostParse(), which we have just factored into its own function, we also have some code in qemuDomainDefAddDefaultDevices() that deals with choosing the model for a USB controller, specifically for q35 guests. Integrate it into the newly-created

[PATCH v2 14/17] qemu: Add qemuDomainDefaultUSBControllerModel()

2024-02-14 Thread Andrea Bolognani
Extract the logic from qemuDomainControllerDefPostParse(). The behavior is unchanged, we simply use an out argument to return the model and entertain the possibility of the process failing, even though the current implementation never will. Signed-off-by: Andrea Bolognani ---

[PATCH v2 13/17] qemu: Drop all code dealing with the legacy USB controller

2024-02-14 Thread Andrea Bolognani
With the recent changes, we have ensured that all situations that would have until now caused this code to be executed are either handled by dropping the USB controller or by raising an error. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_command.c | 78

[PATCH v2 11/17] qemu: Validate USB controllers earlier

2024-02-14 Thread Andrea Bolognani
Right now we call qemuValidateDomainDeviceDefControllerUSB() quite late, just as we're generating the QEMU command line. The intention here is to prevent configurations from being rejected, even though a default USB controller model could not be found, because using -usb could work as a last

[PATCH v2 12/17] qemu: Improve error message for USB controller validation

2024-02-14 Thread Andrea Bolognani
Use the same wording as for SCSI controllers, which also happens to contain additional information (the controller's index). The new error message and error type are more accurate anyway: in most cases, it's perfectly fine for the user not to provide a controller model explicitly, as libvirt will

[PATCH v2 10/17] qemu: Only use legacy USB controller if actually needed

2024-02-14 Thread Andrea Bolognani
With the way the code is currently written, we can end up using the legacy USB controller (-usb) for a guest that doesn't have any USB controllers at all in its configuration. This is pretty harmless, since in these cases QEMU will ignore the request and not create any USB controller, but it's

[PATCH v2 09/17] qemu: Always default to no USB controller on s390x

2024-02-14 Thread Andrea Bolognani
When support for s390x was introduced in libvirt, it naturally followed the conventions established at the time for x86, which were to have a USB controller added by default. Later, in 2013, commit 3a82f628a964 made the default USB controller model for s390x VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE,

[PATCH v2 07/17] tests: Add usb-legacy-multiple

2024-02-14 Thread Andrea Bolognani
We have special handling for this configuration, so make sure that there is some test coverage too. Signed-off-by: Andrea Bolognani --- .../usb-legacy-multiple.x86_64-latest.err | 1 + .../usb-legacy-multiple.x86_64-latest.xml | 32 +++

[PATCH v2 08/17] tests: Add usb-legacy-device

2024-02-14 Thread Andrea Bolognani
This provides coverage for the scenario in which an attempt is made to use a USB device together with the legacy USB controller. Note that, while the test case passes, the configuration it produces doesn't actually work: $ qemu-system-x86_64 -M pc -usb -device usb-tablet,bus=usb.0 Bus

[PATCH v2 06/17] qemu: Use virtio-scsi by default on RISC-V

2024-02-14 Thread Andrea Bolognani
Just like piix3-uhci for USB, the choice of lsilogic for SCSI was dictated entirely by that being the default for legacy x86 guests. Use virtio-scsi instead. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c| 4 +++-

[PATCH v2 04/17] qemu: Improve qemuDomainDefaultSCSIControllerModel()

2024-02-14 Thread Andrea Bolognani
Make the helper stateless. This requires the caller to check whether it needs to be called in the first place instead of adding this check inside the function, which makes for more readable, if a little more verbose, code. At the same time, change it so that it uses an out argument to return the

[PATCH v2 05/17] qemu: Clean up qemuDomainDefaultSCSIControllerModel()

2024-02-14 Thread Andrea Bolognani
Use a better order for sections, improve comments. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[PATCH v2 03/17] qemu: Move error reporting out of qemuDomainDefaultSCSIControllerModel()

2024-02-14 Thread Andrea Bolognani
We want this helper to work more like other similar ones, where error reporting is performed by the caller. This introduces a small amount of code duplication but makes for a cleaner API. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 9 + src/qemu/qemu_hotplug.c | 3 +++

[PATCH v2 02/17] qemu: Rename qemuDomainDefaultSCSIControllerModel()

2024-02-14 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 8 src/qemu/qemu_domain.h | 6 +++--- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d7be544710..01f4ed6917 100644 ---

[PATCH v2 01/17] tests: Add controller-scsi-default-unavailable

2024-02-14 Thread Andrea Bolognani
This provides coverage for the (very unlikely) scenario in which none of the possible devices are built into QEMU. Signed-off-by: Andrea Bolognani --- ...ler-scsi-default-unavailable.x86_64-latest.err | 1 + .../controller-scsi-default-unavailable.xml | 15 +++

[PATCH v2 00/17] qemu: Improve handling of architecture-specific defaults

2024-02-14 Thread Andrea Bolognani
Changes from [v1]: * several patches have been pushed; * of the remaining changes, only the ones related to SCSI and USB controllers have been retained. I still intend to pursue the rest, but those two are where the real nasty stuff happens, so I'm focusing on them only for now;

Re: [PUSHED PATCH] spec: Explicitly disable userfaultfd_sysctl for mingw

2024-02-14 Thread Ján Tomko
On a Wednesday in 2024, Pavel Hrdina wrote: On Wed, Feb 14, 2024 at 01:31:29PM +0100, Peter Krempa wrote: On Tue, Feb 13, 2024 at 19:16:00 +0100, Jiri Denemark wrote: > The %meson* macros pass --auto-features=enabled to enable all "auto" > features, which means we have to explicitly disable

Re: [PUSHED PATCH] spec: Explicitly disable userfaultfd_sysctl for mingw

2024-02-14 Thread Pavel Hrdina
On Wed, Feb 14, 2024 at 01:31:29PM +0100, Peter Krempa wrote: > On Tue, Feb 13, 2024 at 19:16:00 +0100, Jiri Denemark wrote: > > The %meson* macros pass --auto-features=enabled to enable all "auto" > > features, which means we have to explicitly disable them. > > This is not the first time we've

Re: [PATCH] cpu_map: Drop 'mpx' from x86 cpu models

2024-02-14 Thread Jiri Denemark
On Wed, Feb 14, 2024 at 13:23:09 +0100, Tim Wiederhake wrote: > On Wed, 2024-02-14 at 12:39 +0100, Jiri Denemark wrote: > > On Wed, Feb 14, 2024 at 12:07:46 +0100, Michal Prívozník wrote: > > > On 2/9/24 11:52, Tim Wiederhake wrote: > > > > The mpx feature was removed from the corresponding qemu

Re: [PATCH v2 09/11] api: add virNodeDeviceUpdate()

2024-02-14 Thread Boris Fiuczynski
On 2/13/24 14:43, Boris Fiuczynski wrote: Tangentially related: Almost all of the other API objects can update their persistent definition from an XML file by calling the $(OBJECT)DefineXML command to replace the existing definition. The Node device API does not yet support doing that, maybe

Re: [PUSHED PATCH] spec: Explicitly disable userfaultfd_sysctl for mingw

2024-02-14 Thread Peter Krempa
On Tue, Feb 13, 2024 at 19:16:00 +0100, Jiri Denemark wrote: > The %meson* macros pass --auto-features=enabled to enable all "auto" > features, which means we have to explicitly disable them. This is not the first time we've hit this. I really think the only sane option for --auto-features= for

Re: [PATCH 1/2] conf: add locking option to disk source

2024-02-14 Thread Peter Krempa
On Wed, Feb 14, 2024 at 13:17:39 +0100, Peter Krempa wrote: > On Wed, Feb 14, 2024 at 14:17:57 +0900, Hiroki Narukawa wrote: > > There is a case that locking hits a bug and users wants to disable > > locking like bug in Linux kernel. > > > > This commit adds option to configure locking for file

Re: [PATCH 2/2] qemu_block: add locking option

2024-02-14 Thread Peter Krempa
On Wed, Feb 14, 2024 at 14:17:58 +0900, Hiroki Narukawa wrote: > There is a case that locking hits a bug and users wants to disable > locking like bug in Linux kernel. > > This commit adds actual qemu option to the domain conf added in previous > commit. > > Signed-off-by: Hiroki Narukawa > ---

Re: [PATCH] cpu_map: Drop 'mpx' from x86 cpu models

2024-02-14 Thread Tim Wiederhake
On Wed, 2024-02-14 at 12:39 +0100, Jiri Denemark wrote: > On Wed, Feb 14, 2024 at 12:07:46 +0100, Michal Prívozník wrote: > > On 2/9/24 11:52, Tim Wiederhake wrote: > > > The mpx feature was removed from the corresponding qemu cpu > > > models. > > > With mpx in the libvirt cpu models, libvirt

Re: [PATCH 1/2] conf: add locking option to disk source

2024-02-14 Thread Peter Krempa
On Wed, Feb 14, 2024 at 14:17:57 +0900, Hiroki Narukawa wrote: > There is a case that locking hits a bug and users wants to disable > locking like bug in Linux kernel. > > This commit adds option to configure locking for file source. > > Signed-off-by: Hiroki Narukawa > --- >

Re: [PATCH] cpu_map: Drop 'mpx' from x86 cpu models

2024-02-14 Thread Jiri Denemark
On Wed, Feb 14, 2024 at 12:07:46 +0100, Michal Prívozník wrote: > On 2/9/24 11:52, Tim Wiederhake wrote: > > The mpx feature was removed from the corresponding qemu cpu models. > > With mpx in the libvirt cpu models, libvirt believes the feature > > to be implicitly enabled when creating qemu VMs,

Re: [PATCH] cpu_map: Drop 'mpx' from x86 cpu models

2024-02-14 Thread Michal Prívozník
On 2/9/24 11:52, Tim Wiederhake wrote: > The mpx feature was removed from the corresponding qemu cpu models. > With mpx in the libvirt cpu models, libvirt believes the feature > to be implicitly enabled when creating qemu VMs, while in fact it is > disabled. > > This became an issue when commit

Re: [PATCH] virsh: completer for --type of commands find-storage-pool-sources and find-storage-pool-sources-as

2024-02-14 Thread Michal Prívozník
On 2/14/24 09:35, Adam Julis wrote: > Signed-off-by: Adam Julis > --- > tools/virsh-completer-pool.c | 11 +++ > tools/virsh-completer-pool.h | 5 + > tools/virsh-pool.c | 2 ++ > 3 files changed, 18 insertions(+) > > diff --git a/tools/virsh-completer-pool.c

[PATCH] virsh: completer for --type of commands find-storage-pool-sources and find-storage-pool-sources-as

2024-02-14 Thread Adam Julis
Signed-off-by: Adam Julis --- tools/virsh-completer-pool.c | 11 +++ tools/virsh-completer-pool.h | 5 + tools/virsh-pool.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c index 0600394411..1081e5c10c