Commit Graph

51336 Commits

Author SHA1 Message Date
Jiri Denemark
fff2bbee7f domain_capabilities: Report canonical names of CPU models
Some models are just aliases to other models. Make this relation
available to users via domain capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
ca0ea085d7 cpu: Introduce virCPUGetCanonicalModel
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
cb6463d803 cpu_x86: Record relations between CPU models
Record a fact a specific CPU model was derived from another one. The
original model is also marked as an alias of the new one in case it did
not change any properties of the original CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
a410f0256a sync_qemu_models_i386: Copy signatures from base model
The signatures in the CPU map are used for matching physical CPUs and
thus we need to cover all possible real world variants we know about.
When adding a new version of an existing CPU model, we should copy the
signature(s) of the existing model rather than replacing it with the
signature that QEMU uses.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
7133d72eff sync_qemu_models_i386: Update index.xml
Add all newly generated CPU models to the appropriate section of
index.xml.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
e2e7602a22 cpu_map: Properly group models in index.xml
We already visually group the included models using comments. This patch
introduces a new <group name='...'> element for doing it properly in a
machine friendly way.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
3bb2c2b641 sync_qemu_models_i386: Switch to lxml
XMLs parse/format round trip using lxml results in an XML document that
almost exactly matches the original (including comments).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
19cfe21d4e sync_qemu_models_i386: Store extra info in a separate file
We don't really need or want the extra info to be included in the CPU
model definitions in git, it's mostly useful for verifying the output of
the script. Let's store it in a separate file rather than in a comment
block of the CPU model definition itself.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
db127963d5 sync_qemu_models_i386: Add support for versioned CPU models
Each CPU model with -v* suffix is defined as a standalone model copying
all attributes of the previous version. CPU model versions with an alias
are handled differently. The full definition is used for the alias and
the versioned model is created as an identical copy of the alias.

To avoid breaking migration compatibility of host-model CPUs all
versioned models are marked with <decode guest='off'/> so that they are
ignored when selecting candidates for host-model. It's not ideal but not
doing so would break almost all host-model CPUs as the new versioned CPU
models have all vmx-* features included since their introduction while
existing CPU models were updated later. This meas existing models would
be accompanied with a long list of vmx-* features to properly describe a
host CPU while the newly added CPU models would have those features
enabled implicitly and their list of features would be significantly
shorter. Thus the new models would always be better candidates for
host-model than the existing models.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:34 +01:00
Jiri Denemark
515568071d sync_qemu_models_i386: Do not require full path to QEMU's cpu.c
While the script for synchronizing CPU features expects a path to QEMU
source tree, this CPU model script insisted on getting a full patch to
cpu.c file, even though it could easily deduce it from the path to QEMU
source tree.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Jiri Denemark
233afc3c58 sync_qemu_models_i386: Do not overwrite existing models
We don't change definitions of CPU models which were already included in
a libvirt release to maintain migration compatibility. Thus the script
can just skip existing models and save us from having to drop the
changes it would do to them.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Jiri Denemark
c16e7f231f sync_qemu_models_i386: Use f-strings
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Jiri Denemark
ba1652e84a sync_qemu_features_i386: Add some removed features back
When removing features unknown to QEMU (they have a different name or
are completely missing as they are not configurable by a user) I should
not have removed them from the list of features unknown to QEMU in the
script for synchronizing QEMU features to the CPU map.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Jiri Denemark
88e7cc1477 cpu_x86: Promote added/removed from ancestor
When a CPU model is defined based on another model, we were completely
ignoring features marked as added to or removed from the original model
after it was released. For added features this is the right thing to do
as it will promote them to become normal features included in the new
model. But features marked as removed would become included in the new
model as well. We need to explicitly remove them as if they were never
included in the model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Jiri Denemark
61dd5d6bef cpu_x86: Annotate virCPUx86Model fields
Document which fields are inherited when a CPU model is based on another
model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:33 +01:00
Göran Uddeborg
6aed4360e5 Translated using Weblate (Swedish)
Currently translated at 97.9% (10305 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:04 +01:00
Göran Uddeborg
d1b9899905 Translated using Weblate (Swedish)
Currently translated at 97.7% (10285 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:04 +01:00
Weblate
5391f29008 Translated using Weblate (Swedish)
Currently translated at 97.4% (10259 of 10526 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2024-11-25 23:22:04 +01:00
Göran Uddeborg
ec66ac0d2d Translated using Weblate (Swedish)
Currently translated at 97.4% (10259 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:04 +01:00
Weblate
7117291513 Translated using Weblate (Swedish)
Currently translated at 97.2% (10235 of 10526 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2024-11-25 23:22:04 +01:00
Göran Uddeborg
ec11cf12fe Translated using Weblate (Swedish)
Currently translated at 97.2% (10235 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:04 +01:00
Weblate
86189ac148 Translated using Weblate (Swedish)
Currently translated at 97.1% (10224 of 10526 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2024-11-25 23:22:04 +01:00
Göran Uddeborg
68cfeab9ea Translated using Weblate (Swedish)
Currently translated at 97.1% (10224 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:04 +01:00
Weblate
03b4129b25 Translated using Weblate (Georgian)
Currently translated at 4.3% (459 of 10526 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2024-11-25 23:22:04 +01:00
Léane GRASSER
1d040e0315 Translated using Weblate (French)
Currently translated at 95.9% (10098 of 10526 strings)

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

Signed-off-by: Léane GRASSER <leane.grasser@proton.me>
2024-11-25 23:22:03 +01:00
Göran Uddeborg
fe730c0861 Translated using Weblate (Swedish)
Currently translated at 96.9% (10205 of 10526 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-11-25 23:22:03 +01:00
jianqing yan
806884cd58 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 95.7% (10074 of 10526 strings)

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

Co-authored-by: jianqing yan <yanjianqing@kylinos.cn>
Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2024-11-25 23:22:03 +01:00
Weblate
ab5f29ab46 Translated using Weblate (Swedish)
Currently translated at 96.8% (10199 of 10526 strings)

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

Co-authored-by: Weblate <noreply-mt-weblate@weblate.org>
Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2024-11-25 23:22:03 +01:00
Göran Uddeborg
4268bdc0d6 Translated using Weblate (Swedish)
Currently translated at 96.8% (10199 of 10526 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>
2024-11-25 23:22:03 +01:00
Nikolai Barybin
e9b8be23f7 qemuxmlconftest: Add test cases for the <dataStore> feature
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
4801729abc qemuxmlactivetest: Add tests for <dataStore>
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
4281362a96 tests: virstoragetest: Add tests for detection of qcow2 'data_file' feature
Add two test images showing the use of 'data_file' and 'data_file_raw'
(although the latter is not detected by libvirt) so that we can see that
the qcow2 metadata parser and backing chain populators work correctly.

The example files were created by:

 qemu-img create  -f qcow2 -o data_file=raw,data_file_raw=true,preallocation=off datafile.qcow2 1k
 qemu-img create  -f qcow2 -o data_file=rawpreallocation=off -F qcow2 -b datafile.qcow2 qcow2datafile-datafile.qcow2

Note that 'data_file_raw' is mutually exclusive with backing images.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
59b1408860 qemu: block: Add support for 'data-file' feature of qcow2
Add the block infrastructure for detecting and landling the data file
for images and starting qemu with the configuration.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
cb5371a8bd qemu: factor out qemuDomainPrepareStorageSource()
This refactoring will simplify next changes.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
9ba2bef816 qemu: put data-file path to VM's cgroup and namespace
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
702f8b5a77 security: apparmor: handle qcow2 data-file
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
8fcc6c8025 security: selinux: handle qcow2 data-file on image label set/restore
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
724a4c6dc4 security: DAC: handle qcow2 data-file on image label set/restore
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
0a3d177d9b storage file: fill in src->dataFileStore during file probe
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
63481eca80 storage file: add qcow2 data-file path parsing from header
In qcow2 header data file is represented by incompitible feature bit
and its path is saved to header extension table.
Thus, we implement here the logic similar to backing file probing.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
8799818036 storage file: add getDataFile function to FileTypeInfo
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:18 +01:00
Nikolai Barybin
b3171cf8da conf: implement XML parsing/formating for <dataStore> element of a storage <source>
Introduce parsing and formatting of <dataStore> element. The <dataStore
represents a different storage volume meant for storing the actual
blocks of guest-visible data. The original disk source is then just a
metadata storage for any advanced features.

This currently works only for 'qcow2' images.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 22:31:13 +01:00
Nikolai Barybin
28d88e9fc3 Add schema and documentation for 'dataStore' sub-element of disk source
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 20:28:15 +01:00
Nikolai Barybin
64627d5645 conf: add data-file feature and related fields to virStorageSource
The 'data-file' is a qcow2 feature which allows storing the actual data
outside of the qcow2 image.

Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-25 20:28:15 +01:00
Han Han
2cb6cb05d4 docs: formatsecret: Fix an example of secret-set-value
The previous example will cause the error like:
error: Options --file and --base64 are mutually exclusive

Reported-by: Yanqiu Zhang <yanqzhan@redhat.com>
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-25 10:38:40 +01:00
shenjiatong
c54df8ed9e QEMU: allow to hot plugging virtio-serial-pci device
Virtio-serial-pci device is hot pluggable, loosen the restriction
and allow user to hot plug it.

Signed-off-by: shenjiatong <yshxxsjt715@163.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-21 16:24:27 +01:00
Peter Krempa
a86b429046 tests: qemucapabilitiesdata: Update 'x86_64' capabilities for the qemu-9.2 dev cycle
Update to v9.2.0-rc0-42-g3428a3894c

Apart from the changes below there are changes to CPU features reported
by qemu, some of which were reported multiple times previously which no
longer happens.

Notable changes:
 - 'reconnect-ms' added and 'reconnect' deprecated for 'stream' variant
   of 'netdev-add' backend
 - 'BLOCK_IO_ERROR' event removed 'qom-path' parameter
 - 'GraniteRapids-v2-x86_64-cpu' added
 - 'sm3' hashing algorithm for 'luks' added
 - 'acpi-generic-port' object added
 - deprecated field 'loaded' of 'secret'/'secret_keyring'/'tls-creds*'
   removed
 - 'sh4eb' target added
 - 'query-migrationthreads' command deprecated
 - 'busnr' and 'x-pcie-ext-tag' attributes added for
    'ICH9-LPC'/'PIIX4_PM'/'VGA'/'mch'/'pcie-root-port'/'qxl'/'vfio-pci'/
    'virtio-*'/'vmware-svga'
    devices
 - 'stale-tm' property added for 'intel-iommu' device

Experimental features:
 - 'device-sync-config' command added

As the addition of the 'reconnect-ms' property of the 'stream' network
backend happened along with deprecation of the 'reconnect' field which
was already in use by libvirt this patch also captures the change to the
new format.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-19 13:06:02 +01:00
Peter Krempa
e4d058866e qemu: passt: Use 'reconnect-ms' instead of 'reconnect' with new qemus
The 'reconnect' field of 'stream' network backend type is about to be
deprecated so libvirt will need to start using 'reconnect-ms'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-19 13:06:02 +01:00
Peter Krempa
9e273db203 qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT_MILISECONDS
The 'stream' type for 'netdev-add' recently added support for
'reconnect-ms' which supersedes 'reconnect' (now deprecated). Add a
capability which will allow us to switch to the new property.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-19 13:06:02 +01:00
Peter Krempa
25f1fc8568 qemu: capabilities: Restore grouping in 'virQEMUCapsQMPSchemaQueries'
Historically the QMP schema lookup queries were grouped by the first
component of the query (which was also sorted), but not fully sorted.
This deteriorated over time. Re-group the query strings now that some
were added at the bottom.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-19 13:06:02 +01:00