]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 months agoqemu: command: Don't downgrade to '-usb' for x86 based machines
Peter Krempa [Mon, 19 Feb 2024 14:28:33 +0000 (15:28 +0100)]
qemu: command: Don't downgrade to '-usb' for x86 based machines

- 'q35' machine type already explicitly forbids fallback
- 'isapc' never supported USB and '-usb' is ignored
- 'i440fx' does support '-usb' and translates it into 'piix3-uhci' which
  is identical to what libvirt selects
- we currently don't care about 'microvm'

Attempting to start an 'pc' (i440fx) machine with -usb when 'piix3-uhci'
is compiled out will fail and in any other case libvirt will use the
proper explicitly selected controller.

Drop the '-usb' downgrade for x86 arch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuDomainControllerDefPostParse: Use 'pci-ohci' as last-resort fallback USB controller
Peter Krempa [Tue, 27 Feb 2024 11:52:08 +0000 (12:52 +0100)]
qemuDomainControllerDefPostParse: Use 'pci-ohci' as last-resort fallback USB controller

This controller is used as the default/implicit USB controller by
multiple machine types which honour the '-usb' flag of qemu. Add it as
fallback in libvirt too.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuDomainDefAddDefaultDevices: Populate default USB for 'versatilepb' and 'realview...
Peter Krempa [Mon, 26 Feb 2024 15:17:41 +0000 (16:17 +0100)]
qemuDomainDefAddDefaultDevices: Populate default USB for 'versatilepb' and 'realview' ARM machines

The machine types historically have a default USB controller populated
via '-usb' which libvirt assumed implicitly. Qemu will use 'pci-ohci'
for both if '-usb' is used.

Unfortunately an USB controller instantiated via '-usb' is unusable as
the bus name libvirt generates doesn't reflect the real name qemu uses,
and thus no libvirt-defined USB devices can be put on the controller.

This patch will populate the default USB controller into the XML and
select it's model to 'pci-ohci' unconditionally as the machine would
fail to start with '-usb' if that controller model is not available.

This patch doesn't try to make any other assumptions about
auto-populated model of USB controllers, which means that for an
explicit USB controller without model a different model will be picked.

Note that this will likely cause ABI differences and break migration for
the two machine types, in the corner case when the default USB
controller would be populated, but given that both are obsolete board
types and USB was unusable it doesn't make sense to keep supporting this
specific case when '-usb' was formatted.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuDomainControllerDefPostParse: Use proper enum value for default USB controller...
Peter Krempa [Tue, 27 Feb 2024 12:18:06 +0000 (13:18 +0100)]
qemuDomainControllerDefPostParse: Use proper enum value for default USB controller model

Assign VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT rather than -1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuDomainDefAddDefaultDevices: Handle defaults for all ARM arches together
Peter Krempa [Mon, 26 Feb 2024 14:45:41 +0000 (15:45 +0100)]
qemuDomainDefAddDefaultDevices: Handle defaults for all ARM arches together

Most machine types are avaliable in all arches by qemu. This is also
true for the 'versatilepb' machine type example in the tests.

Move all the ARM architectures together so that they are handled in
sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test data for USB selection with 'mac99' machine on ppc
Peter Krempa [Wed, 21 Feb 2024 14:30:41 +0000 (15:30 +0100)]
qemuxmlconftest: Add test data for USB selection with 'mac99' machine on ppc

Add an example using the old binary/machine type to also see how legacy
cases are handled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test data for USB selection with 'powernv' machine on ppc64
Peter Krempa [Wed, 21 Feb 2024 14:30:41 +0000 (15:30 +0100)]
qemuxmlconftest: Add test data for USB selection with 'powernv' machine on ppc64

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test data for USB selection with 'mac99' machine on ppc64
Peter Krempa [Wed, 21 Feb 2024 14:30:41 +0000 (15:30 +0100)]
qemuxmlconftest: Add test data for USB selection with 'mac99' machine on ppc64

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test data for USB selection with 'g3beige' machine on ppc64
Peter Krempa [Wed, 21 Feb 2024 14:30:41 +0000 (15:30 +0100)]
qemuxmlconftest: Add test data for USB selection with 'g3beige' machine on ppc64

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test case when default USB controller for 'pseries' is compiled out
Peter Krempa [Tue, 20 Feb 2024 14:50:04 +0000 (15:50 +0100)]
qemuxmlconftest: Add test case when default USB controller for 'pseries' is compiled out

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxml2conftest: Consolidate usb controller tests for 'pseries' machine
Peter Krempa [Tue, 20 Feb 2024 14:44:00 +0000 (15:44 +0100)]
qemuxml2conftest: Consolidate usb controller tests for 'pseries' machine

Move the test invocation and rename the test files according to the
pattern.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test data for an ARM machine where qemu doesn't honour -usb
Peter Krempa [Tue, 20 Feb 2024 14:05:51 +0000 (15:05 +0100)]
qemuxmlconftest: Add test data for an ARM machine where qemu doesn't honour -usb

The 'borzoi' machine doesn't honour '-usb' in qemu so use it as an
example for the upcoming patch for removing '-usb' support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconftest: Add test for 'realview' machine
Peter Krempa [Tue, 20 Feb 2024 13:22:05 +0000 (14:22 +0100)]
qemuxmlconftest: Add test for 'realview' machine

Add test data for a 'realview' machine example to validate default USB
controller selection.

Note that it's unlikely that anyone would run 'realview' machines with
'aarch64' architecture, but qemu allows it and it's simpler test-wise in
libvirt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconfdata: Add tests for USB controller selection with 'versatilepb' machine...
Peter Krempa [Mon, 26 Feb 2024 14:34:12 +0000 (15:34 +0100)]
qemuxmlconfdata: Add tests for USB controller selection with 'versatilepb' machine on arm qemu binary

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemuxmlconfdata: Add tests for USB controller selection with 'versatilepb' machine...
Peter Krempa [Mon, 26 Feb 2024 14:34:12 +0000 (15:34 +0100)]
qemuxmlconfdata: Add tests for USB controller selection with 'versatilepb' machine on aarch64 qemu binary

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemucapabilitiestest: Add test dump for 'armv7l' architecture
Peter Krempa [Thu, 22 Feb 2024 13:37:08 +0000 (14:37 +0100)]
qemucapabilitiestest: Add test dump for 'armv7l' architecture

Add capabilities based on a dump from x86_64 host running Fedora for the
qemu-system-arm binary.

The test dump will be used for illustration of USB controller model
selection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agotestutilshostcpus: Add support for VIR_ARCH_ARMV7L
Peter Krempa [Thu, 22 Feb 2024 13:35:51 +0000 (14:35 +0100)]
testutilshostcpus: Add support for VIR_ARCH_ARMV7L

Allow using armv7l arch in a capability dump.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemucapabilitiesdata: Document faked caps dumps
Peter Krempa [Thu, 22 Feb 2024 13:34:25 +0000 (14:34 +0100)]
qemucapabilitiesdata: Document faked caps dumps

Document the reality that some dumps were faked for purpose of testing
corner cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agotests: Replace mentions of the removed 'qemucapabilitiesnumbering' tool
Peter Krempa [Thu, 22 Feb 2024 13:29:43 +0000 (14:29 +0100)]
tests: Replace mentions of the removed 'qemucapabilitiesnumbering' tool

Mention the new 'scripts/qemu-replies-tool.py'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoqemu: Optimize CPU check='partial' for usable CPUs
Jiri Denemark [Fri, 1 Mar 2024 15:56:16 +0000 (16:56 +0100)]
qemu: Optimize CPU check='partial' for usable CPUs

Ideally check='partial' would check exactly the features QEMU would want
to enable when asked for a specific CPU model (and features). But there
is no way we could ask QEMU how a specific CPU would look like. So we
use our definition from CPU map, which may slightly differ as QEMU adds
or removes features from CPU models, and thus we may end up checking
features which QEMU would not enable while missing some required ones.

We can do better in specific cases, though. If a CPU definition uses
only a model and disabled features (or none at all), we already know
whether QEMU can enable all features required by the CPU model as that's
what we use to set usable='yes' attribute in the list of available CPU
models in domain capbilities XML. So when a usable CPU model is
requested without asking for additional features (disabling features is
fine) we can avoid our possible inaccurate check using our CPU map.

For backward compatibility we only consider usable models. If a
specified model is not usable, we still check it the old way and even
let QEMU start it (and disable some features) in case our definition
lacks some features compared to QEMU.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/608
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
14 months agocpu: x86: Check for invalid CPU data from hypervisor
Jiri Denemark [Thu, 29 Feb 2024 17:28:02 +0000 (18:28 +0100)]
cpu: x86: Check for invalid CPU data from hypervisor

Recently a kernel bug caused QEMU to report a CPU feature as enabled
while listing it in the "unavailable-features" list of features that
were requested, but could not be enabled. The feature was actually
enabled, but we marked it as disabled when starting a domain. Later when
the domain is migrated, the destination requests the feature to be
disabled, which breaks the guest ABI or if we are lucky QEMU just fails
to load the migration stream.

Let's make similar bugs more visible in the future by refusing to even
start the domain.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
14 months agovirsh: Fix overflow error of freepages command
Adam Julis [Tue, 5 Mar 2024 10:43:03 +0000 (11:43 +0100)]
virsh: Fix overflow error of freepages command

Trying to print pages of a size larger than the UINT_MAX of the
given platform (for example, 4G on 64-bit ARM), results in a
system error even though this is a legitimate request.

The vshCommandOptScaledInt() used for parsing the pagesize is
given UINT_MAX as the upper limit. The parsed value is then
divided by 1024 and fed to virNodeGetFreePages() which expects an
unsigned int. We can't change the public API but the upper limit
can be raised by the factor of 1024.

Resolves: https://issues.redhat.com/browse/RHEL-23608

Signed-off-by: Adam Julis <ajulis@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoci: refresh with lcitool manifest
Daniel P. Berrangé [Mon, 4 Mar 2024 13:41:43 +0000 (13:41 +0000)]
ci: refresh with lcitool manifest

Picks up the switch from FreeBSD 13.2 to 13.3

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
14 months agotests: Add invalid firmware descriptor
Andrea Bolognani [Thu, 29 Feb 2024 18:34:16 +0000 (19:34 +0100)]
tests: Add invalid firmware descriptor

This is guaranteed to keep failing even after loongarch64
support is introduced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agotests: Add firmware descriptor for edk2 on loongarch64
Andrea Bolognani [Thu, 29 Feb 2024 14:29:23 +0000 (15:29 +0100)]
tests: Add firmware descriptor for edk2 on loongarch64

This fails to be parsed because libvirt doesn't yet know about
the architecture, but thanks to the recent improvements this
is a merely a local failure rather than bringing everything
else down with it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemu: Make firmware parsing failures non-fatal
Andrea Bolognani [Thu, 29 Feb 2024 14:43:45 +0000 (15:43 +0100)]
qemu: Make firmware parsing failures non-fatal

At the moment, any kind of issue being detected in any of the
firmware descriptor files will result in the entire process
being aborted.

In particular, installing a build of edk2 for an architecture
that libvirt doesn't yet know about, for example loongarch64,
will break most firmware-related functionality: it will no
longer be possible to define new EFI VMs, start existing ones,
or even just obtain the domcapabilities for any architecture.

This is obviously unnecessarily harsh. Adopt a more relaxed
approach and simply ignore the firmware descriptors that we
are unable to parse correctly.

https://bugzilla.redhat.com/show_bug.cgi?id=2258946

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemu: Rewrite qemuFirmwareFetchParsedConfigs()
Andrea Bolognani [Thu, 29 Feb 2024 15:16:53 +0000 (16:16 +0100)]
qemu: Rewrite qemuFirmwareFetchParsedConfigs()

Instead of returning the list of paths exactly as obtained
from qemuFirmwareFetchConfigs(), and allocating the list of
firmwares to be exactly that size right away, start with two
empty lists and add elements to them one by one.

At the moment this only makes things more verbose, but later
we're going to change things so that it's possible that some
of the paths/firmwares are not included in the lists returned
to the caller, and at that point the changes will pay off.

Note that we can't use g_auto() for the new list of paths,
because until the very last moment it's not null-terminated,
so g_strfreev() wouldn't be able to handle it correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemu: Add missing early returns
Andrea Bolognani [Thu, 29 Feb 2024 14:40:08 +0000 (15:40 +0100)]
qemu: Add missing early returns

In a couple of cases, we were reporting an error without
actually terminating the parse process.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: newapi: Fix generation of type definition tables
Peter Krempa [Thu, 29 Feb 2024 12:50:09 +0000 (13:50 +0100)]
docs: newapi: Fix generation of type definition tables

Ensure that all rows have 3 columns and avoid generation of emtpy
elements which would be turned by the XML formatter into non-pair td/tr
tags which don't work properly with HTML5 parsers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: newapi: Properly skip ACL entries if empty
Peter Krempa [Thu, 29 Feb 2024 13:22:58 +0000 (14:22 +0100)]
docs: newapi: Properly skip ACL entries if empty

The source document can contain an empty '@flags' attribute which passes
the test but generates an empty element. Check that flags is non-empty
to trigger the fallback.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: newapi: Avoid table where every row has an cell with 'colspan'
Peter Krempa [Thu, 29 Feb 2024 13:11:57 +0000 (14:11 +0100)]
docs: newapi: Avoid table where every row has an cell with 'colspan'

The HTML standard requires that a table column must include at least one
row which defines it exclusively, thus having a table where all rows
unite it via 'colspan' is illegal.

Modify the enum value generator to always output the description field
even when it's empty rather than uniting it, as in case when each value
doesn't have a description the generated document would violate the
standard.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: newapi: Avoid empty <div>s when there is no description
Peter Krempa [Thu, 29 Feb 2024 12:06:39 +0000 (13:06 +0100)]
docs: newapi: Avoid empty <div>s when there is no description

The various objects we generate API for may have empty description in
which case an empty div would be generated when processing the API
description. As we're using XML output mode the generator would shorten
such divs to the non-pair empty element version, which doesn't work well
with HTML5 parsers requiring a pair tag for <div>

Avoid empty description <div> elements altogether by skipping it if the
description is empty.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: newapi: Don't generate empty <div> in template for ACL permissions
Peter Krempa [Thu, 22 Feb 2024 12:29:07 +0000 (13:29 +0100)]
docs: newapi: Don't generate empty <div> in template for ACL permissions

If an API has no ACLs an empty <div class='acl'/> would be generated
which is mis-interpreted by browsers when creating DOM to nest any
subsequent elements under it.

Don't generate the ACL section div unless it will be filled.

Best viewed with 'git show -w'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: index: Fix import of blog planet javascript
Peter Krempa [Thu, 29 Feb 2024 14:47:50 +0000 (15:47 +0100)]
docs: index: Fix import of blog planet javascript

Similarly to previous commit drop the 'type' attribute which is frowned
upon by the HTML standard.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: page: Fix declaration of main javascript source
Peter Krempa [Thu, 29 Feb 2024 12:32:59 +0000 (13:32 +0100)]
docs: page: Fix declaration of main javascript source

Per the w3 html validator a HTML/XML comment is not allowed inside the
<script> tag, use a space instead as it must be a pair tag.

Additionally drop the 'type' attribute as it's not needed (validator
warns about it).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: page: Add 'lang="en"' for all HTML output documents
Peter Krempa [Thu, 29 Feb 2024 12:06:31 +0000 (13:06 +0100)]
docs: page: Add 'lang="en"' for all HTML output documents

Per the w3 HTML validator the 'lang' attribute is suggested.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agodocs: site: Don't generate '<?xml' header for HTML documents
Peter Krempa [Thu, 29 Feb 2024 09:39:29 +0000 (10:39 +0100)]
docs: site: Don't generate '<?xml' header for HTML documents

Skip the XML header as it's invalid with <!DOCTYPE HTML> both for the
RST-generated pages and for the API docs generated from the API XML.

Additionally remove the spurious xsl:output directive from newapi.xsl
which is ignored and thus misleading.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agoPost-release version bump to 10.2.0
Jiri Denemark [Fri, 1 Mar 2024 11:22:04 +0000 (12:22 +0100)]
Post-release version bump to 10.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
14 months agoRelease of libvirt-10.1.0
Jiri Denemark [Fri, 1 Mar 2024 11:19:44 +0000 (12:19 +0100)]
Release of libvirt-10.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
14 months agoFix off-by-one error in udevListInterfacesByStatus
Martin Kletzander [Tue, 27 Feb 2024 15:20:12 +0000 (16:20 +0100)]
Fix off-by-one error in udevListInterfacesByStatus

Ever since this function was introduced in 2012 it could've tried
filling in an extra interface name.  That was made worse in 2019 when
the caller functions started accepting NULL arrays of size 0.

This is assigned CVE-2024-1441.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reported-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Fixes: 5a33366f5c0b18c93d161bd144f9f079de4ac8ca
Fixes: d6064e2759a24e0802f363e3a810dc5a7d7ebb15
Reviewed-by: Ján Tomko <jtomko@redhat.com>
14 months agoNEWS: Update for release
Peter Krempa [Fri, 1 Mar 2024 08:44:30 +0000 (09:44 +0100)]
NEWS: Update for release

Mention improvement of virt-admin, and fixes for the VPD xml and disk
migration port bug.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
14 months agoTranslated using Weblate (Korean)
김인수 [Thu, 29 Feb 2024 14:36:08 +0000 (15:36 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10440 of 10440 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
14 months agoremote_protocol: Fix ACL on REMOTE_PROC_NODE_DEVICE_DEFINE_XML
Boris Fiuczynski [Wed, 28 Feb 2024 18:46:08 +0000 (19:46 +0100)]
remote_protocol: Fix ACL on REMOTE_PROC_NODE_DEVICE_DEFINE_XML

Adding 'save' ACL to REMOTE_PROC_NODE_DEVICE_DEFINE_XML to make
REMOTE_PROC_NODE_DEVICE_UPDATE ACLs meaningful.

Fixes: 69f9e7dbc24657e85761f03574779540d0f18315
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Thu, 29 Feb 2024 08:30:30 +0000 (09:30 +0100)]
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoTranslated using Weblate (Korean)
김인수 [Wed, 28 Feb 2024 13:58:50 +0000 (13:58 +0000)]
Translated using Weblate (Korean)

Currently translated at 99.4% (10386 of 10440 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Signed-off-by: 김인수 <simmon@nplob.com>
14 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 28 Feb 2024 13:55:39 +0000 (14:55 +0100)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10440 of 10440 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
14 months agoTranslated using Weblate (Korean)
Weblate [Wed, 28 Feb 2024 13:55:39 +0000 (14:55 +0100)]
Translated using Weblate (Korean)

Currently translated at 99.4% (10385 of 10440 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: Weblate <noreply-mt-weblate@weblate.org>
Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
14 months agoTranslated using Weblate (Korean)
김인수 [Wed, 28 Feb 2024 13:55:38 +0000 (14:55 +0100)]
Translated using Weblate (Korean)

Currently translated at 99.4% (10385 of 10440 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
14 months agospec: Handle new location of bash-completion .pc file
Cole Robinson [Mon, 19 Feb 2024 16:44:53 +0000 (11:44 -0500)]
spec: Handle new location of bash-completion .pc file

On Fedora 41, bash-completion's .pc file moved to
`bash-completion-devel`.

Using `pkgconfig()` lets us handle this without distro version checks

Signed-off-by: Cole Robinson <crobinso@redhat.com>
14 months agoci: regenerate
Michal Privoznik [Thu, 22 Feb 2024 16:10:59 +0000 (17:10 +0100)]
ci: regenerate

Regenerate the ci files using the latest libvirt-ci:

  commit face9746f9729699ae8525ffac4ee19be82c1ba5
  ci: drop update-alternatives for opensuse tumbleweed

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agoUpdate translation files
Weblate [Mon, 26 Feb 2024 14:03:57 +0000 (15:03 +0100)]
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
14 months agopo: Refresh potfile for v10.1.0
Jiri Denemark [Mon, 26 Feb 2024 14:05:27 +0000 (15:05 +0100)]
po: Refresh potfile for v10.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
14 months agonodedevmdevctltest: Fix two memleaks
Michal Privoznik [Mon, 26 Feb 2024 11:42:09 +0000 (12:42 +0100)]
nodedevmdevctltest: Fix two memleaks

There are two memleaks inside of nodedevmdevctltest:

1) In the testCommandDryRunCallback() - when appending lines to
   stdinbuf the pointer is overwritten without freeing the old
   memory it pointed to.

2) In testMdevctlModify() the livecmd variable is reused and
   since its marked as g_autoptr() the first use leaks.

Fixes: 582f27ff15f14fa0e913278c0a2ca9840c3f12f5
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
14 months agosyntax-check: Validate :since: tags
Andrea Bolognani [Fri, 16 Feb 2024 13:02:49 +0000 (14:02 +0100)]
syntax-check: Validate :since: tags

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Other fixes to :since: tags
Andrea Bolognani [Mon, 19 Feb 2024 10:33:45 +0000 (11:33 +0100)]
docs: Other fixes to :since: tags

Make sure that they're entirely contained within a single line
and that punctuation is used in a way that doesn't make the
resulting HTML look weird.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Rewrite a few awkward sections
Andrea Bolognani [Mon, 19 Feb 2024 10:33:45 +0000 (11:33 +0100)]
docs: Rewrite a few awkward sections

Address several oddities, and bring them in line with the style
used for the vast majority of our documentation. In a couple of
cases, some of the possible values for an attribute were listed
with :since: information matching that off the attribute itself,
making it redundant.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Leave kernel version out of :since:
Andrea Bolognani [Mon, 19 Feb 2024 17:26:08 +0000 (18:26 +0100)]
docs: Leave kernel version out of :since:

Tweak things so that the required kernel version is still
listed, just not as part of the :since: tag.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Fix a few weird :since: tags
Andrea Bolognani [Mon, 19 Feb 2024 18:20:38 +0000 (19:20 +0100)]
docs: Fix a few weird :since: tags

These either mention libvirt explicitly, which is something
that we generally don't do, or lack the word "since", which
makes the resulting HTML awkward.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Don't use "line blocks"
Andrea Bolognani [Mon, 19 Feb 2024 17:14:46 +0000 (18:14 +0100)]
docs: Don't use "line blocks"

It's unclear why the conversion process decided to insert
them, but they don't seem to do much.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Fix list of values
Andrea Bolognani [Mon, 19 Feb 2024 18:59:27 +0000 (19:59 +0100)]
docs: Fix list of values

One of them got chopped up.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Remove unnecessary whitespace
Andrea Bolognani [Mon, 19 Feb 2024 17:04:12 +0000 (18:04 +0100)]
docs: Remove unnecessary whitespace

It slipped in during the conversion to reStructuredText.

In one case, part of the preformatted text shouldn't have been
marked as such, so that's addressed too. A spurious opening
parenthesis is dropped as well.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodocs: Format lists of files better
Andrea Bolognani [Mon, 19 Feb 2024 10:39:28 +0000 (11:39 +0100)]
docs: Format lists of files better

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoci: cirrus: Use --break-system-packages with 'pip install'
Peter Krempa [Mon, 26 Feb 2024 10:25:09 +0000 (11:25 +0100)]
ci: cirrus: Use --break-system-packages with 'pip install'

Cirrus tests on macos started to fail when installing 'pytest'. Override
the pip lock.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
14 months agonodedev: allow modify on define of a persistent node device
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:09 +0000 (14:02 +0100)]
nodedev: allow modify on define of a persistent node device

Allow to modify a node device by using virNodeDeviceDefineXML() to align
its behavior with other drivers define methods.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agovirsh: add nodedev-update
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:08 +0000 (14:02 +0100)]
virsh: add nodedev-update

Add ability to update node devices.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agonodedev: Implement virNodeDeviceUpdate
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:07 +0000 (14:02 +0100)]
nodedev: Implement virNodeDeviceUpdate

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 1.3.0 in the spec
file to ensure support exists in mdevctl the support is dynamically
checked before using mdevctl.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoapi: add virNodeDeviceUpdate()
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:06 +0000 (14:02 +0100)]
api: add virNodeDeviceUpdate()

A public API method which allows to update or modify objects is
implemented for almost all other objects that have a concept of
persistent definition and activatability. Currently node devices of type
mdev can be persistent and active. This new method allows to update
defined and active node devices as well.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agovirsh: doc fix on nodedev-list
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:05 +0000 (14:02 +0100)]
virsh: doc fix on nodedev-list

Commit 26136e3 allowed to use option all with option tree but did not
update the manpage.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agotools: add switches persistent and transient to nodedev-list
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:04 +0000 (14:02 +0100)]
tools: add switches persistent and transient to nodedev-list

Now that we can filter persistent and transient node devices in
virConnectListAllNodeDevices(), add these switches also to the
virsh nodedev-list command.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agonodedev: add persistent and transient filter on list
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:03 +0000 (14:02 +0100)]
nodedev: add persistent and transient filter on list

Allow to filter node devices based on their persistent or transient
states.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agotools: add option inactive to nodedev-dumpxml
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:02 +0000 (14:02 +0100)]
tools: add option inactive to nodedev-dumpxml

Allow to dump the XML of the persistent mdev when the mdev has been
started instead of the current state only.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agonodedev: add an active config to mdev
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:01 +0000 (14:02 +0100)]
nodedev: add an active config to mdev

The configuration of a defined mdev can be modified after the mdev is
started. The defined configuration and the active configuration can
therefore run out of sync. Handle this by storing the modifiable data
which is the mdev type and attributes in two separate active and
defined configurations. mdevctl supports with callout scripts to do an
attribute retrieval of started mdevs which is already implemented in
libvirt.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agonode_device: remove unnecessary checks in virNodeDeviceDefFormat
Boris Fiuczynski [Thu, 22 Feb 2024 13:02:00 +0000 (14:02 +0100)]
node_device: remove unnecessary checks in virNodeDeviceDefFormat

virBufferEscapeString already contains the null check.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agonode_device: refactor mdev attributes handling
Boris Fiuczynski [Thu, 22 Feb 2024 13:01:59 +0000 (14:01 +0100)]
node_device: refactor mdev attributes handling

Refactor attribute handling code into methods for easier reuse.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agovirmdev: prepare type and attributes for dual state
Boris Fiuczynski [Thu, 22 Feb 2024 13:01:58 +0000 (14:01 +0100)]
virmdev: prepare type and attributes for dual state

Create a new structure holding type and attributes as these are
modifiable in a persistent mdev configuration and run out of sync with
the active mdev configuration.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agodaemon: fix wrong request count for sparse stream
Vincent Vanlaer [Mon, 19 Feb 2024 22:24:02 +0000 (23:24 +0100)]
daemon: fix wrong request count for sparse stream

Similar to when actual data is being written to the stream, it is
necessary to acknowledge handling of the client request when a hole is
encountered. This is done later in daemonStreamHandleWrite by sending a
fake zero-length reply if the status variable is set to
VIR_STREAM_CONTINUE. It seems that setting status from the message
header was missed for holes in the introduction of the sparse stream
feature.

Signed-off-by: Vincent Vanlaer <libvirt-e6954efa@volkihar.be>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuxmlconftest: Introduce memory-hotplug-nvdimm-overlap test case
Michal Privoznik [Tue, 20 Feb 2024 15:28:55 +0000 (16:28 +0100)]
qemuxmlconftest: Introduce memory-hotplug-nvdimm-overlap test case

This new test case checks whether we are handling NVDIMMs
correctly when checking for overlapping memory devices (see
previous commit). Without previous commit, this test case would
fail, yet it was produced in real life (at least the NVDIMM
part) and thus it is valid.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
14 months agodomain_validate: Account for NVDIMM label size properly when checking for memory...
Michal Privoznik [Mon, 19 Feb 2024 14:37:16 +0000 (15:37 +0100)]
domain_validate: Account for NVDIMM label size properly when checking for memory conflicts

As of v9.8.0-rc1~7 we check whether two <memory/> devices don't
overlap (since we allow setting where a <memory/> device should
be mapped to). We do this pretty straightforward, by comparing
start and end address of each <memory/> device combination.
But since only the start address is given (an exposed in the
XML), the end address is computed trivially as:

  start + mem->size * 1024

And for majority of memory device types this works. Except for
NVDIMMs. For them the <memory/> device consists of two separate
regions: 1) actual memory device, and 2) label.

Label is where NVDIMM stores some additional information like
namespaces partition and so on. But it's not mapped into the
guest the same way as actual memory device. In fact, mem->size is
a sum of both actual memory device and label sizes. And to make
things a bit worse, both sizes are subject to alignment (either
the alignsize value specified in XML, or system page size if not
specified in XML).

Therefore, to get the size of actual memory device we need to
take mem->size and substract label size rounded up to alignment.

If we don't do this we report there's an overlap between two
NVDIMMs even when in reality there's none.

Fixes: 3fd64fb0e236fc80ffa2cc977c0d471f11fc39bf
Fixes: 91f9a9fb4fc0d34ed8d7a869de3d9f87687c3618
Resolves: https://issues.redhat.com/browse/RHEL-4452?focusedId=23805174#comment-23805174
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
14 months agovirfile: Switch to virReportSystemError after failed VIR_CLOSE()
Adam Julis [Thu, 22 Feb 2024 09:14:35 +0000 (10:14 +0100)]
virfile: Switch to virReportSystemError after failed VIR_CLOSE()

VIR_CLOSE() sets errno on failure so it's better to use
virReportSystemError() than plain virReportError() as the former
reports errno value too.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemu: Fix guest-sync response time in qga command
ray [Wed, 21 Feb 2024 14:45:36 +0000 (06:45 -0800)]
qemu: Fix guest-sync response time in qga command

The current implementation sets the guest-sync timeout to the
smaller value between the default value (QEMU_AGENT_WAIT_TIME)
and agent->timeout, without considering the timeout passed
via the qga command.

This patch enhances the guest-sync timeout logic to use the
minimum value among the default value, agent->timeout, and
the timeout passed via the qga command.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/590
Signed-off-by: ray <honglei.wang@smartx.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Annotate that existance of 'volume' disks is checked...
Peter Krempa [Mon, 19 Feb 2024 13:18:19 +0000 (14:18 +0100)]
qemuMigrationDstPrepareStorage: Annotate that existance of 'volume' disks is checked elswhere

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Move assumption that 'network' disks always exist
Peter Krempa [Mon, 19 Feb 2024 13:16:19 +0000 (14:16 +0100)]
qemuMigrationDstPrepareStorage: Move assumption that 'network' disks always exist

Move the assumption from the code pre-creating the storage to
qemuMigrationDstPrepareStorage where it's checked for other cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Reject migration into 'dir' and 'vhost-user' types
Peter Krempa [Mon, 19 Feb 2024 12:53:26 +0000 (13:53 +0100)]
qemuMigrationDstPrepareStorage: Reject migration into 'dir' and 'vhost-user' types

Migrating into a 'directory' won't ever work as we ask qemu to emulate a
fat filesystem, so restoring of the files won't be possible. Same for
'vhost-user' disks which don't support blockjobs as there's no block
backend used in qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Rework storage existence check
Peter Krempa [Mon, 19 Feb 2024 12:47:55 +0000 (13:47 +0100)]
qemuMigrationDstPrepareStorage: Rework storage existence check

Check the existance of storage per-type rather than trying to come up
with a common "path".

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Move block device specific logic
Peter Krempa [Fri, 16 Feb 2024 15:31:45 +0000 (16:31 +0100)]
qemuMigrationDstPrepareStorage: Move block device specific logic

Now that we have a switch statement, the code adding the 'slice' for
block devices of non-equal sizes can be moved to appropriate location.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrecreateDisk: Refactor cleanup
Peter Krempa [Thu, 8 Feb 2024 15:48:17 +0000 (16:48 +0100)]
qemuMigrationDstPrecreateDisk: Refactor cleanup

Automatically free helper variables, remove the 'cleanup' label and
use virBufferCurrentContent() to take the XML from the buffer rather
than extracting it to a separate variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Properly consider path for 'vdpa' devices
Peter Krempa [Fri, 16 Feb 2024 15:40:20 +0000 (16:40 +0100)]
qemuMigrationDstPrepareStorage: Properly consider path for 'vdpa' devices

Allow storage migration of VDPA devices by properly checking that they
exist on the destionation. Pre-creation is not supported but if the
device exists the migration should be able to succeed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoqemuMigrationDstPrepareStorage: Use 'switch' statement to include all storage types
Peter Krempa [Thu, 8 Feb 2024 15:48:25 +0000 (16:48 +0100)]
qemuMigrationDstPrepareStorage: Use 'switch' statement to include all storage types

Decrease the likelyhood that addition of a new storage type will be
forgotten.

This patch also unifies the type check to consult the 'actual' type of
the storage in both cases as the NVMe check looked for the XML declared
type while virStorageSourceIsLocalStorage() looks for the
actual/translated type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agocpu_map: Rewrite feature sync script
Tim Wiederhake [Thu, 1 Feb 2024 20:51:01 +0000 (21:51 +0100)]
cpu_map: Rewrite feature sync script

Previously, the script would only detect differences between
libvirt's and qemu's list of x86 features, adding those features
to libvirt was a manual and error prone procedure.

Replace with a script that can generate libvirt's feature list
directly from qemu source code.

Usage: sync_qemu_features_i386.py [--output OUTPUT] [qemu]

If not specified otherwise, "output" defaults to x86_features.xml
in the same directory as sync_qemu_features_i386.py. If a checkout
of the qemu source code resides next to the libvirt directory, it
will be found automatically and need not be specified.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
14 months agocpu_map: Format comments
Tim Wiederhake [Thu, 1 Feb 2024 21:40:53 +0000 (22:40 +0100)]
cpu_map: Format comments

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
14 months agocpu_map: Format register values
Tim Wiederhake [Thu, 1 Feb 2024 21:36:30 +0000 (22:36 +0100)]
cpu_map: Format register values

Use "0x%08x" as format for all values:

    sed \
        -e "s/'0x\(..\)'/'0x000000\\1'/g" \
        -e "s/'0x\(...\)'/'0x00000\\1'/g"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
14 months agocpu_map: Sort cpu features
Tim Wiederhake [Thu, 1 Feb 2024 21:03:49 +0000 (22:03 +0100)]
cpu_map: Sort cpu features

Some feature words were not sorted correctly.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
14 months agoSet stubDriverName from hostdev driver model attribute during pci device setup
Laine Stump [Fri, 16 Feb 2024 17:43:59 +0000 (12:43 -0500)]
Set stubDriverName from hostdev driver model attribute during pci device setup

commit v9.10.0-129-g8b93d78c83 (first appearing in libvirt-10.0.0) was
supposed to allow forcing a PCI hostdev to be bound to a particular
driver by adding <driver model='blah'/> to the XML for the
device. Unfortunately, a single line was missed during the final
changes to the patch prior to pushing, and the result was that the
driver model could be set to *anything* and it would be accepted but
just ignored.

This patch adds the missing line, which will set the stubDriverName
field of the virPCIDevice object from the hostdev object as the
virPCIDevice is being created. This ends up being used by
virPCIDeviceBindToStub() as the driver that it binds the device to.

Fixes: 8b93d78c8325f1fba5db98848350f3db43f5e7d5
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 19 Feb 2024 15:01:11 +0000 (16:01 +0100)]
Translated using Weblate (Swedish)

Currently translated at 69.7% (7283 of 10447 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Translated using Weblate (Swedish)

Currently translated at 69.5% (7262 of 10447 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Translated using Weblate (Swedish)

Currently translated at 68.9% (7202 of 10447 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
14 months agovirsh-completer: modify and fix bug in virshPoolTypeCompleter, now used for more...
Adam Julis [Tue, 20 Feb 2024 09:31:34 +0000 (10:31 +0100)]
virsh-completer: modify and fix bug in virshPoolTypeCompleter, now used for more commands

Signed-off-by: Adam Julis <ajulis@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agobuild: Let users know not all tests might run
Martin Kletzander [Mon, 19 Feb 2024 09:23:35 +0000 (10:23 +0100)]
build: Let users know not all tests might run

We warned users before the meson times, so do like an S Club 7 and bring
it all back.

Add the information into a new section of the summary, because even
though using `warning()` looks better, it scrolls on by once the summary
is printed.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
14 months agobuild: Split optional programs into test and rest
Martin Kletzander [Mon, 19 Feb 2024 09:23:27 +0000 (10:23 +0100)]
build: Split optional programs into test and rest

To be used in the following commit.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agoNEWS: Announce support for /dev/userfaultfd
Jiri Denemark [Mon, 19 Feb 2024 10:36:36 +0000 (11:36 +0100)]
NEWS: Announce support for /dev/userfaultfd

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14 months agosyntax-check: Drop 'syntax-check' target
Andrea Bolognani [Fri, 16 Feb 2024 14:03:19 +0000 (15:03 +0100)]
syntax-check: Drop 'syntax-check' target

Our entry point for syntax-check rules is meson, which calls
to each of them specifically; additionally, we have the 'all'
target that warns users who try to use make directly.

The 'syntax-check' target is not used by anything, and in fact
it couldn't be even if one tried: its availability depends on
the $(_gl-Makefile) variable, which in our case is never
defined.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
14 months agosyntax-check: Sync with gnulib
Andrea Bolognani [Fri, 16 Feb 2024 14:09:45 +0000 (15:09 +0100)]
syntax-check: Sync with gnulib

The most notable change is the new 'sc_unportable_grep_q' rule.

While importing it from gnulib, the rule has been tweaked
slightly by adding superflous quotes so that syntax-check.mk
itself doesn't trip it. This is similar to the tricks employed
for the 'sc_prohibit_close' and 'sc_copyright_usage' rules,
among many others.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>