1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-14 12:58:33 +03:00

Compare commits

..

794 Commits

Author SHA1 Message Date
Stefan Berger
b9f54f8792 docs: Clarify what source and name attributes of TPM profile describe
Clarify what source and name attributes of TPM profile describe and
update the version placeholder to the libvirt version when profiles
were first supported, v10.10. Also mention that profiles with prefix
'custom:' in their name can be modified.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-03-14 09:16:01 +01:00
Michal Privoznik
eb6c28408d ch: Rework virCHProcessConnectMonitor()
Firstly, let's switch from explicit virCHDriverGetConfig() +
virObjectUnref() combo to g_autoptr(virCHDriverConfig). This
leaves us with the @monitor variable which is initialized to NULL
only to be then set to the retval of virCHMonitorNew() and
returned instantly. Well, the variable is now useless and can be
dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Michal Privoznik
5ed2ed8708 ch: Unref @cfg in virCHProcessStop()
At the beginning of virCHProcessStop() the ref to driver config
is obtained (via virCHDriverGetConfig()), but corresponding unref
call is lacking. Use g_autoptr() to make sure the config is
unrefed always.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Michal Privoznik
b9a10cf4bb ch: Free @iothreads array in virCHProcessSetupIOThreads()
When the CH driver starts a domain virCHProcessSetupIOThreads()
is called eventually which in turn calls
virCHMonitorGetIOThreads(). The latter returns an array of
iothreads which is never freed leading to a memleak:

130 (104 direct, 26 indirect) bytes in 1 blocks are definitely lost in loss record 1,804 of 1,998
   at 0x484CEF3: calloc (vg_replace_malloc.c:1675)
   by 0x4F0E7A9: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.8000.5)
   by 0xB3A9359: virCHMonitorGetIOThreads (ch_monitor.c:1183)
   by 0xB3AA5BB: virCHProcessSetupIOThreads (ch_process.c:348)
   by 0xB3AAC59: virCHProcessSetup (ch_process.c:480)
   by 0xB3AC75A: virCHProcessStart (ch_process.c:973)
   by 0xB39B7D4: chDomainCreateXML (ch_driver.c:246)
   by 0x4CC9D32: virDomainCreateXML (libvirt-domain.c:188)
   by 0x168F91: remoteDispatchDomainCreateXML (remote_daemon_dispatch_stubs.h:5186)
   by 0x168F18: remoteDispatchDomainCreateXMLHelper (remote_daemon_dispatch_stubs.h:5167)
   by 0x4B20066: virNetServerProgramDispatchCall (virnetserverprogram.c:423)
   by 0x4B1FB99: virNetServerProgramDispatch (virnetserverprogram.c:299)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Michal Privoznik
1b25f1e53b ch: Don't leak virCHDomainObjPrivate struct members
There are some members of the virCHDomainObjPrivate struct that
are allocated at various stages of domain lifecycle but then are
never freed:

1) cgroup - allocated in virDomainCgroupSetupCgroup()
2) autoCpuset - this one is actually never allocated (and thus is
                always NULL, but soon it may be used. Just free
                it for now, which is a NOP anyways.
3) autoNodeset - same story as 2).

There are two more members, which shouldn't be freed:

1) driver - this is just a raw pointer to the CH driver (see
   virCHDomainObjPrivateAlloc()).

2) monitor - this member is cleared in virCHProcessStop(), way
             before control even gets to
             virCHDomainObjPrivateFree().

452 (400 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 1,944 of 1,998
   at 0x484CEF3: calloc (vg_replace_malloc.c:1675)
   by 0x4F0E7A9: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.8000.5)
   by 0x49479CE: virCgroupNewFromParent (vircgroup.c:893)
   by 0x49481BA: virCgroupNewDomainPartition (vircgroup.c:1068)
   by 0x494915E: virCgroupNewMachineManual (vircgroup.c:1378)
   by 0x49492FE: virCgroupNewMachine (vircgroup.c:1432)
   by 0x4B5E3DE: virDomainCgroupInitCgroup (domain_cgroup.c:377)
   by 0x4B5E9CD: virDomainCgroupSetupCgroup (domain_cgroup.c:524)
   by 0xB3AC693: virCHProcessStart (ch_process.c:951)
   by 0xB39B7D4: chDomainCreateXML (ch_driver.c:246)
   by 0x4CC9D32: virDomainCreateXML (libvirt-domain.c:188)
   by 0x168F91: remoteDispatchDomainCreateXML (remote_daemon_dispatch_stubs.h:5186)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Michal Privoznik
9da8db464a ch: Free retval of curl_slist_append()
There are two places where curl_slist_append() is called but
corresponding call to curl_slist_free_all() is missing:
virCHMonitorPutNoContent() and virCHMonitorGet() which leads to
memleaks:

41 (16 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 992 of 1,998
   at 0x4845888: malloc (vg_replace_malloc.c:446)
   by 0x5B2F8FE: curl_slist_append (in /usr/lib64/libcurl.so.4.8.0)
   by 0xB3A7B41: virCHMonitorPutNoContent (ch_monitor.c:824)
   by 0xB3A89FF: virCHMonitorBootVM (ch_monitor.c:1030)
   by 0xB3AC6F1: virCHProcessStart (ch_process.c:967)
   by 0xB39B7D4: chDomainCreateXML (ch_driver.c:246)
   by 0x4CC9D32: virDomainCreateXML (libvirt-domain.c:188)
   by 0x168F91: remoteDispatchDomainCreateXML (remote_daemon_dispatch_stubs.h:5186)
   by 0x168F18: remoteDispatchDomainCreateXMLHelper (remote_daemon_dispatch_stubs.h:5167)
   by 0x4B20066: virNetServerProgramDispatchCall (virnetserverprogram.c:423)
   by 0x4B1FB99: virNetServerProgramDispatch (virnetserverprogram.c:299)
   by 0x4B28B5E: virNetServerProcessMsg (virnetserver.c:135)

88 (16 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 1,501 of 1,998
   at 0x4845888: malloc (vg_replace_malloc.c:446)
   by 0x5B2F8FE: curl_slist_append (in /usr/lib64/libcurl.so.4.8.0)
   by 0xB3A7E41: virCHMonitorGet (ch_monitor.c:864)
   by 0xB3A92E2: virCHMonitorGetInfo (ch_monitor.c:1157)
   by 0xB3A9CEA: virCHProcessUpdateInfo (ch_process.c:142)
   by 0xB3AAD36: virCHProcessSetup (ch_process.c:492)
   by 0xB3AC75A: virCHProcessStart (ch_process.c:973)
   by 0xB39B7D4: chDomainCreateXML (ch_driver.c:246)
   by 0x4CC9D32: virDomainCreateXML (libvirt-domain.c:188)
   by 0x168F91: remoteDispatchDomainCreateXML (remote_daemon_dispatch_stubs.h:5186)
   by 0x168F18: remoteDispatchDomainCreateXMLHelper (remote_daemon_dispatch_stubs.h:5167)
   by 0x4B20066: virNetServerProgramDispatchCall (virnetserverprogram.c:423)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Michal Privoznik
8701ba4feb network: Free inhibitor in networkStateCleanup()
The shutdown inhibitor is created in networkStateInitialize() but
corresponding call to virInhibitorFree() is missing in
networkStateCleanup() leading to a memleak:

116 (72 direct, 44 indirect) bytes in 1 blocks are definitely lost in loss record 1,769 of 1,998
   at 0x484CEF3: calloc (vg_replace_malloc.c:1675)
   by 0x4F0E7A9: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.8000.5)
   by 0x4993B9B: virInhibitorNew (virinhibitor.c:152)
   by 0x5279394: networkStateInitialize (bridge_driver.c:654)
   by 0x4CC74DC: virStateInitialize (libvirt.c:665)
   by 0x15B719: daemonRunStateInit (remote_daemon.c:613)
   by 0x49F2B44: virThreadHelper (virthread.c:256)
   by 0x5356662: start_thread (in /usr/lib64/libc.so.6)
   by 0x53D7DA3: clone (in /usr/lib64/libc.so.6)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-13 15:51:15 +01:00
Peter Krempa
4f1e9d02ea qemu: capabilites: Retire QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING
The capability is no logner used as all qemus support it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
e5d7a871c5 qemu: migration: Always assume support for QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING
The 'transform' attribute of 'bitmaps' was added in qemu-6.0, thus
we can assume all qemus we're willing to use support it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
eb27abb415 qemu: domain: Remove qemuDomainSupportsCheckpointsBlockjobs
The function now serves no real purpose.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
e1bce4ecd2 qemu: capabilites: Retire QEMU_CAPS_INCREMENTAL_BACKUP
All supported qemu versions now support this. Retire the capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
0b939c467a qemu: Always assume support for QEMU_CAPS_INCREMENTAL_BACKUP
The support for incremental backup (not the backup api itself) was gated
on support for migrating bitmaps. As the ability to migrate bitmaps was
added in qemu-6.0 we can now assume that all supported qemu versions
support incremental backup.

Remove the interlocking.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
e6815547c8 qemu: capabilities: Retire QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY
All supported qemus have this and we already deleted alternate code.
Retire the feature flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
2f4e76a770 qemu: Always assume support for QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY
qemu supports the @allow-write-only-overlay feature since qemu-5.0.
Remove the alternate code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
514c1f8dda qemu: capabilities: Retire QEMU_CAPS_BLOCKDEV_REOPEN
'blockdev-reopen' is supported since qemu-6.1. Since we now don't have
any code using this capability we can retire it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
4983cb62e6 qemu: Always assume support for QEMU_CAPS_BLOCKDEV_REOPEN
'blockdev-reopen' is supported since qemu-6.1, thus we can now remove
the interlocks.

Document the change to 'mirror' as this patch removes the last clue why
we overwrite the mirror's readonly state to false unconditionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
5ec6318c05 qemu: capabilities: Retire QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT
The capability is no longer used as all qemus already support the
feature.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
a8ac578419 qemu: monitor: Always assume support for QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT
The flat mode of 'query-named-block-nodes' is supported since qemu-5.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
52ec7929b0 qemu: capabilities: Retire QEMU_CAPS_OBJECT_JSON
Now that we dropped support for old qemus which didn't support JSON
props for -object we can retire the capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
f46e2bf3b0 util: Drop 'virQEMUBuildCommandLineJSONArrayBitmap'
It was used to convert JSON arrays in legacy -object commandline
conversion. Since we now exclusively use JSON with -object, this
infrastructure is no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
af227c6ab0 qemu: monitor: Drop support for extra wrapper for 'object_add'
The QAPIfication of objects removed the extra wrapper object which we
were adding in the monitor code to simplify the other callers.

Now that we support only qemus which don't require this we can drop the
support code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
51f7b35612 qemuBuildObjectCommandlineFromJSON: Assume all qemus support QEMU_CAPS_OBJECT_JSON
'-object' was qapified (meaning it supports JSON props) in qemu-6.0,
thus now that we require qemu-6.2 we can drop the compatibility code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
554a5e508a qemu: capabilities: Retire QEMU_CAPS_COMPAT_DEPRECATED
The capability always exists in qemu and is no longer checked.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
57cbe6a569 qemuBuildCompatDeprecatedCommandLine: Assume that QEMU_CAPS_COMPAT_DEPRECATED is supported
Bumping minimum version of qemu to 6.2 means that the '-compat' option
is now always supported.

As we were unable to detect it in any other way we based this capability
on QEMU_CAPS_OBJECT_JSON.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:38:16 +01:00
Peter Krempa
67d2787807 domainbackupxml2xml: Add test case with unix socket server for pull mode backup
While we show the example in the docs we don't have an example XML for
exercising the parser/formatter and schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-13 15:36:46 +01:00
Peter Krempa
5d95391203 docs: formatdomain: Clarify configuration of iothread <-> virtqueue mapping
Add an example for the automatic/round-robin mapping of iothreads which
users should preferrably use. Until now the example contained even the
full mapping which could push users to use that instead.

Mention that the queues are then automatically distributed among the
iothreads.

Also clarify the need to set 'queues' when mapping threads explicitly
and how the queues are identified.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
0ee6848ca5 virDomainIothreadMappingDefParse: Fix usage of virXMLNodeGetSubelementList
virXMLNodeGetSubelementList always returns a non-NULL pointers thus we
should check the length instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
fcd47086f4 virXMLNodeGetSubelementList: Document return value semantics
The returned value is always non-NULL. Callers need to check the length
of the returned array instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
482a2d119b qemu: Use modern header formatting in 'qemu_command.h'
The file used intermixed style. Convert the last outliers to the new
formatting style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
080c7fd341 qemu: process: Remove un-updated 'qemuProcessStartWarnShmem'
The checks in qemuProcessStartWarnShmem are no longer current. Since
previous patch made it fatal for vhost-user interfaces to be configured
without shared memory this warning code can be deleted.

Resolves: https://issues.redhat.com/browse/RHEL-80533
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
0d20632179 qemuValidateDomainDeviceDefNetwork: Require shared memory for all vhost-user interfaces
Currently we produce only a warning into the log if a non-passt
vhost-user interface is configured with shared memory.

Since we do make it fatal with all other vhost-user types, fix the check
to trigger also for normal-vhost-user interfaces.

Since passt-based vhost-user interfaces are checked separately the check
will no longer be required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
779a975355 qemuxmlconftest: Include shared memory 'net-vhostuser' test cases
The vhost-user protocol requires shared memory support to work properly.

Our test XMLs didn't have it configured as for interface the check if
shared memory is present only produces a warning instead of a proper
error.

Upcoming patches will be moving the check to become fatal so the test
cases need to be fixed first.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
2daf61ffec qemuNodeGetSEVInfo: Use virTypedParamList to construct return value
Simplify the code by using the modern helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
710e90fc69 qemuDomainGetLaunchSecurityInfo: Use virTypedParamList to construct return value
Simplify the code by using the modern helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Peter Krempa
20e0bc3fbd qemuDomainGetLaunchSecurityInfo: Don't forget unlock VM object on (impossible) error
If 'vm->def->sec->sectype' would be invalid; which is currently not
possible; we'd not unlock the domain object. Fix the logic even when the
bug currently can't happen.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-12 12:56:58 +01:00
Daniel P. Berrangé
defca11627 src: expand docs for guest stats constant version handling
Explain that the 11.2.0 release dates are mostly reflecting when the
constant was first added, not when the key was introduced.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:01:17 +00:00
Daniel P. Berrangé
c27bced958 src: expand docs for guest stats array handling
Give an overview of how arrays are handled and represented in
the typed parameters returned by the guest stats API.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:01:16 +00:00
Daniel P. Berrangé
728b22be92 src: document that no constants are provided for custom VM stats
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:01:16 +00:00
Daniel P. Berrangé
5d9f73628b src: add constants for domain stats 'dirtyrate.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:01:06 +00:00
Daniel P. Berrangé
b1c0ec1767 src: add constants for domain stats 'memory.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:54 +00:00
Daniel P. Berrangé
ca0aa86fbb src: add constants for domain stats 'iothread.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:45 +00:00
Daniel P. Berrangé
69e8341f10 src: add constants for domain stats 'perf.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:35 +00:00
Daniel P. Berrangé
4661ceb067 src: add constants for domain stats 'block.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:24 +00:00
Daniel P. Berrangé
88bae83ea9 src: add constants for domain stats 'net.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:11 +00:00
Daniel P. Berrangé
b040ee0c98 src: add constants for domain stats 'vcpu.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 10:00:02 +00:00
Daniel P. Berrangé
6a16c3ca8c src: add constants for domain stats 'balloon.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:48 +00:00
Daniel P. Berrangé
947306957e src: add constants for domain stats 'cpu.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:37 +00:00
Daniel P. Berrangé
df0513fa36 src: add constants for domain stats 'state.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the domain stats data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the domain stats
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:25 +00:00
Daniel P. Berrangé
8927d4eedc src: expand docs for guest info constant version handling
Explain that the 11.2.0 release dates are mostly reflecting when the
constant was first added, not when the key was introduced.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:13 +00:00
Daniel P. Berrangé
5436eba3a8 src: expand docs for guest info array handling
Give an overview of how arrays are handled and represented in
the typed parameters returned by the guest info API.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:02 +00:00
Daniel P. Berrangé
325b5701ae src: add constants for guest info 'load.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:59:01 +00:00
Daniel P. Berrangé
9e725c1ccd src: add constants for guest info 'if.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:58:51 +00:00
Daniel P. Berrangé
d28a49cd6d src: add constants for guest info 'disk.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:58:41 +00:00
Daniel P. Berrangé
c9a8c55f96 src: add constants for guest info 'fs.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:58:30 +00:00
Daniel P. Berrangé
941d11fe71 src: add constant for the guest info 'hostname' parameter
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:58:16 +00:00
Daniel P. Berrangé
e7a122a192 src: add constants for guest info 'timezone.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:58:07 +00:00
Daniel P. Berrangé
7192539cec src: add constants for guest info 'os.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:57:56 +00:00
Daniel P. Berrangé
0a19b61a6c src: add constants for guest info 'user.' parameters
Contrary to most APIs returning typed parameters, there are no constants
defined for the guest info data keys. This is was because many of the
keys needs to be dynamically constructed using one or more array index
values.

It is possible to define constants while still supporting dynamic
array indexes by simply defining the prefixes and suffixes as constants.
The consuming code can then combine the constants with array index
value.

With this approach, it is practical to add constants for the guest info
API keys.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-12 09:57:28 +00:00
Pavel Hrdina
278b8334eb qemu: snapshot: error out early when reverting snapshot for VM with non-file disk
Before this patch the code would start the revert process by destroying
the VM and preparing to revert where it would fail with following error:

    error: unsupported configuration: source for disk 'sdb' is not a regular file; refusing to generate external snapshot name

and leaving user with offline VM even if it was running.

Make the check before we start the revert process to not destroy VMs.

Resolves: https://issues.redhat.com/browse/RHEL-30971
Resolves: https://issues.redhat.com/browse/RHEL-79928
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-11 17:51:11 +01:00
Michal Privoznik
fc47a37a7a security: Don't stop restoring labels too early
The point of virSecurityManagerRestoreAllLabel() function is to
restore ALL labels and be tolerant to possible errors, i.e.
continue restoring seclabels and NOT return early.

Well, in two implementations of this internal API this type of
problem was found:

1) virSecurityDACRestoreAllLabel() returned early if
   virSecurityDACRestoreGraphicsLabel() failed, or when
   def->sec->sectype equals to an impossible value.

2) virSecuritySELinuxRestoreAllLabel() returned early if
   virSecuritySELinuxRestoreMemoryLabel() failed.

Fix all three places.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-11 15:05:41 +01:00
Martin Kletzander
63c0f15f09 docs: Correct dbus graphics' accepted p2p values
The attribute is used (and formatted) as virTristateBool() and even in
schema defined as virYesNo, so the values are supposed to be `yes` and
`no`.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-11 14:54:36 +01:00
Shalini Chellathurai Saroja
b0527a8f8e tests: update capabilities for QEMU 9.2.0 on s390x
Update the replies and xml files for QEMU 9.2.0 on s390x based on
the released QEMU tag v9.2.0 with commit Id
ae35f033b874c627d81d51070187fbf55f0bf1a7.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-11 14:03:46 +01:00
Jiri Denemark
477a81fedb esx: Refactor esxVI_LookupHostScsiTopologyLunListByTargetName
With a specific combination of compiler options gcc reported the
following bogus warning (I added a context to it to make the issue
visible):

../src/esx/esx_vi.c: In function ‘esxVI_LookupHostScsiTopologyLunListByTargetName’:
../src/esx/esx_vi.c:4674:32: error: potential null pointer dereference [-Werror=null-dereference]
 4671 |     if (!found || !hostScsiTopologyTarget)
 4672 |         goto cleanup;
 4673 |
 4674 |     if (!hostScsiTopologyTarget->lun) {
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~

Most likely this is caused by found and hostScsiTopologyTarget doing
essentially the same thing as found is true if and only if
hostScsiTopologyTarget is non-NULL. The found variable is completely
redundant. Removing it would be enough, but I decided to make the code a
little bit easier to read by not using the iterator variable directly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-11 12:20:21 +01:00
Praveen K Paladugu
cc33c02ad5 ch: Enable SEV SNP support
Enable SEV-SNP support for ch guests.

Co-Authored-by: Smit Gardhariya <sgardhariya@microsoft.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 14:40:04 +01:00
Praveen K Paladugu
695a4f38b5 util: Introduce virStringFormatHex
virStringFormatHex converts an input byte array into hex string and
returns it.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 14:39:59 +01:00
Michal Privoznik
9d1e4b25ba security: Set seclabels on UEFI shim
Again, trivial. Just copy what is done for kernel and initrd.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-10 13:54:59 +01:00
Michal Privoznik
39c1784ca0 qemu_command: Generate cmd line for UEFI shim
Trivial.

Resolves: https://issues.redhat.com/browse/RHEL-68043
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-10 13:54:42 +01:00
Michal Privoznik
b136e492c5 qemu_validate: Check whether UEFI shim is supported
If UEFI shim is specified in domain XML but QEMU is too old, then
report an error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-10 13:53:06 +01:00
Michal Privoznik
30be3b0d9d qemu_capabilities: Introduce QEMU_CAPS_MACHINE_SHIM
In its commit v9.2.0-323-ga5bd044b15 QEMU introduced another
command line option: -shim. It's used to load kernel. Track
presence of it via QEMU_CAPS_MACHINE_SHIM.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-10 13:51:42 +01:00
Michal Privoznik
6b63334233 conf: Introduce os/shim element
For secure boot environments where <loader/> is signed, it may be
unfeasible to keep the binary up to date (esp. when revoking
certificates contained within). To address that, QEMU introduced
'-shim' cmd line option which side loads another UEFI binary
which can then contain new certification authorities or list of
revocations. Expose it as <shim/> element that's nested under
<os/>, just like kernel and initrd are.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-10 13:32:46 +01:00
Peter Krempa
17945b8ec9 qemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64 for the '+amdsev' variant
Add data based on 'v9.2.0-2369-g98c7362b1e'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:29 +01:00
Peter Krempa
c941fec220 qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-2369-g98c7362b1e'
Notable changes:
 - 'uefi-vars-x64', 'uefi-vars-sysbus' qom type added
 - 'YongFeng-v1-x86_64-cpu' added
 - 'accel' qom type removed
 - 'addr' field of devices changed type to 'str'
 - 'vfio-pci' gained experimental feature 'x-migration-multifd-transfer'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:29 +01:00
Peter Krempa
5cc3803d1d qemu: block: Drop 'sheepdog' protocol support
As now no supported qemu version supports the 'sheepdog' protocol drop
the code for configuring the blockdev layer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:29 +01:00
Peter Krempa
8824af826d qemu: capabilities: Bump minimum qemu to qemu-6.2
Following minimum versions are needed based on our support policy:

             CentOS Stream 9: 9.1
                   Debian 12: 7.2
                   Fedora 40: 8.2
          openSUSE Leap 15.6: 8.2
                Ubuntu 22.04: 6.2
               FreeBSD ports: 9.2
              macOS homebrew: 9.2
              macOS macports: 9.2

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:29 +01:00
Peter Krempa
cbe39cfa8e qemucapabilitiesdata: Drop un-updated 'qemu_8.0.0_riscv64' data
The riscv64 qemu-8.0 data were not updated to the release version. Drop
them instead of trying to do archaeology.

They are not used in any 'qemuxmlconftest' case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
81098ff4c6 qemucapabilitiesdata: Drop un-updated 'caps_7.0.0_aarch64' data
The aarch-64 qemu-7.0 data were not updated to the release version. Drop
them instead of trying to do archaeology.

They are not used in any 'qemuxmlconftest' case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
623312ecfb qemucapabilitiesdata: Drop un-updated 'qemu_6.2.0_aarch64' data
We'll be bumping to qemu-6.2 as minimum and the aarch64 qemu-6.2 data
were not updated to the release version. Drop them instead of trying to
do archaeology.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
991ac7372f qemucapabilitiestest: Drop unused fake data 'caps_7.0.0_aarch64+hvf'
The 'caps_7.0.0_aarch64+hvf' caps dump is fake; obtained from copying
and doctoring the 'caps_7.0.0_aarch64' file (see commit 12aedb414578d3 )

Remove it now that it was superseded by a dump obtained from a proper
hvf-enabled host.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
c63055dc38 qemucapabilitiestest: Add 'qemu_9.2.0.aarch64+hvf' test data
The data is collected from an MacOS host with latest released qemu from
homebrew.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
ac3291f8db qemucapabilitiestest: Drop qemu-6.1 data
Soon we'll bump to qemu-6.2 as minimum.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
58193c5b25 qemucapabilitiestest: Drop qemu-6.0 data
Soon we'll bump to qemu-6.2 as minimum.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
4ddc5cdddc qemucapabilitiestest: Drop qemu-5.2 data
Soon we'll bump to qemu-6.2 as minimum.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:28 +01:00
Peter Krempa
ab10e9b003 qemuxmlconftest: Drop tests pinned to qemu-6.1
Upcoming patches will bump minimum qemu version to 6.2 so we need to
purge old tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:27 +01:00
Peter Krempa
9d3e9e0bc7 qemuxmlconftest: Drop tests pinned to qemu-6.0
Upcoming patches will bump minimum qemu version to 6.2 so we need to
purge old tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:27 +01:00
Peter Krempa
f642c029f5 qemuxmlconftest: Drop tests pinned to qemu-5.2
Upcoming patches will bump minimum qemu version to 6.2 so we need to
purge old tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:27 +01:00
Peter Krempa
f976d1b06c conf: Drop support for 'sheepdog' disks
In upcoming patches we'll update minimum supported qemu version to
qemu-6.2 which no longer supports 'sheepdog'. This was the only
hypervisor driver that supported it.

Reject any config containing sheepdog disks when validating the XML,
remove the positive test cases in qemu and replace them by a negative
test case. This will still excercise the XML schema, but will prepare
for removal of the internal code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-10 13:09:27 +01:00
Pavel Hrdina
23c3900054 ci: refresh with 'lcitool manifest'
- Remove EOL Debian 11

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-07 15:46:21 +01:00
Alexander Kuznetsov
d23a516eba util: netdevvlan: Change return type of virNetDevVlanCopy to void
This function return value is invariant since 1022e0ee, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Alexander Rudyuk <a.rudyuk@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-07 14:48:01 +01:00
Pavel Hrdina
c4b7d29610 util: virxml: unexport virXMLFormatElementInternal
It is no longer used anywhere else.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:18:46 +01:00
Pavel Hrdina
e042ff6dd0 domain_conf: refactor virDomainLoaderDefFormatNvram
Use the new virXMLFormatDirect in order to remove usage of
virXMLFormatInternal.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:18:44 +01:00
Pavel Hrdina
aedfdaa3f6 conf: use virXMLFormatElementDirect
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:18:41 +01:00
Pavel Hrdina
4cc562651f util: virxml: introduce virXMLFormatElementDirect
This can be used to format XML where the element has direct value
instead of any subelement. For example:

    <maxMemory slots='16' unit='KiB'>1524288</maxMemory>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:18:38 +01:00
Nicolás Gal
915b2bfcfe Translated using Weblate (Spanish)
Currently translated at 52.6% (5704 of 10838 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
2025-03-07 13:53:57 +01:00
Pavel Hrdina
798d87539d domain_conf: graphics: properly escape user provided strings when formatting XML
This was reported on virt-manager issue tracker as it was possible to
provide `listen` attribute with properly escaped characters but libvirt
would format XML without escaping it.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
6786ae80a3 domain_conf: graphics: fix error messages when formatting XML
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
1ef5926a80 domain_conf: graphics: move remaining VNC formatting
Now we are able to move the rest into virDomainGraphicsDefFormatVNC
without breaking order of elements in the resulting XML.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
15599d3481 domain_conf: graphics: move remaining spice formatting
Now we are able to move the rest into virDomainGraphicsDefFormatSpice
without breaking order of elements in the resulting XML.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
08925c0bea domain_conf: graphics: move listens formatting to relevant graphics types
Only VNC, RDP and Spice graphics types are using listen elements so call
the function only where it is needed.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
5f97b846f0 domain_conf: graphics: extract listen formatting to separate function
This will be used in specific graphics types that are using listen
elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
4c2c7720fe domain_conf: graphics: extract DBus formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
e95d362ba7 domain_conf: graphics: extract EGL-Headless formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
287c1a761e domain_conf: graphics: extract Spice formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
a93ea4cd84 domain_conf: graphics: extract Desktop formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
c2dcb47413 domain_conf: graphics: extract RDP formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
7a05d981eb domain_conf: graphics: extract SDL formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:27 +01:00
Pavel Hrdina
9774254ce3 domain_conf: graphics: extract VNC formatting to separate function
virDomainGraphicsDefFormat function was way too long so split it into
separate functions for each graphics type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:26 +01:00
Pavel Hrdina
227bf2c9de domain_conf: modernize graphics formatting
Use separate buffers for attributes and children elements to make the
code cleaner and to use the virXMLFormatElement() function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:26 +01:00
Pavel Hrdina
8d055b7d61 domain_conf: graphics: use a function to format audio element
Removes code duplication.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:26 +01:00
Pavel Hrdina
320273df54 domain_conf: graphics: use a function to format gl element
Removes code duplication.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-07 14:01:26 +01:00
Daniel P. Berrangé
288f90feb3 qemu: support MSDM ACPI table type
The MSDM ACPI table is a replacement for the SLIC table type, now
sometimes used by Microsoft for Windows Licensing checks:

  https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653305(v=vs.85)

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/748
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
32765cd14e conf: support MSDM ACPI table type
The MSDM ACPI table is an alternative for the SLIC table type,
sometimes used by Microsoft for Windows Licensing checks:

  https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn653305(v=vs.85)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
dac6ecba6f libxl: support 'rawset' ACPI table type
This fixes representation of the 'acpi_firmware' config in the Xen
driver, which repesents a concatenation of tables of any type.

Use of 'type=slic' is accepted on input for backwards compatibility.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
fe0cf62e0f qemu: support 'raw' ACPI table type
This allows passing a single ACPI table of any type through to QEMU with
the signture autodetected from the header.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
513ef8f028 src: introduce 'raw' and 'rawset' ACPI table types
The QEMU driver has only accepted type=slic even though QEMU is able to
accept individual tables of any type, without needing to specify a
signature. Introduce type=raw to address this usage scenario. Contrary
to other types, this one may appear multiple times.

The Xen driver has mistakenly accepted type=slic and use it to set the
Xen acpi_firmware setting, which performs a simple passthrough of
multiple concatenated data table. Introduce type=rawset to address
this usage scenario.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
3d94587655 src: validate permitted ACPI table types in libxl/qemu drivers
This forces us to update the drivers when defining new table types
to avoid incorrectly accepting them by default.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Daniel P. Berrangé
55f48d3852 conf: introduce support for multiple ACPI tables
Currently we parse

   <os>
     <acpi>
       <table type="slic">...path...</table>
     </acpi>
   </os>

into a flat 'char *slic_table' field which is rather an anti-pattern
as it has special cased a single attribute type.

This rewrites the internal design to permit multiple table types to
be parsed, should we add more in future. Each type is currently
permitted to only appear once.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-07 13:00:10 +00:00
Dion Bosschieter
92de6563c6 nwfilter: Fix deadlock between nwfilter-list and VM startup/migration
The `nwfilterBindingCreateXML` and `nwfilterConnectListAllNWFilters`
APIs can acquire locks on multiple instances of virNWFilterObj. There
is no guarantee they will acquire these locks in the same order as
each other. Thus there is a potential for deadlock if they run
concurrently acquiring locks on the same filter objects.

This flaw has always existed, but historically was rare, because
virNWFilterObjList previously used an array. This meant iteration
over filters had a fixed order, matching order of loading filters
into libvirt.  The set of filter references would have to be just
right to expose the lock ordering deadlock.

In 8.2.0, commit c4fb52dc72b312431a3a28e3a163b38441a95665 switched
to use a hash table, introducing non-determinism to the iteration
order, as hash buckets vary based on the hash seed. As such almost
any filter with references is exposed to the deadlock risk now.

It is not easy  to guarantee lock ordering on the virNWFilterObj
instances, so acquiring `driverMutex` first, will serve to serialize
all lock acquisition on virNWFilterObj instances, avoiding the
deadlock scenario.

The major cost is that concurrency of the driver is significantly
reduced, with few other APIs able to run in parallel with updating
firewall rules.

A long term solution to this problem needs significant changes

 * The mutex on virNWFilterObj would need to change to a R/W
   lock.
 * The filter instantiation/teardown process would need to split
   into two phases. The first phase would resolve all the required
   virNWFilterObj instances & acquire read locks, while holding
   the 'driverMutex'. The second phase of running iptables/ebtables
   commands would then run without driverMutex held.
 * The filter define/undefine APIs would need to acquire write
   locks, other APIs only read locks.

This would allow concurrency of filter instantiation/teardown
with everything except for filter defnie/undefine, which was
the original desire.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
[DPB: rewrite commit message & add inline comment]
Signed-off-by: Dion Bosschieter <dionbosschieter@gmail.com>
2025-03-07 12:38:57 +00:00
Alexander Kuznetsov
8acc0b76c6 qemu: snapshot: Remove dead code in qemuSnapshotDeleteBlockJobFinishing()
qemuSnapshotDeleteBlockJobFinishing() returns only 0 and 1. Convert it
to bool and remove the dead code handling -1 return in the caller.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Reported-by: Andrey Slepykh <a.slepykh@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-06 15:04:06 +01:00
Yalan Zhang
628989369b docs: Fix formatting in formatdomain.rst
The combination of italics and the since tag does not work together.

Remove it from the paragraph about using passt with vhostuser,
as well as the parentheses around it.

Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-03-06 14:36:48 +01:00
Peter Krempa
07d8755523 domain_caps: Don't leak 'cpu0_id' in 'virSEVCapabilitiesFree'
Freeing the 'virSEVCapability' object leaked the 'cpu0_id' field since
its introduction.

Fixes: 0236e6154c46603bc443eda2f05c8ce511c55b08
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-03-06 14:06:46 +01:00
Peter Krempa
bddb2363e8 qemuxmlconftest: Add '+amdsev' versions of the rest of 'launch-security-sev*' cases
While the 'launch-security-sev-direct' and 'launch-security-sev-snp'
cases use "latest" caps, they use the non-sev variant and add-in the
relevant capabilities.

To do the test properly we can add '+amdsev' variant which uses caps
fetched from a real host that does support all the capabilities.

The output files are identical, although they are not added as symlinks
to prevent headaches if they do diverge at some point.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:26 +01:00
Peter Krempa
8a852c3a90 qemuxmlconftest: Add 'latest' version of 'launch-security-sev*' originally using 6.0.0
The 'launch-security-sev' and
'launch-security-sev-missing-platform-info' tests run agains the
qemu-6.0.0 caps which were manually doctored to support SEV.

Since we now have the '+amdsev' variant dumped from a more modern qemu
add another invocation of the tests.

The only relevant difference in the output data is 'cbitpos' being '51'
on the new platform, for the test case which explicitly doesn't
configure it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:26 +01:00
Peter Krempa
59e528ea0d qemuxmlconftest: Propery discriminate output files for caps variants
While the 'qemuxmlconftest' was able to load capability variants the
output file name didn't include the variant thus it was not possible to
test the same input file both on the default variant and on an explicit
variant.

Include the variant in the output file name and adjust two output file
names.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:26 +01:00
Peter Krempa
4492348b96 qemucapabilitiestest: Add test data for 'qemu-9.2' on a SEV-enabled AMD host
Introduce the test data as 'qemu_9.2.0.x86_64+amdsev' to test
SEV-related capability code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:25 +01:00
Peter Krempa
0e58c04fc9 qemucapabilitiesdata: Document '+amdsev' variant
Upcoming patch will introduce test data from an SEV-enabled host.
Document the new variant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:25 +01:00
Peter Krempa
b7657a6d2e domaincapstest: Allow tests of all capability variants
Currently only the default variant ("") and "+hvf" are present in our
test data but upcoming patches will add another variant.

Upcoming test variants may not require any special handling so we should
be able to handle them using the default code path now that 'variant' is
properly propagated inside the test code.

Remove the restriction to test only the default ("") and "+hvf" variant
and modify the documentation to state that any other variant is tested
the same way as the default one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:25 +01:00
Peter Krempa
af68ab6b26 domaincapstest: Use proper input file based on 'variant' in 'fillQemuCaps'
The qemu part of 'domaincapstest' supports testing of the '+hvf' variant
of files, but doesn't properly pick the input file. The input file lacks
the variant part thus the wrong file is used.

Propagate the variant and select the correct input file.

Fixes: 738c5bae888cfa72ed359899cf1a41fed9dbb0f5
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:25 +01:00
Peter Krempa
107cf9992f qemu: capabilities: Parse 'cpu0Id' from capability cache XML
The 'cpu0Id' field is formatted into the caps cache XML but not parsed
back; thus restart of the daemon will make it vanish.

Fixes: 0236e6154c46603bc443eda2f05c8ce511c55b08
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-03-06 13:04:25 +01:00
Laine Stump
25270737d3 conf: change virDomainDefAddImplicitControllers() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:45 -05:00
Laine Stump
fd6cfeeeea conf: change virDomainDefMaybeAddSmartcardController() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:45 -05:00
Laine Stump
be9a0f4764 conf: change virDomainDefMaybeAddVirtioSerialController() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:45 -05:00
Laine Stump
74e36dfce0 conf: change virDomainDefAddDiskControllersForType() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:45 -05:00
Laine Stump
7cfcfcc403 conf: change virDomainDefMaybeAddHostdevSCSIcontroller() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
250d6ac2a0 conf: change virDomainDefMaybeAddController() to return true/false
This function can't fail, but it has always returned 1 if a controller
is added and 0 if not, and there is one place that checks for a 1
return, so we remove the -1 return and change it to return true/false
instead of 1/0.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
cc82b06036 hyperv: change hypervDomainDefAppendController() to return void
It can't fail. And as a result, hypervDomainDefAppendSCSIController() and
hypervDomainDefAppendIDEController() can also be changed to return void.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
e207c9c17e conf: change virDomainDefAddUSBController() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
b0ef70aca9 conf: stop checking for NULL return from virDomainDefAddController()
It can't fail, so the caller doesn't need to check the return.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
b62ce44a61 conf: stop checking for NULL return from virDomainControllerDefNew()
It can't fail, so the caller doesn't need to check the return.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
3d263290df conf: change qemuDomainDefAddImplicitInputDevice() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
b7da649e6e libxl: change xenDomainDefAddImplicitInputDevice() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
8733ce0151 conf: change virDomainDefMaybeAddInput() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
2f8fde6680 conf: change virDomainShmemDefInsert() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
1456fe2c54 conf: change virDomainFSInsert() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Laine Stump
5c5135849b conf: change virDomainNetInsert() to return void
It can't fail.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 16:56:44 -05:00
Pavel Hrdina
9bd83854f7 ci: refresh with 'lcitool manifest'
Replace Alpine Linux v3.19 with v3.21.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 11:23:30 +01:00
Pavel Hrdina
49b2a75e04 ci: use Fedora 41 to run integration tests
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 11:23:29 +01:00
Pavel Hrdina
7762cbc308 ci: use iptables to run libvirt-tck
On current Fedora libvirt uses nftables by default but the libvirt-tck
tests are not ready for it and most of the nwfilter tests fail. We need
to keep using iptables for now.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-03-05 11:23:12 +01:00
Cleber Rosa
b98a474a44 docs/api.rst: revert erroneously change of Once -> OnDevice
Commit af1b89d1d for some reason changed a perfectly fine statement to
one that I could not understand.  Let's revert it.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-03-04 09:31:36 +01:00
Michal Privoznik
e5299ddf86 meson: Generate runstatedir according to newer standard
While previously FHS 2.3 defined /var/run as a place to store
runtime information [1] it's no longer 2004 and newer
specification was released which favors /run [2]. Since it was
released 10 years ago, maybe it's time we start honouring it.

On majority of Linux systems (if not all), /var/run is a symlink
to /run anyways.

Users can still pass old location via -Drunstatedir.

1: https://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA
2: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-04 08:36:21 +01:00
Roman Bogorodskiy
100dd5f3a7 virDomainHostdevDefNew: update users not to check return value
virDomainHostdevDefNew() has been using g_new0() for a while now. As it
calls abort() on OOM, it's not necessary to check whether
the return value is NULL.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-03-03 19:22:37 +01:00
Jim Fehlig
5e3e924248 qemu: Add support for 'image_format' typed parameter
Add support for the 'image_format' typed parameter in virDomainSaveParams.
The parameter overrides the 'save_image_format' setting in qemu.conf.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:05:30 -07:00
Jim Fehlig
fdb7b1e19a include: Define constant for save image format
Add a new VIR_DOMAIN_SAVE_PARAM_IMAGE_FORMAT typed parameter for
specifying the save image format. A format specified via the
virDomainSaveParams API overrides the save_image_format setting
in qemu.conf. The 'raw' format remains the default.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:05:24 -07:00
Jim Fehlig
ec50e0cf63 qemu: Check for valid save image formats when loading driver config
Checking for valid 'foo_image_format' settings in qemu.conf is not done
until the settings are used. Move the checks to
virQEMUDriverConfigLoadSaveEntry, allowing to report incorrect format
settings at driver startup.

This change was made easier by also changing the corresponding fields
in the virQEMUDriverConfig to 'int', which is more in line with the
other fields that represent enumerated types.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:05:18 -07:00
Jim Fehlig
1564607cd0 qemu: Change return value of SaveImageGetCompressionProgram
qemuSaveImageGetCompressionProgram is a bit overloaded. Along with
getting a compression program, it checks the validity of the image
format and returns the integer representation of the format. Change
the function to only handle retrieving the specified compression
program, returning success or failure. Checking the validity of
the image format can be left to the calling functions.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:05:11 -07:00
Jim Fehlig
757fa62cfd qemu: Don't ignore dump image format errors
Long ago, without justification, commit 48cb9f0542 changed
qemuGetCompressionProgram (since renamed to
qemuSaveImageGetCompressionProgram) to ignore configuration errors
for dump operations. Like the other save-related operations, user
provided configuration should be verified and an error reported if
it cannot be honored.

Remove the special handling of configuration errors in
qemuSaveImageGetCompressionProgram and change the dump logic to
fail when dump image format cannot be supported.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:05:06 -07:00
Jim Fehlig
1a5692a6e1 qemu: Move declaration of virQEMUSaveFormat to header file
Allow use of the enum outside of qemu_saveimage.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-03 10:04:56 -07:00
Peter Krempa
1bbb1a02d9 schemas: domaincaps: Add missing schema for '<cpu0Id>'
Fixes: 0236e6154c46603bc443eda2f05c8ce511c55b08
Resolves: https://issues.redhat.com/browse/RHEL-81890
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-03-03 17:00:32 +01:00
Peter Krempa
e088895a62 qemuPrepareNVRAMFile: Fix NVRAM image conversion check
In case when user provides custom paths (those not covered by the JSON
firmware descriptor files or  the default locations) for the
loader and nvram template no auto-detection will be performed and user's
config will be taken at face value. Historically when 'templateFormat'
didn't exist we assumed that the 'format' field covers both.

Thus if 'templateFormat' is VIR_STORAGE_FILE_NONE we need to skip the
check forbidding image format conversion for 'file' backed to avoid
breaking legacy configs with manual/non-detected format assuming that
user picked the correct format.

Add a comment to the declaration of 'nvramTemplateFormat' noting the
above for future reference.

Resolves: https://issues.redhat.com/browse/RHEL-81731
Fixes: 2aa644a2fc8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-03-03 16:59:35 +01:00
Ján Tomko
a479c3465e conf: metadata: remove metadata node if all metadata is removed
When removing the last child element from a network or domain
metadata, free the metadata node itself as well, to prevent
displaying an empty metadata element.

https://issues.redhat.com/browse/RHEL-27172

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:17:34 +01:00
Ján Tomko
0b69d47774 conf: metadata: ignore empty metadata element
Do not copy the <metadata> node to domain/network definition
if its empty.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:17:34 +01:00
Ján Tomko
633c55dbd6 conf: obj: remove extra empty line
Originally present in virDomainDefSetMetadata it got copied to
virNetworkDefSetMetadata too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:17:34 +01:00
Ján Tomko
66d6fd7ffa conf: networkobj: fix indentation
'Network' has one more letter than 'Domain' where these helpers
were copied from. Shift the unaligned lines by one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:17:34 +01:00
Jiri Denemark
282f38ad3d cpu_map: arm: Add AmpereOne CPU models
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:10:38 +01:00
Jiri Denemark
7d78044165 cpu_arm: Report vendor ID for unknown PVRs
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-03-03 16:10:37 +01:00
Peter Krempa
40b83176af qemuDomainGetGuestInfo: Remove temporary infrastructure
Now that the refactor was completed the helper infrastructure can be
removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
9f4c6ebc39 qemuDomainGetGuestInfo: Convert hostname code to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
dd59d0f77d qemuAgentGetUsers: Convert to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
0f5bb2c20d qemuAgentGetOSInfo: Convert to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
52fd07c9f0 qemuAgentGetTimezone: Convert to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
3d0203709f qemuAgentFSInfoFormatParams: Convert interface code to virTypedParamList
Also remove stale TODO comment as we already report disk target.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:20 +01:00
Peter Krempa
1dc68d6c6e qemuAgentDiskInfoFormatParams: Convert interface code to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:19 +01:00
Peter Krempa
3c75bae720 virDomainInterfaceFormatParams: Convert interface code to virTypedParamList
Also deletes pre-existing broken formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:19 +01:00
Peter Krempa
2391a96141 qemuDomainGetGuestInfo: Convert load code to virTypedParamList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:19 +01:00
Peter Krempa
d6b34d0de8 qemuDomainGetGuestInfo: Prepare for refactor to virTypedParamList
Use of raw typed param APIs is very clunky. Prepare
qemuDomainGetGuestInfo for step-by-step refactor to virTypedParamList.

The two lists will coexist until the refactor is complete.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:19 +01:00
Peter Krempa
89a57e7fe0 qemu: Report disk bus as reported by agent in virDomainGetGuestInfo
KubeVirt decided to report this to the users. In order to allow them to
use proper APIs expose the field as well.

Resolves: https://issues.redhat.com/browse/RHEL-80688
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-03-03 15:08:19 +01:00
Martin Kletzander
71e75ce092 virsh: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Resolves: https://issues.redhat.com/browse/RHEL-71883
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-03 14:27:45 +01:00
Martin Kletzander
b4cf9c8cba qemu: Add support for VIR_DOMAIN_GUEST_INFO_LOAD
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-03 14:27:44 +01:00
Martin Kletzander
1669d91ead qemu_agent: Add qemuAgentGetLoadAvg()
With qemu guest agent 9.3 we are able to get the load averages with a
new command.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-03 14:27:44 +01:00
Martin Kletzander
c52c449fd4 Add load average information type into virDomainGetGuestInfo
The public API part.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-03-03 14:27:43 +01:00
Jiri Denemark
e9cb690d21 Post-release version bump to 11.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-03-03 13:42:18 +01:00
Jiri Denemark
9cd0673748 Release of libvirt-11.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-03-03 13:12:30 +01:00
김인수
2c4e820188 Translated using Weblate (Korean)
Currently translated at 99.4% (10783 of 10838 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-03-01 04:12:33 +01:00
Jiri Denemark
538b50f0c9 NEWS: Document crasher fix in qemuDomainCheckCPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-28 10:41:22 +01:00
Michal Privoznik
d99d3e1232 NEWS: Document features/improvements/bug fixes I've participated in
There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-02-27 15:54:54 +01:00
Yuri Chornoivan
4809604315 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10838 of 10838 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>

Translated using Weblate (Ukrainian)

Currently translated at 99.4% (10774 of 10838 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2025-02-26 10:46:59 +01:00
김인수
ffeb1c99fc Translated using Weblate (Korean)
Currently translated at 99.4% (10781 of 10838 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-02-26 10:46:59 +01:00
Ján Tomko
98262a61b2 docs: formatdomain: fix typo in passt section
A mismatch in backticks happened.

Fixes: a47a89a9d335c111a9c2fbb3f4e1c3a13001e74b
Reported-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-02-26 10:45:20 +01:00
Peter Krempa
aae38da829 qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1967-gb69801dd6b'
Notable changes:
 - 'NETDEV_VHOST_USER_CONNECTED'/'NETDEV_VHOST_USER_DISCONNECTED' events
   added
 - 'handshake-max-seconds' argument for 'nbd-server-start' added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-02-25 13:41:26 +01:00
Michal Privoznik
291186daa3 apparmor: Allow SGX if configured
If SGX memory model is configured for domain then we need to
allow QEMU access some additional files:

  1) /dev/sgx_vepc needs to be RW
  2) /dev/sgx_provision needs to be RO

We already do this in SELinux driver but not in AppArmor.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/751

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-25 12:48:24 +01:00
Jiri Denemark
5c78395bad cpu: Do not call g_strv_contains on NULL list
When virCPUx86UpdateLive checks whether a feature was added to a CPU
model after the model was already released (vmx-* features in most Intel
models), the following assert could be logged by glib:

    g_strv_contains: assertion 'strv != NULL' failed

While most of our CPU models have a non-empty list of added feature, new
models added in 2024 and versioned variants of older models have
addedFeatures == NULL.

Fixes: e622970c8785ec1f7e142d72f792d89f870e07d0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-25 09:35:26 +01:00
Jiri Denemark
d36c91ae14 run: Use correct SELinux context for modular daemons
Only libvirtd uses virtd_t/virt_exec_t context, modular daemons use
their specific context each.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-25 09:35:26 +01:00
Weblate
9433433ddf 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2025-02-24 12:52:22 +01:00
Jiri Denemark
ce88939324 po: Refresh potfile for v11.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-24 12:54:04 +01:00
Jiri Denemark
ce66d7e01b build: Enable syntax checks for vshError and vshWarn
To make sure both error and warning messages printed by virsh are
properly marked for translation.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
2844744346 virsh: Let prohibit_newline_at_end_of_diagnostic check pass
The prohibit_newline_at_end_of_diagnostic syntax check is confused when
another unrelated translatable message with a newline is too close to
the function it is supposed to check. Refactoring the code to make the
two strings further apart seems like the easiest solution.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
ffad5ce459 virsh: Drop extra newlines at the end of error messages
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
ad59ebb8d0 virsh: Avoid using translated messages without format
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
ad57923b36 virsh: Properly mark all error messages for translation
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
644f56f9d5 virsh: Do not require \n in vshDebug messages
Having to put a newline at the end of each debug message in virsh has
always felt strange.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
2fb76aeae6 virsh: Warn when hypervisor-cpu-* is used with host CPU
While using host CPU definition from capabilities XML is allowed for
historical reasons, it will likely provide incorrect results and should
be avoided.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
71fe4b97a9 virsh: Introduce vshWarn
This new function can be used for printing warnings about suboptimal
usage.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
c12f92a05e virsh: Refactor vshError
The code is moved into a newly introduced generic vshPrintStderr and
vshError changed into a tiny wrapper.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
ddef7271fd virsh: Make messages printed by vshError properly translatable
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
575b3ea925 virsh: Do not format messages twice
The same message was formatted both in vshOutputLogFile and in vshDebug
and vshError functions. This patch refactor vshOutputLogFile and its
callers to only format each message once.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:11 +01:00
Jiri Denemark
af0507e2e4 docs: Clarify documentation of virsh hypervisor-cpu-baseline
Using host CPU definition with hypervisor-cpu-baseline is possible, but
it provide incorrect results and thus it should not be documented the
same way we describe the correct usage. Also using host-model CPU from
domain capabilities was not described clearly enough.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:10 +01:00
Jiri Denemark
e8323cc7db docs: Clarify documentation of virsh hypervisor-cpu-compare
Using host CPU definition with hypervisor-cpu-compare is possible, but
it provide incorrect results and thus it should not be documented the
same way we describe the correct usage. Also using host-model CPU from
domain capabilities was not described clearly enough.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-24 11:14:10 +01:00
jianqing yan
c721f9ef78 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 93.6% (10094 of 10781 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2025-02-21 19:48:32 +01:00
Anonymous
4e963f590f Translated using Weblate (Telugu)
Currently translated at 43.9% (4742 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>

Translated using Weblate (Dutch)

Currently translated at 19.4% (2099 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>

Translated using Weblate (Kannada)

Currently translated at 44.2% (4768 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>

Translated using Weblate (Hindi)

Currently translated at 27.2% (2940 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>

Translated using Weblate (French)

Currently translated at 93.5% (10086 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>

Translated using Weblate (German)

Currently translated at 44.7% (4829 of 10781 strings)

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

Signed-off-by: Anonymous <noreply@weblate.org>
2025-02-21 19:48:32 +01:00
Laine Stump
be5332c81d schema: fix <interleave> errors when validating <domain> subelements
I first noticed a problem when I added a <memoryBacking> element at an
unusual (but still correct) place in the domain XML, and validation
failed. Then I tried adding that element in several different places
and it failed in many, but not all of them.

(NB: from here on, I will use '' for the names of attributes in the
domain XML, <> for elements in the domain XML, and "" for the names of
grammar rule definitions in the RNG file, and "<>" for the names of
elements in the RNG file's own XML. Confused yet? If so, please tell
me a better way - everything I know about RNG I've picked up
informally by looking at examples in already existing RNG files)

Starting from the top level of the grammar for <domain>
("domaincontents" in domaincommon.rng), I noticed that

1) the "<attribute>" for the 'id' attribute of <domain> is defined
   inside an "<interleave>" down in the definition of "ids" (which is
   referenced from "domaincontents") (I'm not familiar with the
   nomenclature - does that make it a "sub-grammer", "child-grammar",
   ???)

2) although the definition of "ids", had all of its
   "<attribute>"s/"<element>"s inside an "<interleave>",
   "domaincontents" already had the reference to "ids" inside an
   "<interleave>", so there were nested "<interleave>"s.

It's not clear to me how an "<attribute>" or "<interleave>" inside
another "<interleave>" is supposed to behave, but they both seemed a
bit suspicious.

I tried all of the below modifications:

1) moving the grammar for the 'id' attribute out of the "<interleave>"
   but still inside "ids"

2) moving the grammer for the 'id' attribute directly into
   "domaincontents" (and outside of its "interleave"

3) removing the "<interleave>" that was inside "ids"

4) (2) + (3)

5) move the entire grammar rule "ids" up directly in place of <ref
   name="ids"> in "domaincontents".

6) (5), but with the grammar for the 'id' attribute moved outside of
   the "<interleave>"

(6) was the only change that allowed all of the following (using
modifications to the subelements of <domain> in
net-vhostuser-passt.xml as example):

a) a <memoryBacking> element in between *any* two existing elements

b) moving <name> in between any two elements

c) oddly, in addition to the problem with putting <memoryBacking> in
   odd places, I also found that the original RNG did not allow the
   <clock> element to be placed in between <on_poweroff> and
   <on_reboot>, but once I'd made the change in (6), this was no
   longer problematic. Why should this have any effect? No idea, but
   it works :-/

(NB: there are many other cases of referencing "sub-grammar" from
inside an "<interleave>", and they all seem to work just fine;
possibly in this case it was problematic because the sub-grammar a)
also contained an "<interleave>", b) had an "<attribute>" at its
toplevel, or c) had multiple "<element>"s.)

(inexplicably (to me) at one point during my experimentation, I tried
reordering the references to "clock", "resources", "features", and
"events", and that *also* made it legal to put a <clock> element in
between the <on_*> elements:-O)

Since I was no longer able to reproduce the error described in (c)
once I had made mod (6) (move all of "ids" directly into
"domaincontent", I decided it was pointless for me to spend any more
time randomly poking and just add that to the new test case for that
in case some other random change to the RNG causes it to start failing
again.

(I thought of writing a test program that would try all possible
orderings of the subelements of <domain>, but since doing that for
even 10 subelements would mean testing > 3.2 million different XML
documents, I decided we could continue in this adhoc manner, just
adding a single new test case if/when a new validation failure is
found.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-21 13:52:52 -05:00
Laine Stump
6f70da39c1 tests: be consistent about following DO_TEST_*() with a ;
As is often the case with macros (especially those that resolve to
multiple statements), it isn't technically necessary to end any of the
invocations of the DO_TEST_*() macros with a semicolon (as evidenced
by the lines changed in this path). Having does make some
auto-indenters (e.g. cc-mode in emacs) more likely to do the right
thing, though, and it also looks nicer if all the lines are similar.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-21 13:52:42 -05:00
Peter Krempa
d78260cd3f conf: Validate that iothreads are used only with 'virtio-scsi' controllers
The documentation states:

 ``iothread``
    Supported for controller type ``scsi`` using model ``virtio-scsi`` for
    ``address`` types ``pci`` and ``ccw`` :since:`since 1.3.5 (QEMU 2.4)`. The

The code itself didn't validate if iothread is specified for any other
controller type.

Add test case showing the issue on one example.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:45 +01:00
Peter Krempa
1b4e451dcb conf: schemas: Rename 'diskDriverIothreads' to 'iothreadMapping'
The schema definition will be reused when adding iothread<->virtqueue
mapping for 'virtio-scsi'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:45 +01:00
Peter Krempa
e1c3fead7d qemuValidateCheckSCSIControllerIOThreads: Return '0' and '-1' instead of bools
The function reports libvirt errors so stick with the usual '0' and '-1'
return values.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:45 +01:00
Peter Krempa
a2183d9a13 qemu: validate: Extract iothread mapping validation code
Extract the code to 'qemuDomainValidateIothreadMapping'. It will be
reused to validate the mapping for 'virtio-scsi' iothreads.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:45 +01:00
Peter Krempa
a21319bb94 qemu: command: Rename 'qemuBuildDiskDeviceIothreadMappingProps' to 'qemuBuildIothreadMappingProps'
Prepare for reuse of the code for 'virtio-scsi' controller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:45 +01:00
Peter Krempa
3313ab3932 hypervisor: domain: Extract code for checking iothread usage
The code will be also needed for 'virtio-scsi' controller definitions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:44 +01:00
Peter Krempa
79c68ae313 conf: domain: Extract code for parsing and formatting iothread mapping definition
The code will be also needed for 'virtio-scsi' controller definitions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:44 +01:00
Peter Krempa
4b651cf890 conf: Rename 'virDomainDiskIothreadDef' to 'virDomainIothreadMappingDef'
The iothread mapping will be also possible for 'virtio-scsi' controllers
so rename the corresponding structs to a generic name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:21:44 +01:00
Peter Krempa
33ae851409 docs: formatdomain: Mention that vhostuser interface with mode='server' waits for connection
When starting a VM with a vhost-user interface in server mode qemu will
wait for the incoming connection without running CPUs. This isn't really
documented in our XML. Additionally when hotplugging the same interface
the above will not happen.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:18:11 +01:00
Peter Krempa
1348aa8f6e docs: formatdomain: Document few NVRAM config limitations
Note that 'block' backed NVRAM may need to use 'qcow2' images to work
properly and that populating from template may not support format
conversion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:18:11 +01:00
Peter Krempa
f0c9c34d58 qemuDomainGetStats: Convert worker functions to void
The presence of a return value made it seem that it's expected to fail
on errors which is not the case. The function is designed to skip
anything it can't fill and not fail when fetching individual stats.

Convert the workers to void to make it clear that it's expected not
to fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:41 +01:00
Peter Krempa
4086f9ed5c qemuDomainGetStatsDirtyRate: Don't error out
The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the dirty rate stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:41 +01:00
Peter Krempa
a0122665c6 qemuDomainGetStatsMemoryBandwidth: Don't error out
The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the memory bandwidth stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:41 +01:00
Peter Krempa
a761c44b90 qemuDomainGetStatsIOThread: Don't error out if fetching iothread info fails
The bulk domain stats API is meant to collect as much data as possible
without erroring out. Ignore errors from 'qemuDomainGetIOThreadsMon()'
and skip the data if an error happens.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:41 +01:00
Peter Krempa
f05f54d8fb qemuDomainGetStatsPerfOneEvent: Ignore erros from 'virPerfReadEvent'
The bulk domain stats API is meant to collect as much data as possible
without erroring out. Skip the perf stats if we can't fetch them instead
of erroring out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
613901baec virPerfReadEvent: Refactor to return -errno on failure
The function didn't comply with libvirt's error reporting scheme as it
reported libvirt errors only sometimes. As callers may want to ignore
errors convert it to returning -errno on failure instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
a4c0c6fd9f qemuDomainGetStatsCpuCache: Don't error out
The bulk domain stats API is meant to collect as much data as possible
without erroring out.

If fetching of the cache stats fails just skip outputting them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
f660984273 qemuDomainGetStatsCpuHaltPollTime: Remove return value
The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
acad77f04b qemuDomainGetStatsCpuProc: Remove return value
The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
a90df14a35 qemuDomainGetStatsCpuCgroup: Remove return value
The function can't fail. Remove return value and refactor callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
3518f46cba virBitmapFormat: Don't check return value
'virBitmapFormat' always returns a string; remove pointless checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:40 +01:00
Peter Krempa
a44a48b681 virDomainCputuneDefFormat: Refactor bitmap formatting
Use g_autofree for the temporary variables, remove error checks for
virBitmapFormat and simplify formatting of multiple attributes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
5e4262b9ac virDomainResctrlMonDefParse: Refactor temporary variables
Decrease scope of temporary variables so that they don't have to be
autofreed and VIR_FREE()d at the same time.

Remove unneeded checks and temporary variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
13c54c8945 virBitmapFormat: Clarify returned values
NULL can't be returned; don't mention it in the docs.

Avoid extra cofusing variable when returning copy of empty string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
3c6d78aff7 qemuDomainGetStatsBlockExportHeader: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
a4b5ef9c87 qemuDomainStorageAlias: Remove NULL checks from callers
'qemuDomainStorageAlias' always returns non-NULL pointer if it gets a
non-NULL string on input. Remove unneeded checks from callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
f5e4c2a508 qemuDomainGetStatsOneBlock: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
e5b0612021 qemuDomainGetStatsOneBlockFallback: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
924805d29c qemuDomainGetStatsBlockExportBackendStorage: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
016fa9d73c qemuDomainGetStatsBlockExportFrontend: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:39 +01:00
Peter Krempa
b14968e6bd qemuDomainGetStatsBlockExportHeader: Remove return value
The function always returns 0. Remove return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-20 15:15:38 +01:00
Daniel P. Berrangé
d86e1aa510 build-aux: squelch trailing blank warnings from binary files
These files pollute the stderr output when the sc_trailing_blank
syntax check fails.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-18 18:08:04 +00:00
Jiri Denemark
43eae1b707 qemu: Avoid crash in qemuDomainCheckCPU with unknown host CPU
When we don't have any information about host CPU (for example when
running on an aarch64 host), the virQEMUCapsGetHostModel would return
NULL.

Fixes: f928eb5fc80ca0ed7277f2513b63aed36c09d275
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/747
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Tested-by: Jaroslav Suchanek <jsuchane@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-18 12:08:14 +01:00
Laine Stump
08db3e8dc2 util: fix compile warning in virsystemd.c during mingw builds
A function was changed from having no arguments to having a single
argument, but the entire body of the function was #ifdefed out for
windows builds, leaving that new argument unused. Surprisingly this
didn't cause the build to fail, but I happened to notice it flit by
during an rpm build.

Fixes: 785cd56e5803fbbf60715fb6c7536360df5b4b9e
Signed-off-by: Laine Stump <laine@redhat.com>
2025-02-17 23:25:45 -05:00
Andrea Bolognani
f2023e8018 utils: Canonicalize paths before comparing them
In virFileIsSharedFSOverride() we compare a path against a list
of overrides looking for a match.

All overrides are canonicalized ahead of time though, so e.g.
/var/run/foo will be turned into /run/foo due to /var/run being
a symlink on modern Linux systems. But the path we're trying to
match with the overrides doesn't get the same treatment, so in
this scenario the comparison will always fail.

Canonicalizing the path as well solves the issue.

Resolves: https://issues.redhat.com/browse/RHEL-79165
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-17 18:30:35 +01:00
Ján Tomko
b5dfcdc7ab docs: index: fix VMware capitalization
Reported-by: Mark Phillips
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 15:07:56 +01:00
Laine Stump
526f794b54 news: include info about supporting vhostuser+passt combination
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 00:02:11 -05:00
Laine Stump
96fd17a99b docs: document using passt backend with <interface type='vhostuser'>
Almost everything is already there (in the section for using passt
with type='user'), so we just need to point to that from the
type='vhostuser' section (and vice versa), and add a bit of glue.

Also updated a few related details that have changed (e.g. default
model type for vhostuser is now 'virtio', and source type/mode are now
optional), and changed "vhost-user interface" to "vhost-user
connection" because the interface is a virtio interface, and
vhost-user is being used to connect that interface to the outside.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 00:02:11 -05:00
Laine Stump
a47a89a9d3 docs: improve type='user' docs to higlight differences between SLIRP and passt
This reorganizes the section about <interface type='user'> and
describes the differences in behavior between SLIRP and passt.

Resolves: https://issues.redhat.com/browse/RHEL-46601
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 00:02:11 -05:00
Laine Stump
70bce2e6ee qemu: fail validation if a domain def has vhostuser/passt but no shared mem
This can/should also be done for a traditional vhost-user interface
(ie not backend type='passt') but that will be a separate change.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 00:02:11 -05:00
Laine Stump
1e9054b9c7 qemu: complete vhostuser + passt support
<interface type='vhostuser'><backend type='passt'/> needs to run the
passt command just as is done for interface type='user', but then add
vhostuser bits to the qemu commandline/monitor command.

There are some changes to the parsing/validation along with changes to
the vhostuser codepath do do the extra stuff for passt. I tried
keeping them separated into different patches, but then the unit test
failed in a strange way deep down in the bowels of the commandline
generation, so this patch both 1) makes the final changes to
parsing/formatting and 2) adds passt stuff at appropriate places for
vhostuser (as well as making a couple of things *not* happen when the
passt backend is chosen). The result is that you can now have:

    <interface type='vhostuser'>
      <backend type='passt'/>
      ...
    </interface>

Then as long as you also have the following as a subelement of
<domain>:

    <memoryBacking>
      <access mode='shared'/>
    </memoryBacking>

your passt interfaces will benefit from the greatly improved
efficiency of a vhost-user data path, and all without requiring
special privileges or capabilities *anywhere* (i.e. it works for
unprivileged libvirt (qemu:///session) as well as privileged libvirt).

Resolves: https://issues.redhat.com/browse/RHEL-69455
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-17 00:00:37 -05:00
Laine Stump
7b7c56c3b8 qemu: make qemuPasstCreateSocketPath() public
When passt is used with vhostuser, the vhostuser code that builds the
qemu commandline will need to have the same socket path that is given
to the passt command, so this patch makes it visible outside of
qemu_passt.c.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
6fe3d765e5 qemu: use switch instead of if in qemuProcessPrepareDomainNetwork()
qemuProcessPrepareDomain()'s comments say that it should be the only
place to change the "live XML" of a domain (i.e. the public parts of
the virDomainDef object that is shown in the domain's status
XML), and that seems like a reasonable idea (although there aren't
many users of it to date).

qemuProcessPrepareDomainNetwork() is called by the aforementioned
qemuProcessPrepareDomain() - this patch changes the "if (type ==
HOSTDEV)" in that function to a "switch(type)" so it's simpler to add
DomainDef modifications for various other types of virDomainNetDef,
and also so that anyone who adds a new interface type is forced to
look at the code and decide if anything needs to be done here for the
new type.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
fb4bfa7858 conf/qemu: make <source> element *almost* optional for type=vhostuser
For some reason, when vhostuser interface support was added in 2014,
the parser required that the XML for the <interface> have a <source>
element with type, mode, and path, all 3 also required. This in spite
of the fact that 'unix' is the only possible valid setting for type,
and 95% of the time the mode is set to 'client' (as I understand from
comments in the code, normally a guest will use mode='client' to
connect to an existing socket that is precreated (by OVS?), and the
only use for mode='server' is for test setups where one guest is setup
with a listening vhostuser socket (i.e. 'server') and another guest
connects to that socket (i.e. 'client')). (or maybe one guest connects
to OVS in server mode, and all the others connect in client mode, not
sure - I don't claim to be an expert on vhost-user.)

So from the point of view of existing vhost-user functionality, it
seems reasonable to make 'type' and 'mode' optional, and by default
fill in the vhostuser part of the NetDef as if they were 'unix' and
'client'.

In theory, the <source> element itself is also not *directly* required
after this patch, however, the path attribute of <source> *is*
required (for now), so effectively the <source> element is still
required.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
56f4cc167a qemu: do all vhostuser attribute validation in qemu driver
Since vhostuser is only used/supported by the QEMU driver, and all the
rest of the vhostuser-specific validation is done in QEMU's
validation, lets move the final check (to see if they've tried to
enable auto-reconnect when this interface is on the server side of the
vhostuser socket) to the QEMU validate.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
c4746418d7 qemu: automatically set model type='virtio' for interface type='vhostuser'
Both vdpa and vhostuser require that the guest device be virtio, and
for interface type='vdpa', we already set <model type='virtio'/> if it
is unspecified in the input XML, so let's be just as courteous for
interface type='vhostuser'.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
154d44a585 qemu: validate that model is virtio for vhostuser and vdpa interfaces in the same place
Both vhostuser and vdpa interface types must use the virtio model in
the guest (because part of the functionality is implemented in the
guest virtio driver). Due to ["because that's the way it happened"]
this has been validated for vhostuser in the hypervisor-agnostic
validate function, but for vdpa it has been done in the QEMU-specific
validate. Since these interface models are only supported by QEMU
anyway, validate for both of them in the QEMU validation function.

Take advantage of this change to switch to using
virDomainNetIsVirtioModel(net) instead of "net->model ==
VIR_DOMAIN_NET_MODEL_VIRTIO" (the former also matches
...VIRTIO_TRANSITIONAL and ...VIRTIO_NON_TRANSITIONAL, so is more
correct).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
6345ee60d8 qemu: fix qemu validation to forbid guest-side IP address for type='vdpa'
Because all the checks for VIR_DOMAIN_NET_TYPE_VDPA were inside an
else-if clause that was immediately followed by another else-if clause
that forbid setting guestIP.ips or guestIP.routes, we've been allowing
users to set guestIP.* for vdpa interfaces (but then not doing
validation of the attributes that should have been done if we *did*
support setting IPs for vdpa (but we don't anyway, so 🤷.)

This can be fixed by turning the vdpa else-if clause into a top-level
if - this way vdpa interfaces will hit the "else if
(net->guestIP.nips)" clause and reject guest-side IP address setting.

Also, since there are currently *no* interface types for QEMU that
support adding guest-side routes, we put that check by itself (I think
it may be possible to set some guest routes for passt interfaces, but
we don't do that)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Laine Stump
956c668411 conf: change virDomainHostdevInsert() to return void
We haven't checked for memalloc failure in many years, and that was
the only reason this function would have ever failed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-16 23:58:35 -05:00
Boris Fiuczynski
3d3ac7964f NEWS: Document ccwgroup based qeth device support
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-14 14:42:32 +01:00
Michal Privoznik
715bfc5e54 remote_daemon: Silence DBus errors
When a daemon (like libvirtd, virtqemud, etc.) is started as an
unprivileged user (which is exactly how KubeVirt does it), then
it tries to register on both session and system DBus-es so that
it can shut itself down (e.g. when system is powering off or user
logs out). It's worth noting that this is just opportunistic and
if no DBus is available then no error is reported.

Or at least that's what we thought. Because the way our
virGDBusGetSessionBus() and virGDBusGetSystemBus() are written an
error is actually reported every time the daemon starts.

Use virGDBusHasSessionBus() and virGDBusHasSystemBus() to check
if corresponding bus is available.

Resolves: https://issues.redhat.com/browse/RHEL-79088
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-02-13 15:20:34 +01:00
Michal Privoznik
0428c69b09 virgdbus: Introduce virGDBusHasSessionBus()
This is just like virGDBusHasSystemBus() except it checks for the
session bus instead of the system one.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-02-13 15:20:34 +01:00
Andi Chandler
827a062e3c Translated using Weblate (English (United Kingdom))
Currently translated at 48.7% (5257 of 10781 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2025-02-13 09:08:45 +01:00
Daniel P. Berrangé
bccbb592de qemu: add 'auto_start_delay' configuration parameter
This allows a user specified delay between autostart of each VM, giving
parity with the equivalent feature of libvirt-guests.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:06:02 +00:00
Daniel P. Berrangé
1e9d58ef49 hypervisor: add support for delay interval during autostart
This delay can reduce the CPU/IO load storm when autostarting many
guests.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:56 +00:00
Daniel P. Berrangé
c23554fc34 src: convert drivers over to use new autostart helper
This eliminates some duplicated code patterns aross drivers.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:55 +00:00
Daniel P. Berrangé
c0cdbecdaa hypervisor: introduce helper for autostart
There's a common pattern for autostart of iterating over VMs, acquiring
a lock and ref count, then checking the autostart & is-active flags.
Wrap this all up into a helper method.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:39 +00:00
Daniel P. Berrangé
8a6088221a remote: notify systemd when reloading config
Switch to the 'notify-reload' service type and send notifications to
systemd when reloading configuration.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:38 +00:00
Daniel P. Berrangé
785cd56e58 util: add APIs for more systemd notifications
We have a way to notify systemd when we're done starting the daemon.

Systemd supports many more notifications, however, and many of them
are quite relevant to our needs:

  https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html

This renames the existing notification API to better reflect its
semantics, and adds new APIs for reporting

 * Initiation of config file reload
 * Initiation of daemon shutdown process
 * Adhoc progress status messages
 * Request to extend service shutdown timeout

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:37 +00:00
Daniel P. Berrangé
354b455ec6 bhyve: stop opening & passing connection to bhyveProcessStart
A connection object is not required because autostarted domains are
never marked for autodestroy.

The comment about needing a connection for the network driver is
obsolete since we can auto-open a connection on demand.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 18:05:35 +00:00
Daniel P. Berrangé
2eb1de2a16 bhyve: add 'driver' to bhyveProcessStart method
This allows for passinga  NULL connection object in cases where
domain autodestroy is not required.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 17:51:43 +00:00
Peter Krempa
2626fa0569 qemu: migration: Reactivate block nodes after migration if VM is left paused
On incoming migration qemu doesn't activate the block graph nodes right
away. This is to properly facilitate locking of the images.

The block nodes are normally re-activated when starting the CPUs after
migration, but in cases (e.g. when a paused VM was migrated) when the VM
is left paused the block nodes are not re-activated by qemu.

This means that blockjobs which would want to write to an existing
backing chain member would fail. Generally read-only jobs would succeed
with older qemu's but this was not intended.

Instead with new qemu you'll always get an error if attempting to access
a inactive node:

 error: internal error: unable to execute QEMU command 'blockdev-mirror': Inactive 'libvirt-1-storage' can't be a backing child of active '#block052'

This is the case for explicit blockjobs (virsh blockcopy) but also for
non shared-storage migration (virsh migrate --copy-storage-all).

Since qemu now provides 'blockdev-set-active' QMP command which can
on-demand re-activate the nodes we can re-activate them in similar cases
as when we'd be starting vCPUs if the VM weren't left paused.

The only exception is on the source in case of a failed post-copy
migration as the VM already ran on destination so it won't ever run on
the source even when recovered.

Resolves: https://issues.redhat.com/browse/RHEL-78398
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-12 16:22:56 +01:00
Peter Krempa
d8f9cfb5e4 qemu: monitor: Add monitor backend for 'blockdev-set-active'
The command will be used to re-activate block nodes after migration when
we're leaving the VM paused so that blockjobs can be used.

As the 'node-name' field is optional the 'qemumonitorjsontest' case
tests both variants.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-12 16:22:56 +01:00
Peter Krempa
b402e167b6 qemu: capabilies: Introduce QEMU_CAPS_BLOCKDEV_SET_ACTIVE
The flag signals presence of the 'blockdev-set-active' QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-12 16:22:56 +01:00
Peter Krempa
c8c2996b2b qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1636-gffaf7f0376'
Notable changes:
    - 'blockdev-set-active' QMP command and the corresponding 'active'
      flag for instantiating blockdev backends added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-12 16:22:56 +01:00
Peter Krempa
ba4b9a7d8f qemu-replies-tool: Dump also query string for optional members
The query language allows querying whether a member is optional by using
the '*' "operator" but the dumper script didn't output those query
strings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-12 16:22:56 +01:00
Peter Krempa
29d77d1a64 qemu: snapshot: Limit scope of checkpoint-snapshot interlock
'qemuDomainSupportsCheckpointsBlockjobs()' should really be used only
with active VMs based on the scope of interlocking it does.

This means that the inactive snapshot code path needs to do the
interlocking based on what's supported:
 - external snapshot support was not implemented yet
    (bitmaps need to be propagated to the new overlay image)
 - internal snapshot support can be deferred to qemu

Move the check inside qemuSnapshotPrepare() which has knowledge about
the snapshot type and implement an explicit check for the inactive case.

See: https://gitlab.com/libvirt/libvirt/-/issues/739
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-12 16:22:56 +01:00
Pavel Hrdina
5def28df55 qemu: fix qemuDomainSaveImageDefineXML
The commit in question made an incorrect change that resulted in getting
O_RDONLY FD instead of O_RDWR preventing any writes to happen with the
following error:

virQEMUSaveDataWrite:176 : failed to write header to domain save file '/path/to/save.img': Bad file descriptor

Pass 'bypass_cache' as proper bool as the original code did.

Fixes: 517248e2394476a3105ff5866b0b718fc6583073
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-02-12 12:04:45 +01:00
Daniel P. Berrangé
f1bd98f887 ci: refresh with 'lcitool manifest'
This replaces Fedora 39 with Fedora 41, updates the FreeBSD
Cirrus CI image names, and tweaks some package names

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-12 09:34:45 +00:00
Martin Kletzander
b1e9699b31 node_device: Do not lock the driver state needlessly
When processing the PCI devices we can only read the configs for each of
them if running as privileged.  That information is saved in the driver
state as a boolean introduced in commit 643c74abff01.  However since
that version it is only written to once during nodeStateInitialize() and
only read from that point (apart from some commits around v3.9.0 release
when it was not even set, but that was fixed before v3.10.0).  And it is
only read once, just to store that boolean in a temporary variable which
is also used in only one condition.

Rewrite this without locking and save few lines of code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-02-12 10:31:09 +01:00
Andi Chandler
b6f4466b1b Translated using Weblate (English (United Kingdom))
Currently translated at 48.6% (5241 of 10781 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2025-02-11 13:00:55 +01:00
Remus-Gabriel Chelu
ac9500aaf8 Translated using Weblate (Romanian)
Currently translated at 20.1% (2175 of 10781 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2025-02-11 13:00:54 +01:00
Nicolás Gal
662d47845c Translated using Weblate (Spanish)
Currently translated at 52.8% (5700 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 52.6% (5679 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 52.6% (5676 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 52.6% (5674 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 52.6% (5671 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 52.2% (5634 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
2025-02-11 13:00:54 +01:00
Boris Fiuczynski
af732d27cc node_device_udev: add error reporting to udevProcessCCWGroup
Add reporting an internal error when the string to type conversion of
devtype fails as this indicates a serious problem since devtype was used
to get into this method during the udev event handling.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-07 15:07:23 +01:00
Peter Krempa
5830e564bb qemu: domain: Initialize FD passthrough for a virStorageSource before using it
The call to 'qemuBlockStorageSourceNeedsFormatLayer()' bases the
decision also on the state of the passed FD, so we must initialize the
passthrough data via 'qemuDomainPrepareStorageSourceFDs()' before the
aforementioned call.

In the test change it's visible that we didn't add the necessary 'raw'
driver which allows the 'protocol' blockdev to be opened in 'rw' mode so
that qemu picks the proper file descriptior while keeping the device
read-only.

Resolves: https://issues.redhat.com/browse/RHEL-37519
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-07 13:52:45 +01:00
Peter Krempa
7a119483a3 qemuxmlconftest: Add testing of FDs with 'writable' flag in 'disk-source-fd'
Add few examples of fd groups with the 'writable' flag set, when passing
a single FD. Notably as a top level image of a readonly disk (even when
that doesn't make much sense) and also as a base image of a chain.

Note that this documents a status quo of a bug fixed in upcoming patch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-07 13:52:45 +01:00
Peter Krempa
500d985a13 qemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks
Pass also the 'writable' state to the fake passed FDs so that we can
test it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-02-07 13:52:45 +01:00
Nicolás Gal
8e48a4fafb Translated using Weblate (Spanish)
Currently translated at 51.9% (5600 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 51.5% (5557 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
2025-02-06 14:23:47 +01:00
Martin Kletzander
105c33bfe7 docs: Reword virDomainGetEmulatorPinInfo description
This API only queries the XML settings and not the running threads
themselves.  In order to avoid confusion, change the wording slightly.

Resolves: https://issues.redhat.com/browse/RHEL-72052
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-06 14:24:35 +01:00
Michal Privoznik
14af443139 tests: qemuxmlconfdata: Update launch-security-sev-snp.xml
Recently, I was part of a discussion where it was suspected that
libvirt does not pick up correct FW for SEV-SNP guests. Update
our test to demonstrate it does.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-02-06 11:31:42 +01:00
Guoyi Tu
8a92493596 nodedev: udev: Hook up virFileWaitForExist to address uevent race of pci device
Similarly to commit 1af45804 we should be safer by waiting for the whole
sysfs tree is created for the device.

Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-02-06 10:50:40 +01:00
Peter Krempa
946b81a2e9 qemu: Attach persistent reservations manager if block-copy target requires it
Users can choose to copy a disk into a destination where they want to
use persistent reservations. Start the daemon if the configuration
requires it.

Resolves: https://issues.redhat.com/browse/RHEL-7342
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
1697323bfe qemu: blockjob: Remove persistent reservations manager when dropping disk images
Check if the persistent reservations manager daemon is still needed
after a disk (sub)-chain was dropped after a blockjob.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
fc5b6ed091 qemu: hotplug: Export persistent reservations manager helper functions
Export qemuHotplugAttachManagedPR/qemuHotplugRemoveManagedPR for reuse
in blockjob code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
8e0591520f virDomainDefHasManagedPR: Consider also disk's 'mirror' chain
Consider also the destination of a block-copy job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
7087d8b46f qemu_hotplug.h: Reformat according to new coding style
Fix the mixed style by unifying the formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
712c39f987 qemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64
Add data based on 'v9.2.0-1537-gd922088eb4'

Notable changes:
    - '10.0' machine types added
    - 'hub' chardev backend added
    - 'cpr' migrate channel added
    - 'nsamples' field for 'dbus' audio backend now reported
    - 'ClearwaterForest-v1' cpu model added
    - 'SierraForest-v2' cpu model added
    - 'ivshmem-flat' device added
    - new qom objects:
        - 'virtio-mem-system-reset'
        - 'vmclock'
    - default value of 'rombar' changed from 1 to -1 for all devices
    - 'intel-iommu' device:
        - default value of 'aw-bit' changed from '39' to '48'
        - 'fs1gp' boolean added
        - 'x-flts' boolean added
    - 'virtio-balloon-pci'/'virtio-mem-pci':
        - 'ioeventfd' added
        - 'vectors' added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
fde300fa74 qemucapabilitiestest: Final update for qemu-9.2 release on x86_64
Update the data after the release.

Notable changes:
 - the 6.2 machine types became deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
650e6fb7eb qemu: snapshot: Ensure that NVRAM image exists when taking inactive internal snapshot
Attempting to take an internal snapshot of a freshly defined VM with
qcow2 backed NVRAM results in failure as the NVRAM image doesn't get
populated until the VM is started for the first time.

Fix this by invoking qemuPrepareNVRAM() when qcow2 nvram is defined.

Resolves: https://issues.redhat.com/browse/RHEL-73315
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
a377404ed9 qemu: process: Export qemuPrepareNVRAM for use in snapshot code
Export qemuPrepareNVRAM so that it doesn't require the VM object. The
snapshot code needs in the corner case of creating a snapshot of a
freshly defined VM ensure that the nvram image exists in order to
snapshot it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
d15eff6304 qemuSnapshotForEachQcow2: Don't initialize 'nrollback'
The variable holds the amount of disks to roll back the snapshot for.
The value must be set before the code jumps to the 'rollback:' label so
the best situation is to not initialize it and let the compiler catch
errors rather than initialize the unsigned variable to -1 and let it
crash.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-02-05 19:29:38 +01:00
Peter Krempa
15cd4ec832 node_device_udev: Fix build failure in ccw device code
clang complains:

../../../libvirt/src/node_device/node_device_udev.c:1408:82: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare]
 1408 |     if ((data->ccwgroup_dev.type = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0)
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.

Fix it by adding a temporary int variable to facilitate the check before
assigning to the unsigned enum value.

Fixes: 985cb9c32a6
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-02-05 19:27:36 +01:00
Boris Fiuczynski
78f72efddc nodedev: add qeth layer2 and layer3 device types
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
55e921d5cb nodedev: add ccwgroup capability support to ccw devices
Add the group membership information to a CCW device. Allow to filter
CCW devices based on a group membership.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
985cb9c32a nodedev: add ccwgroup node device support
Add ccwgroup node device type supporting qeth generic driver.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
de4c28cd4a nodedev: refactor udevCCWGetState
Refactor method to be only ccw state type depended to allow reuse in a
later patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
20560cb6c4 nodedev: refactor CCW state format for use in ccwgroup
Refactor to allow reuse in ccwgroup.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
1260f3bd4f nodedev: remove virNodeDeviceCapCCWDefFormat
Directly use virCCWDeviceAddressFormat.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
7ad25b4665 nodedev: refactor CCW device address
Replace cssid, ssid and devno elements with virCCWDeviceAddress.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Boris Fiuczynski
04de9ad285 nodedev: refactor CCW device address format
Refactor for reuse in the following patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-02-05 17:56:42 +01:00
Fabricio Duarte
0d9d439175 docs: fix 'virsh domstats --vcpu' measure units and descriptions
The fields are in nanoseconds, not microseconds. Also fixes the
description of `vcpu.<num>.wait`, as it does not actually represent the
time waiting on I/O.

Signed-off-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-02-05 17:14:01 +01:00
Daniel P. Berrangé
4589468c69 Translated using Weblate (Chinese (Traditional) (zh_TW))
Currently translated at 2.4% (265 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 93.3% (10067 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>
2025-02-04 15:57:04 +00:00
Nicolás Gal
da17a3558a Translated using Weblate (Spanish)
Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
2025-02-04 15:57:04 +00:00
Peter Krempa
4557ac4c77 NEWS: Mention preserving I/O error messages for qemu VMs
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:56 +01:00
Peter Krempa
97c47333cb include: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
In case when the hypervisor does report the reason for the I/O error as
an unstable string to display to users we can add a @reason possibility
for the I/O error event noting that the error is available.

Add 'message' as a reason enumeration value and document it
to instruct users to look at the logs or virDomainGetMessages().

The resulting event looks like:

 event 'io-error' for domain 'cd': /dev/mapper/errdev0 (virtio-disk0) report due to message

Users then can look at the virDomainGetMessages() API:

 I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message='Input/output error'

Or in the VM log file:

 2025-01-28 15:47:52.776+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
3a3c5616eb include: libvirt-domain: Reword documentation for @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
Emphasise that it's an enumeration and convert the possibilities to a
list of values with explanation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
666219f5f1 virDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS
Report any stored I/O error messages reported by the hypervisor when
reporting messages of a domain. As the I/O error may be already stale we
report also the timestamp when it was recorded.

Example message:

 I/O error: disk='vda', index='1', path='/dev/mapper/errdev0', timestamp='2025-01-28 15:47:52.776+0000', message='Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
1a02760cc6 virDomainObjGetMessages: Refactor using GPtrArray
Simplify the function especially by rewriting it using GPtrArray to
construct the string list, especially for the upcoming case when the
number of added elements will not be known beforehand and when
hypervisor specific data will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
042ea8630b libxlDomainGetMessages: Add existing flags to 'virCheckFlags'
The two VIR_DOMAIN_MESSAGE_* flags were not listed in the virCheckFlags
check in 'libxl' but were present in 'test' and 'qemu' driver impls.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
18f8d572be qemuProcessHandleIOError: Log IO errors in the VM log file
Add a log entry to the VM log file for every time we receive an IO error
event from qemu. The log entry is as follows:

 2025-01-24 16:03:28.928+0000: IO error device='virtio-disk0' node-name='libvirt-1-storage' reason='other: Input/output error'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
300f7e9bd4 qemuProcessHandleIOError: Populate I/O error reason to virStorageSource
Record the last I/O error reason and timestamp which happened with the
corresponding virStorageSource struct.

This will later allow querying the last error e.g. via the
virDomainGetMessages() API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
2f6c9fa4f6 virStorageSource: Add fields for storing last I/O error message
Hypervisors may report a I/O error message (unstable; for human use)
to libvirt. In order to store it with the appropriate virStorageSource
so that it can be later queried we need to add fields to
virStorageSource to store the timestamp and message.

The message is deliberately not copied via virStorageSourceCopy.

The messages are also not serialized to the status XML as losing them on
a daemon restart as they're likely to be stale anyways.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:55 +01:00
Peter Krempa
0525323175 qemuMonitorJSONHandleIOError: Propagate new 'qom-path' field
QEMU commit v9.1.0-1065-ge67b7aef7c added 'qom-path' as an optional
field for the BLOCK_IO_ERROR event. Extract and propagate it as an
alternative to lookup via 'node-name' and 'device' (alias).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Peter Krempa
784538a470 qemuProcessHandleIOError: Prefer lookup by node name
When qemu reports a node name for an I/O error we should prefer the
lookup by node name instead as it gives us the path to the specific
image which caused the error instead of the top level image path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Peter Krempa
f8f8d5a253 qemuMonitorJSONHandleIOError: Do not munge 'reason' field of IO error event
Leave the interpretation of the event to 'qemuProcessHandleIOError()'
which will create it's own variant of the messages for the user-facing
libvirt events. qemuMonitorJSONHandleIOError() will pass through the raw
data it got from qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Peter Krempa
590a5765c1 qemuProcessHandleIOError: Rename local variables
Prefix the helper variables used to supply data to the event by
'event'. Declare them with the default value of an empty string rather
than doing it later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Peter Krempa
2d6bd6f05f qemu: Rename 'diskAlias' to 'device' in qemu IO error event handling
The field is named 'device' in the event so unify our naming.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Peter Krempa
2f8359f827 qemu: Handle quirks of 'device' field of BLOCK_IO_ERROR event in monitor code
BLOCK_IO_ERROR's 'device' field is an empty string in case when it isn't
applicable as it was originally mandatory in the qemu API docs.

Move the logic that convert's empty string back to NULL from
'qemuProcessHandleIOError()' to 'qemuMonitorJSONHandleIOError()'

This also fixes a hypothetical NULL-dereference if qemu would indeed
report an IO error without the 'device' field present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-04 14:40:54 +01:00
Michal Privoznik
22e90a3b17 NEWS: Document virtio-mem-ccw
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
f23f8ff91a qemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml
This is similar to emuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
except the explicit placement of virtio-mem onto a PCI bus is removed.
This results in virtio-mem being placed onto CCW "bus" this demonstrating
previous commits working as expected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
ee0320a7fc qemu: Allow virtio-mem on CCW
After previous commits, we can allow virtio-mem to live on CCW
channel.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
541dfe40bc qemu: Validate virtio-mem-ccw
There are basically two differences between virtio-mem-ccw and
virtio-mem-pci. s390 doesn't allow mixing different page sizes
and there's no NUMA support in QEMU.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
a46e33a925 qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW
This capability tracks whether QEMU supports virtio-mem-ccw
device. Introduced in QEMU commit v9.2.0-492-gaa910c20ec only
upcoming release of QEMU supports the device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
621373d8a8 qemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml
As of v9.2.0-1413-gd77ae821e8 QEMU supports virtio-mem-pci on
s390 too. Let's add a test case for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
89d56c41ac qemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and virtio-pmem
Both, virtio-mem and virtio-pmem devices follow traditional QEMU
naming convention: their suffix determines what bus they live on.
For instance, virtio-mem-pci, virtio-mem-ccw, virtio-pmem-pci.
We already have a function that constructs device name following
this convention: qemuBuildVirtioDevGetConfigDev().

While there's no virtio-pmem-ccw device yet, the function can
still be used.

Another advantage of using the function is - it'll be easier in
future when we want to configure various virtio aspects of memory
devices (like ats, iommu_platform, etc.).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Michal Privoznik
a8ed747b9a qemu: Do NOT autoadd NUMA node for s390
In some cases, we might automatically add a NUMA node. But this
doesn't work for s390 really, because in its commit
v2.12.0-rc0~41^2~6 QEMU forbade specifying NUMA nodes for s390.
Suppress automatic adding of NUMA node on our side.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-02-04 09:15:45 +01:00
Pavel Hrdina
17f3a9114c libvirt.spec.in: fix indentation
Fixes: cf32953f5b6ec30386f71b40cf458467752a6dca
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2025-02-03 18:35:13 +01:00
Daniel P. Berrangé
cf32953f5b rpm: disable account creation for Fedora >= 42
In Fedora >= 42, support for user/group account creation based on
sysusers files has been enabled in RPM. Manually running useradd/
groupadd is thus obsolete.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-03 14:45:26 +00:00
Daniel P. Berrangé
2dd4f594ea tools: add sysusers file to create 'virtlogin' group
We previously added a sysusers file, but missed the 'virtlogin' group.
This group is used to make the virt-login-shell binary setgid, so we
shoudl be registering that too. It must be done in a separate sysusers
file, however, since it is packaged separately from the daemons.

Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-02-03 14:45:09 +00:00
Michal Privoznik
ff77c2d596 NEWS: Document VBOX-6.1 removal
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-31 10:54:13 +01:00
Michal Privoznik
da9a804f4e vbox: Drop code supporting old VBox version
Now that only supported version of VirtualBox is 7.0.x the code
that supports older versions can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-31 10:54:09 +01:00
Michal Privoznik
335bceb115 vbox: Drop support for VirtualBox-6.1.x
According to VirtualBox download page [1] the support for version
6.1.x was terminated a year ago. Drop support for it.

1: https://www.virtualbox.org/wiki/Download_Old_Builds_6_1

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-31 10:54:06 +01:00
Michal Privoznik
5ca7f27f75 vbox: Report an error when VBox CAPI initialization fails
If initialization of VBOX fails inside of _pfnInitialize an
negative value is returned to signal an error condition to a
caller but no error message is printed out. Reporting an error
may shed more light into why VBOX failed to initialize.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-31 10:54:03 +01:00
Michal Privoznik
10320ad526 vbox: Use g_autofree in tryLoadOne()
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-31 10:53:47 +01:00
Jim Fehlig via Devel
4118e79f3e qemu: Check for valid save image format when verifying image header
When attempting to restore a saved image, the check for a valid save image
format does not occur until the qemu process is about to be executed. Move
the check earlier in the restore process, along with the other checks that
verify a valid save image header.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-31 08:53:51 +01:00
Jim Fehlig via Devel
517248e239 qemu: Decompose qemuSaveImageOpen
Split the reading of libvirt's save image metadata from the opening
of the fd that will be passed to QEMU. This allows improved error
handling and provides more flexibility users of qemu_saveimage.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-31 08:53:51 +01:00
Jim Fehlig via Devel
50d65b94ef qemu: Move unlinking corrupt save image file to caller
qemuDomainObjRestore is the only caller of qemuSaveImageOpen that
requests an unlink of a corrupted save image. Provide a function to
check for a corrupt image and move unlinking it to qemuDomainObjRestore.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-31 08:53:51 +01:00
Daniel P. Berrangé
18f0160994 remote: add sysusers file to create 'libvirt' group
We previously added a sysusers file, but missed the 'libvirt' group.
This group is referenced in the polkit rules, so we should be
registering that too. It must be done in a separate sysusers file,
however, since it is common to all daemons.

Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-30 15:19:35 +00:00
Adam Julis
1e88b8983c glibcompat: Sync g_string_replace()
Ever since its introduction, g_string_replace() has received
various bugfies and improvements, e.g.:

  0a8c7e57a g_string_replace: Don't replace empty string more than once per location
  b13777841 g_string_replace: Document behaviour of zero-length match pattern
  e8517e777 remove quadratic behavior in g_string_replace
  c9e48947e gstring: Fix a heap buffer overflow in the new g_string_replace() code

to name a few. Sync our implementation with the one from current
main branch of glib. Some code style adjustments have been made
to match our coding style.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-30 12:08:30 +01:00
Ankush Menat
8cf042d983 docs: add missing cellNum parameter in function call
Signed-off-by: Ankush Menat <ankushmenat@gmail.com>
2025-01-29 22:30:56 +05:30
kaihuan
c1166be347 qemuSnapshotDeleteValidate: Fix crash when disk is not found in VM definition
qemuDomainDiskByName() can return a NULL pointer on failure.
But this returned value in qemuSnapshotDeleteValidate is not checked.It will make libvirtd crash.

Signed-off-by: kaihuan <jungleman759@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 16:15:30 +01:00
Fabian Leditzky
00f9f2ca1f qemu: Check empty drives in block I/O throttle API
Provide a proper user facing error when attempting to query block
I/O throttling settings for an empty drive. Without this patch, a less
meaningful internal error produced by qemuMonitorJSONBlockIoThrottleInfo
would be propagated to the user.

Signed-off-by: Fabian Leditzky <fabian@ldsoft.dev>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 16:15:29 +01:00
Adam Julis
fce24e433b Support IDE/SATA disk 'product' parameter
Since we supported 'product' parameter for SCSI, just expanded existing
solution makes IDE/SATA parameter works too. QEMU requires parameter 'model'
in case of IDE/SATA (instead of 'product'), so the process of making JSON
object is slightly modified. Length of the 'product' parameter is
different in SCSI (16 chars) and ATA/SATA (40 chars).

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/697
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 16:15:29 +01:00
Pavel Hrdina
443ae4adec qemu_snapshot: allow reverting to external disk only snapshot
When snapshot is created with disk-only flag it is always external
snapshot without memory state. Historically when there was not support
to revert external snapshots this produced error message.

    error: Failed to revert snapshot s1
    error: internal error: Invalid target domain state 'disk-snapshot'. Refusing snapshot reversion

Now we can simply consider this as reverting to offline snapshot as the
possible damage to file system is already done at the point of snapshot
creation.

Resolves: https://issues.redhat.com/browse/RHEL-21549
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 15:50:19 +01:00
Bronek Kozicki
2c79c42477 tools: Move libvirt-guests lock file out of subsys directory
This directory might not exist on systems not supporting old SystemV interfaces.

Signed-off-by: Bronek Kozicki <brok@incorrekt.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 12:42:27 +01:00
Philipp Schuster
1cc990a1d0 virsh: pool-list: remove unnecessary spaces to align behavior
By removing the unnecessary spaces, the behavior is aligned with
`virsh list --all --name` and `virsh net-list --all --name`.

Without this change, one can't do something like the following easily:

`virsh pool-list --all --name | xargs -I {} virsh pool-start \"{}\"`

as no pool `"foo    "` (with all the spaces) actually exist.

Although the removed comment states that the additional spaces were kept
to maintain backwards compatibility, the commit [0] and the old behavior
are from 2010 when libvirt was at version 0.8.1. For the sake of sanity,
the behavior should be aligned with other parts of the CLI.

[0] 415b14903e

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 12:42:27 +01:00
Assaf Admi
f6d76aad80 docs: Document that 'vcpu.delay' statistic is in nanoseconds
Add nanoseconds units for vcpu.delay doc, as it's based on
'/proc/<pid>/task/<tid>/schedstat' (see 'qemuGetSchedstatDelay()').

'schedstat' is in nanoseconds, according to
https://docs.kernel.org/scheduler/sched-stats.html#proc-pid-schedstat.

Signed-off-by: aadmi <aadmi@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-29 12:42:27 +01:00
Remus-Gabriel Chelu
0264a7704a Translated using Weblate (Romanian)
Currently translated at 14.9% (1611 of 10781 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2025-01-28 18:19:42 +01:00
김인수
879ee4aee8 Translated using Weblate (Korean)
Currently translated at 100.0% (10781 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>

Translated using Weblate (Korean)

Currently translated at 99.6% (10745 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>

Translated using Weblate (Korean)

Currently translated at 98.4% (10619 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-01-28 18:19:41 +01:00
Nicolás Gal
c4c05c8655 Translated using Weblate (Spanish)
Currently translated at 50.0% (5400 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.0% (5395 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 50.0% (5391 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 49.6% (5357 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 49.0% (5287 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 48.3% (5212 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 47.9% (5173 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>

Translated using Weblate (Spanish)

Currently translated at 47.7% (5149 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-28 18:19:41 +01:00
Salvatore Cocuzza
008560b0b2 Translated using Weblate (Italian)
Currently translated at 21.4% (2315 of 10781 strings)

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

Signed-off-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
2025-01-28 18:19:40 +01:00
Peter Krempa
72142dcde3 qemuProcessHandleIOError: Refactor to extract 'priv' instead of 'driver'
The VM private data will be used in a sub-sequent patch. To minimize
churn, refactor the function before changing the logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-28 17:04:39 +01:00
Peter Krempa
420c39d6bd build: Bump minimum glib2 version to 2.66.0
Per our supported platforms the minimum available versions are:

         CentOS Stream 9: 2.68.4
               Debian 11: 2.66.8
               Fedora 39: 2.78.6
      openSUSE Leap 15.6: 2.78.6
            Ubuntu 22.04: 2.72.4
           FreeBSD ports: 2.80.5
          macOS homebrew: 2.82.4
          macOS macports: 2.78.4

Bump to 2.66 which is limited by Debian 11. While ideally we'd bump to
2.68 which would give us 'g_strv_builder' and friends 2.66 is enough for
g_ptr_array_steal() which can be used to emulate the former with almost
no extra code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-01-28 17:04:39 +01:00
Adam Julis
62b961d64c conf: check size of secret file for secret object
Since the empty file with a .base64 value wasn't recognized during the loading
process (starting of libvirtd), attempting to get a value for the UUID resulted
in an undefined error. This patch resolves the issue by checking the size of
the file and ensuring that the stored value is as expected (NULL).

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Adam Julis <ajulis@redhat.com>
2025-01-28 11:08:58 +00:00
Michal Privoznik
4819a14fec ch: Include unistd.h in ch_events.c
There's a call to read() in the file but corresponding include of
unistd.h is missing causing a build failure.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-01-27 17:35:53 +01:00
Jiri Denemark
8b1578ab4b qemu: Allow virDomainBlockJobSetSpeed during migration
When a migration with non-shared storage is started with
VIR_MIGRATE_PARAM_BANDWIDTH set, it will be applied to both memory
migration and each block job started for storage migration. Once the
migration is running virDomainMigrateSetMaxSpeed may be used to change
the bandwidth used by memory migration, but there was no way of changing
storage migration speed. Let's allow virDomainBlockJobSetSpeed during
migration to enable the missing functionality.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 16:32:57 +01:00
Jiri Denemark
d9fca42e40 qemu: Add support for avail-switchover-bandwidth migration parameter
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 16:32:57 +01:00
Jiri Denemark
4bd103dde6 virsh migrate: Add --available-switchover-bandwidth option
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 16:32:57 +01:00
Jiri Denemark
c417ebf660 Add a migration parameter for available bandwidth in switchover
The new VIR_MIGRATE_PARAM_BANDWIDTH_AVAIL_SWITCHOVER parameter can be
used to override the estimated bandwidth that can be used for
transferring guest memory and device state once virtual CPUs are
stopped.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 16:32:57 +01:00
Andrea Bolognani
32cf090b84 rpm: Unify handling of directories used for loadable modules
Now that meson ensures these directories always exist, we can
move them to the daemon-common package where they belong.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 11:30:32 +01:00
Andrea Bolognani
40b5c302ab rpm: Add missing Requires
All loadable modules should depend on the daemon-common package.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 11:30:30 +01:00
Andrea Bolognani
676453a0a7 meson: Unify handling of directories used for loadable modules
Currently the directories that are searched for each possible
kind of loadable module are created as a side effect of
installing the corresponding module, which means that their
availability depends on the exact list of features that have
been enabled.

Create them explicitly ahead of time instead, ensuring
consistency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-27 11:30:21 +01:00
Anirudh Rayabharam
e797c3e3b3 ch: implement domainInterfaceAddresses
Implement domainInterfaceAddresses for the Cloud Hypervisor driver.
Support VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE and
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP sources. Implementation is
similar to other drivers.

Signed-off-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:18:35 +01:00
Purna Pavan Chandra Aekkaladevi
a9c73ac255 NEWS: Mention event handling support in ch driver
Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:03:56 +01:00
Purna Pavan Chandra Aekkaladevi
90299b0c6c ch: events: facilitate lifecycle events handling
Implement `virCHProcessEvent` that maps event string to corresponding
event type and take appropriate actions. As part of this, handle the
shutdown event by correctly updating the domain state. This change also
facilitates the handling of other VM lifecycle events, such as booting,
rebooting, pause, resume, etc.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:03:56 +01:00
Purna Pavan Chandra Aekkaladevi
104b0036ad ch: events: Read and parse cloud-hypervisor events
Implement `chReadProcessEvents` and `chProcessEvents` to read events from
event monitor FIFO file and parse them accordingly.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:03:56 +01:00
Purna Pavan Chandra Aekkaladevi
3015c28c1e ch: start a new thread for handling ch events
Use a FIFO(named pipe) for --event-monitor option in CH. Introduce a new
thread, `virCHEventHandlerLoop`, to continuously monitor and handle
events from cloud-hypervisor.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:03:56 +01:00
Purna Pavan Chandra Aekkaladevi
d7c9660b15 ch: pass --event-monitor option to cloud-hypervisor
The `--event-monitor` option in cloud-hypervisor outputs events to a
specified file. This file can then be used to monitor VM lifecycle,
other vmm events and trigger appropriate actions.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Co-authored-by: Vineeth Pillai <viremana@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-24 17:03:56 +01:00
Daniel Henrique Barboza
f044f17825 .mailmap: add my contact info
Most of my historical libvirt contributions are PowerPC related but at
this moment I'm working with RISC-V enablement (mostly on the QEMU
side).

Feel free to reach out for RISC-V related matters w.r.t libvirt and
QEMU-KVM support.

Suggested-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-24 07:31:04 -03:00
Daniel Henrique Barboza
5624489251 qemu: add RISC-V 'aia' command line
The 'aia' feature is added as a machine type option for the 'virt'
RISC-V machine, e.g. "-machine virt,aia=<val>".

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-24 07:30:52 -03:00
Daniel Henrique Barboza
817eabd0cc conf,qemu: implement RISC-V 'aia' virt domain feature
This feature is implemented as a string that can range from "none",
"aplic" and "aplic-imsic".

If the feature isn't present in the domain XML the hypervisor default
will be used. For QEMU, at least up to 9.2, the default is "none".

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-24 07:30:47 -03:00
Daniel Henrique Barboza
34d7f53d1b qemu: add capability for RISC-V AIA feature
AIA (Advanced Interrupt Architecture) support was introduced in QEMU 7.0
for the 'virt' machine type. It allows the guest to choose from a more
modern interrupt model than the default (CLINT - Core Logical Interrupt
Controller).

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-24 07:30:34 -03:00
Heinrich Schuchardt
3e9440dbcb virsysinfo: fix RISC-V detection
The correct compiler define to detect the RISC-V architecture is __riscv.

Fixes: b902cfece0db ("virsysinfo: Try reading DMI table")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-23 15:05:21 +01:00
Shalini Chellathurai Saroja
652b2eeaa9 tests: add capabilities for QEMU 10.0.0 on s390x
Let us introduce the xml and reply files for QEMU 10.0.0 on s390x.

Notable changes:
    - new s390-ccw-virtio-10.0 machine type
    - old machine types (2.4 - 2.8) dropped
    - new CPU models
    - New devices:
      - virtio-mem-ccw
      - chardev now supports qemu-vdagent

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-21 16:55:42 +01:00
Jiri Denemark
0ca8d870a2 qemu: Fix hang when migration is canceled at the last moment
When a migration is canceled very late once virtual CPUs are already
stopped, QEMU will automatically resume them. If this happens after we
exited a waiting loop in qemuMigrationSrcWaitForCompletion, but before a
loop that tries to make sure CPUs are stopped by waiting for the
appropriate event, we may end up waiting forever because the CPUs are
running (they were resumed by migrate_cancel), but the STOP event is
already gone.

This is possible because we enter monitor for fetching migration
statistics at which point other APIs can be processed and migration may
change its state. We should recheck the state when we get back from the
monitor code.

https://issues.redhat.com/browse/RHEL-52493

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-21 15:04:36 +01:00
Michal Privoznik
ab10c0695d tools: ssh-proxy: Check for domain status before parsing its CID
Inactive domain XML can be wildly different to the live XML. For
instance, it can have VSOCK CID of that from another (running)
domain. Since domain status is not checked for, attempting to ssh
into an inactive domain may in fact result in opening a
connection to a different live domain that listens on said CID
currently.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/737
Resolves: https://issues.redhat.com/browse/RHEL-75577

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-21 13:58:04 +01:00
Jiang XueQian
63a3d70697 nss: Skip empty files and avoid use of uninitialized value
JSON parser isn't called when reading empty files so `jerr` will be used
uninitialized in the original code. Empty files appear when a network
has no dhcp clients.

This patch checks for such files and skip them.

Fixes: a8d828c88bbdaf83ae78dc06cdd84d5667fcc424
Signed-off-by: Jiang XueQian <jiangxueqian@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-21 10:30:23 +01:00
Ján Tomko
a2297fb157 libvirt.spec: do not build ch driver on mingw
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-01-21 09:50:37 +01:00
Ján Tomko
064b3a276d meson: error out when ch driver is requested but unsupported
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2025-01-21 09:50:36 +01:00
Cole Robinson
981929112c spec: Only build ch driver on x86_64 and aarch64
This matches the cpu_family() check in `meson.build`

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2025-01-20 13:19:34 -05:00
Peter Krempa
22034bb77e storage_file_backend_fs: Compile out 'chown' backend on mingw
Otherwise build on mingw complains:

  src/storage_file/storage_file_backend_fs.c:142:12: error: implicit declaration of function 'chown

Fixes: f8558a87ac8525b16f4cbba4f24e0885fde2b79e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-20 16:47:24 +01:00
Peter Krempa
7a8c2319ac libvirt.spec: Move ownership of 'storage-file' backends directory to gluster
Commit f8558a87ac8525b16f4cbba4f24e0885fde2b79e de-modularized the
'storage-file' backend for local files, and thus now the only
possibility to have the directory is when compiling with gluster.

This breaks RPM builds when building without gluster as the backend
directory no longer exists in such case. Move the stanza requiring the
directory under the gluster driver declarations.

Fixes: f8558a87ac8525b16f4cbba4f24e0885fde2b79e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-20 16:47:24 +01:00
Michal Privoznik
4933dfcce0 qemuxmlconftest: Drop s390-default-cpu-...ccw-virtio-2.7 test cases
In its upstream commit [1], qemu dropped s390-2.7 machine type,
then in commit [2] the s390-2.8 machine type was dropped. But as
Thomas Huth pointed out, any machine type that's older than 6
years is subject to removal [3]. This means, any machine type
older than 4.1 is going to be removed eventually.

We have two test cases that assumes existence of 2.7 machine type.
While they could be switched to 4.1 machine type, we also have
another test case that already check 4.2 machine type.
Therefore, just drop the 2.7 ones.

1: 3199c7ee76
2: 66924fe369
3: ce80c4fa6f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2025-01-20 15:18:43 +01:00
Peter Krempa
06a7866d68 NEWS: Mention de-modularization of the 'fs' storage file backend
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-20 13:28:09 +01:00
Peter Krempa
f8558a87ac storage_file: de-modularize the local file backend
The 'storage_file' infrastructure serves as an abstraction on top of
file-looking storage technologies. Apart from local file it currently
implements also a backend for 'gluster'.

Historically it was all modularized and the local file module was
usually packaged with the 'core' part of the storage driver. Now with
split daemons one can install e.g. 'virqemud' without the storage driver
core which contains the 'fs' backend module. Since the qemu driver uses
the storage file backends to e.g. create storage for snapshots and
backups this allows users to create a deployment where some things will
not work properly.

As the 'fs' backend doesn't use any code that wouldn't be linked
directly anyways there's no point in actually shipping it as a module.

Let's compile it in so that all deployments can use it.

To achieve that, compile the source directly into the
'virt_storage_file_lib' static library and remove the loading code. Also
adjust the spec file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-20 13:28:09 +01:00
Peter Krempa
e6a4245d2a virstoragetest: Add case for qcow2 image with empty string as 'data_file'
Add an example image formatted by:

 qemu-img create -f qcow2 -o data_file=nbd+unix:///datafile?socket=/tmp/nbd,data_file_raw=true /tmp/nbddatastore.qcow2 10M -u

serving as an example when qemu records an empty string as the
'data_file' field.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-20 13:25:51 +01:00
Peter Krempa
87a4fe2906 storage_file: Refuse qcow2 images with empty string as 'data_file'
In certain buggy conditions qemu can create an image which has empty
string stored as 'data_file'. While probing libvirt would consider the
empty string as a relative file name and construct the path using the
path of the parent image stripping the last component and appending the
empty string. This results into attempting to using a directory as an
image and thus the following error when attempting to start VM with such
an image:

 error: unsupported configuration: storage type 'dir' requires use of storage format 'fat'

Reject empty strings passed in as 'data_file'.

Note that we do not have the same problem with 'backing store' as an
empty string there is interpreted as no backing file both by qemu and
libvirt.

Resolves: https://issues.redhat.com/browse/RHEL-70627
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-20 13:25:51 +01:00
Daniel P. Berrangé
a10728dc5b util: avoid overflow in hextable buffer
The assigned string is 17 chars long once the trailing nul is taken
into account. This triggers a warning with GCC 15

 src/util/virsystemd.c: In function ‘virSystemdEscapeName’:
 src/util/virsystemd.c:59:38: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
    59 |     static const char hextable[16] = "0123456789abcdef";
       |                                      ^~~~~~~~~~~~~~~~~~

Switch to a dynamically sized array as used in all the other places
we have a hextable array.

See also: https://gcc.gnu.org/PR115185
Reported-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-20 10:08:44 +00:00
Nicolas Gal
d908693167 Translated using Weblate (Spanish)
Currently translated at 47.6% (5137 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-17 12:47:44 +01:00
Jiri Denemark
095760cddc cpu_x86: Probe host CPU for all MSR features
The list of CPU features we probe from various MSR grew significantly
over time and the CPU map currently mentions 11 distinct MSR indexes.
But the code for directly probing host CPU features was still reading
only the original 0x10a index. Thus the CPU model in host capabilities
was missing a lot of features.

Instead of specifying a static list of indexes to read (which we would
forget to update in the future), let's just read all indexes found in
the CPU map.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-17 12:52:28 +01:00
Jiri Denemark
3766891c59 qemu_migration: Do not automatically resume domain after I/O error
When an I/O error happens (causing a domain to be paused) during live
migration which is later cancelled by a user, trying to resume the
domain doesn't make sense.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-17 12:44:42 +01:00
Jiri Denemark
e46e64be50 qemu_migration: Refactor qemuMigrationSrcRestoreDomainState
None of the callers really care about the return value so we can drop it
and simplify the code a bit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-17 12:44:38 +01:00
Jiri Denemark
899bf2746a qemu: Report error from both sides of migration
When migration fails in Perform phase, we call Finish on the destination
host with cancelled=1 and get the error from there and report it to the
user. This works well if the error on the destination caused the
migration to fail. But in other cases the main error may reported by the
source and the destination would just be complaining about broken
migration stream.

In other words, we don't really know which error caused the migration to
fail and we have no way of detecting that. So instead of choosing one
error, this patch will combine the error messages from both sides of
migration into a single message and report it to the user. The result
would be, for example:

    operation failed: migration failed. Message from the source host:
    operation failed: job 'migration out' failed: Certificate does not
    match the hostname ble.bla. Message from the destination host:
    operation failed: job 'migration in' failed: load of migration
    failed: Invalid argument

And yes, this is ugly, but I wasn't able to come up with a better way of
fixing this issue.

https://issues.redhat.com/browse/RHEL-58933

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-17 12:44:17 +01:00
Temuri Doghonadze
14fc6812df Translated using Weblate (Georgian)
Currently translated at 4.3% (464 of 10781 strings)

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

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2025-01-15 16:56:38 +01:00
Weblate
13b17f7720 Translated using Weblate (Georgian)
Currently translated at 4.3% (464 of 10781 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2025-01-15 16:56:38 +01:00
Jiri Denemark
32f822969d Post-release version bump to 11.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-15 09:12:52 +01:00
Jiri Denemark
a0b9f813a1 Release of libvirt-11.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-15 09:06:33 +01:00
Laine Stump
c1b8e8c00b news: document support for mdev <-> SRIOV VF vGPU live migration
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-14 11:20:31 -05:00
Laine Stump
d53da4b905 news: note addition of vlan tagging support for Linux host bridges
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-14 11:19:31 -05:00
Yuri Chornoivan
b2c999855d Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10781 of 10781 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2025-01-14 16:50:29 +01:00
Nicolas Gal
529d9a421e Translated using Weblate (Spanish)
Currently translated at 47.1% (5085 of 10781 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-14 16:50:29 +01:00
Jiri Denemark
7a03d6c2fa NEWS: Document some of my fixes in this release
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-14 16:55:26 +01:00
Martin Kletzander
dc8fdeb1fb NEWS: Add few things I changed this release
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-14 16:27:40 +01:00
Pavel Hrdina
c85d87fe8f NEWS: document bug fix for snapshots
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-14 16:10:20 +01:00
Michal Privoznik
1942a88813 NEWS: Document features/improvements/bug fixes I've participated in
There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-14 16:00:49 +01:00
Ján Tomko
027bcf1112 NEWS: document fix for starting transient domains
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-14 14:36:20 +01:00
Martin Kletzander
a4def2eb95 conf: Do not parse hyperv features with passthrough mode
The schema does not allow that anyway and we then format them all back
which leads to libvirt producing an invalid XML.

Resolves: https://issues.redhat.com/browse/RHEL-70656
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-13 14:03:21 +01:00
Michal Privoznik
32140bdb09 meson: Replace meson.source_root() with meson.project_source_root()
The source_root() method is deprecated in 0.56.0 and we're
recommended to use project_source_root() instead.

This is similar to commit v8.9.0-rc1~70 but somehow, the old
method sneaked in.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-13 12:33:23 +01:00
Jiri Denemark
a71985f6f3 qemu_migration: Do not consider post-copy active in postcopy-recover
The postcopy-recover migration state in QEMU means a connection for the
migration stream was established. Depending on the schedulers on both
hosts a relative timing of the corresponding MIGRATION event on the
source host and the destination host may differ. Specifically it's
possible that the source sees postcopy-recover while the destination is
still in postcopy-paused.

Currently the Perform phase on the source host ends when we get
postcopy-recover event and the Finish phase on the destination host is
called. If this is fast enough we can still see postcopy-paused state
when the Finish phase starts waiting for migration to complete. This is
interpreted as a failure and reported back to the caller. Even though
the recovery may actually start just a few moments later.

To avoid this race we now don't consider post-copy migration active in
postcopy-recover state and keep waiting for postcopy-active event (in
the success path). Thus the Finish phase is entered only after the
migration switches to postcopy-active. In this state QEMU guarantees the
destination already switched at least to postcopy-recover and we won't
be confused be seeing an old postcopy-failed state.

https://issues.redhat.com/browse/RHEL-73085

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com
2025-01-13 12:18:20 +01:00
Weblate
413e798eb1 Translated using Weblate (Korean)
Currently translated at 98.4% (10610 of 10781 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2025-01-13 10:30:37 +01:00
Yuri Chornoivan
9759d39c67 Translated using Weblate (Ukrainian)
Currently translated at 99.2% (10697 of 10781 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>

Translated using Weblate (Ukrainian)

Currently translated at 98.0% (10575 of 10781 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>

Translated using Weblate (Ukrainian)

Currently translated at 97.6% (10531 of 10781 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2025-01-13 10:30:37 +01:00
김인수
3639a38985 Translated using Weblate (Korean)
Currently translated at 98.3% (10602 of 10781 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2025-01-13 10:30:36 +01:00
Weblate
9e1b7ff760 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2025-01-13 10:30:36 +01:00
Daniel P. Berrangé
9ab2cd48ea access: fix po_check when polkit is disabled
The generated org.libvirt.api.policy.in file was recently added to the
POTFILES list as it contains translatable messages.

It is only generated when WITH_POLKIT && WITH_LIBVIRTD is satisfied
though, resulting in the 'po_check' syntax rule failing if either of
those conditions are not met.

It is harmless to unconditionally generate this file, as a separate
rule takes care of of installing it, and the latter remains under
the build conditions.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-13 09:35:16 +00:00
Laine Stump
7a903458f1 qemu: support vlan change for linux host bridge during update-device
Since we previously only supported vlan tagging for interfaces
connected to an OVS bridge [*], the code in qemuChangeNet() (used by
the update-device API) assumed an interface with modified vlan config
was on an OVS bridge, and would call the OVS-specific
virNetDevOpenvswitchUpdateVlan().

Now that we support vlan tagging for interfaces connected to a
standard Linux host bridge, we must check the type of connection and
only call the OVS function when connected to an OVS bridge *both
before and after the update*. Otherwise we just set the flag to
re-connect to the bridge, which has the side effect of redoing the
vlan setup.

([*] or an SRIOV VF assigned using VFIO, but we don't support *any
runtime changes to that type of netdev so it's irrelevant here.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-13 09:58:00 +01:00
Leigh Brown
f35bddae90 docs: standard linux bridges now support vlans
Update domain XML and network XML documentation to describe how
standard linux bridges support the VLAN configuration.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-01-11 20:09:51 -05:00
Pavel Hrdina
d51179fa82 qemu: snapshot: delete disk image only if parent snapshot is external
When we are deleting external snapshot that is not active we only need
to delete overlay disk image of the parent snapshot. This works
correctly even if parent snapshot is external and active as it will have
another overlay created when user reverted to that snapshot.

In case the parent snapshot is internal there are no overlay disk images
created as everything is stored internally within the disk image. In
this case we would delete the actual disk image storing internal
snapshots and most likely the original disk image as well resulting in
data loss once the VM is shutoff.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/734
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2025-01-10 18:57:16 +01:00
Jiri Denemark
30b0e553bc docs: Clarify documentation of host-model CPU mode
The host-model CPU mode was described as similar to copying the host CPU
definition from capabilities, which has not been the case for ages. The
host-model definition from domain capabilities is used instead.

Only the first sentence changed, but it required reformatting
essentially the whole paragraph so I used this as an opportunity to
reformat it a little bit more and split the long paragraph into several
smaller ones for better readability.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-01-09 15:40:25 +01:00
Jiri Denemark
4c7bb1cc4a po: Refresh potfile for v11.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2025-01-09 11:48:26 +01:00
Daniel P. Berrangé
caa10431cd util: don't attempt to acquire logind inhibitor if not requested
When VIR_INHIBITOR_WHAT_NONE is passed to virInhibitorNew, it is
an indication that daemon shutdown should be inhibited, but no
OS level inhibitors acquired. This is done by the virtnetworkd
daemon, for example, to prevent shutdown while running virtual
machines are present, without blocking / delaying OS shutdown.

Unfortunately the code forgot to skip the DBus call in this case,
resulting in errors being logged.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-09 09:24:20 +00:00
Daniel P. Berrangé
a28a5b675d rpc: log details of OS signals received by daemon
When debugging it is useful to know what signals are being received and
metadata related to them. Log this data before calling the signal
handling callbacks.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-09 09:23:44 +00:00
Jiri Denemark
a586411889 spec: Disable ch driver on RHEL
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-09 09:57:50 +01:00
Weblate
922a219d0a Translated using Weblate (Finnish)
Currently translated at 22.2% (2345 of 10555 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2025-01-08 23:20:00 +01:00
Ricky Tigg
1523cd3c6e Translated using Weblate (Finnish)
Currently translated at 22.1% (2343 of 10555 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2025-01-08 23:20:00 +01:00
Nicolas Gal
95a20d7aa5 Translated using Weblate (Spanish)
Currently translated at 47.9% (5065 of 10555 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-08 23:20:00 +01:00
Nicolas Gal
7c5e9e1bce Translated using Weblate (Spanish)
Currently translated at 47.7% (5045 of 10555 strings)

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

Signed-off-by: Nicolas Gal <snowcrash79@users.noreply.translate.fedoraproject.org>
2025-01-08 23:20:00 +01:00
Nicolas Gal
3aa8b9c700 Translated using Weblate (Spanish)
Currently translated at 47.6% (5027 of 10555 strings)

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

Signed-off-by: Nicolas Gal <snowcrash79@users.noreply.translate.fedoraproject.org>
2025-01-08 23:20:00 +01:00
Nicolas Gal
bc2bcd54c5 Translated using Weblate (Spanish)
Currently translated at 47.5% (5023 of 10555 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-08 23:20:00 +01:00
Nicolas Gal
1a5340d7f0 Translated using Weblate (Spanish)
Currently translated at 47.2% (4988 of 10555 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-08 23:20:00 +01:00
Nicolas Gal
16a4e3f9f8 Translated using Weblate (Spanish)
Currently translated at 46.8% (4950 of 10555 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-08 23:20:00 +01:00
Nicolas Gal
d0acf28d20 Translated using Weblate (Spanish)
Currently translated at 46.2% (4882 of 10555 strings)

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

Signed-off-by: Nicolas Gal <nialegal@yandex.com>
2025-01-08 23:20:00 +01:00
Ricky Tigg
4bc2b6c5ec Translated using Weblate (Finnish)
Currently translated at 22.1% (2341 of 10555 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2025-01-08 23:20:00 +01:00
Ricky Tigg
7803363339 Translated using Weblate (Finnish)
Currently translated at 21.9% (2321 of 10555 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2025-01-08 23:20:00 +01:00
Weblate
ebb90e7412 Translated using Weblate (Finnish)
Currently translated at 21.9% (2320 of 10555 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
2025-01-08 23:20:00 +01:00
Ricky Tigg
693feada8b Translated using Weblate (Finnish)
Currently translated at 21.9% (2320 of 10555 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>

Translated using Weblate (Finnish)

Currently translated at 21.9% (2314 of 10555 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2025-01-08 23:20:00 +01:00
Anders Jonsson
748008d602 Translated using Weblate (Swedish)
Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Anders Jonsson <anders.jonsson@norsjovallen.se>
2025-01-08 23:19:59 +01:00
Andi Chandler
1eda6c9b90 Translated using Weblate (English (United Kingdom))
Currently translated at 49.6% (5240 of 10555 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>

Translated using Weblate (English (United Kingdom))

Currently translated at 49.5% (5234 of 10555 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2025-01-08 23:19:59 +01:00
Göran Uddeborg
e1b63ac56b Translated using Weblate (Swedish)
Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 99.8% (10544 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 99.3% (10484 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 99.1% (10464 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 98.9% (10444 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 98.7% (10424 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2025-01-08 23:19:59 +01:00
Laine Stump
dd82e2baa8 qemu: allow migration of guest with mdev vGPU to VF vGPU
GPU vendors are moving away from using mdev to create virtual GPUs
towards using SRIOV VFs that are vGPUs. In both cases, once created
the vGPUs are assigned to guests via <hostdev> (i.e. VFIO device
assignment), and inside the guest the devices look identical, but mdev
vGPUs are located by QEMU/VFIO using a uuid, while VF vGPUs are
located with a PCI address. So although we generally require the
device on the source host to exactly match the device on the
destination host, in the case of mdev-created vGPU vs. VF vGPU
migration *can* potentially work, except that libvirt has a hard-coded
check that prevents us from even trying.

This patch loosens up that check so that we will allow attempts to
migrate a guest from a source host that has mdev-created vGPUs to a
destination host that has VF vGPUs (and vice versa). The expectation
is that if this doesn't actually work then QEMU will fail and generate
an error that we can report.

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Zhiyi Guo <zhguo@redhat.com>
Reviewed-by: Zhiyi Guo <zhguo@redhat.com>
2025-01-08 17:24:20 -05:00
Leigh Brown
c1a0d08518 Enable vlan support for standard linux bridges
Adjust domain and network validation to permit vlan configuration on
standard linux bridges.

Update calls to virNetDevBridgeAddPort to pass the vlan configuration.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-01-08 17:15:20 -05:00
Leigh Brown
582f0966f9 util: Add vlan support to virNetDevBridgeAddPort
Add virNetDevBridgeSetupVlans function to configure a bridge
interface using the passed virNetDevVlan struct.

Add virVlan parameter to the Linux version of virNetDevBridgeAddPort
and call virNetDevBridgeSetupVlans to set up the required vlan
configuration.

Update callers of virNetDevBridgeAddPort to pass NULL for now.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-01-08 17:04:27 -05:00
Leigh Brown
2e651ec101 util: add netlink bridge vlan filtering
Enable capability to add and remove vlan filters for a standard
linux bridge using netlink.

New function virNetlinkBridgeVlanFilterSet can be used to add or
remove a vlan filter to a given bridge interface.

Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
Reviewed-by: Laine Stump <laine@redhat.com>
2025-01-08 13:46:25 -05:00
Georgia Garcia
18ea5e19c6 apparmor: fix UUID specification
There is a common misconception when writing AppArmor policy that
[0-9]* applies * to the [0-9] class, but that's not the case. For this
example, [0-9]* matches a single digit followed by any number of
characters except for /

Create a UUID variable that uses the following format 8-4-4-4-12.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2025-01-08 10:46:14 -07:00
Georgia Garcia
a751d30220 security: replace uses of label and VIR_FREE by g_autofree
Moving towards full adoption of GLib APIs in the AppArmor code.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2025-01-08 10:46:14 -07:00
Georgia Garcia
76b9227eea security_apparmor: fix memleaks in AppArmorSetFDLabel
proc and fd_path are allocated but never freed. Fix by using
g_autofree instead.

Fixes: b9757fea30785a92aa95ea675b9bc371e4fb2e8c
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2025-01-08 10:46:14 -07:00
Praveen K Paladugu
c97766a639 spec: Enable ch driver
Enabling building and packaging ch driver in the spec file.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
2025-01-08 17:37:42 +00:00
Daniel P. Berrangé
d12e937f47 tools: fix ordering mistake in virt-admin daemon-set-timeout code
Most of the impl for the 'daemon-set-timeout' command was ordered under
the heading for the 'daemon-log-filters' command.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-08 13:00:44 +00:00
Daniel P. Berrangé
fc3a60d9d7 util: fix off-by-1 in inhibitor constants
The inhibitor constant values were off-by-1, so when converted into
string format, we picked the wrong names

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-07 16:16:16 +00:00
Stefan Hellermann
2ac1a0c13f meson: remove unneeded dependency on libdevmapper for storage_disk
In commit dfa0e11 the last direct usage of devmapper for storage_disk was
removed. There is one stale include remaining, which is unused even longer
since df1011ca. Remove the include and change meson.build so we can use
storage_disk without devmapper.

I'm running it right now with a stripped-down config on a small arm64
router with openwrt.

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-07 12:33:34 +01:00
Martin Kletzander
9df14f5173 conf: Adjust hyperv tlbflush formatting
Commit 247357cc292a added support for direct and extended modes for
tlbflush, but forgot to do the formatting as well.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-07 10:55:38 +01:00
Ján Tomko
ad6b4d1fef conf: refactor hyperv features formatting
Add a nested buffer for whatever sub-elements a particular
hyperv feature might have.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-07 10:55:38 +01:00
Adam Julis
91bb41a8b7 virtiofs: Allow read only mode
Resolves: https://issues.redhat.com/browse/RHEL-72192
Signed-off-by: Adam Julis <ajulis@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-07 10:25:02 +01:00
Jim Fehlig
d2a39db35b security: apparmor: Remove hardcoded "libvirtd" profile name
The apparmor driver probe function checks for an active profile matching
the full path of the running daemon binary. If not found, it checks for
a profile named "libvirtd". This works fine when the running daemon is the
old monolithic libvirtd, but fails with modular daemons.

Remove the check for a hardcoded "libvirtd" profile and replace with the
basename of the running daemon binary.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-06 14:59:10 -07:00
Daniel P. Berrangé
6d3b877171 remote: apply translations to polkit files
The 'description' and 'message' fields in polkit policy files should be
translated into the user's chosen language. xgettext is told to search
in both and source and build dirs by meson.

Unfortunately a bug in xgettext means that when it searches for built
files in XML format, it'll trigger a warning message due to failure to
load the generated file from the source dir:

  xgettext: cannot read ..snip../libvirt/src/access/org.libvirt.api.policy: failed to load external entity "..snip../libvirt/src/access/org.libvirt.api.policy"

This is harmless since it then goes on to try the build dir and
succeeds, but will pollute the output of 'ninja libvirt-pot'

Related: https://gitlab.com/libvirt/libvirt/-/merge_requests/387
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-06 18:58:44 +00:00
Daniel P. Berrangé
c244d041d9 meson: remove duplication of polkit dirs construction
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-06 18:58:42 +00:00
Daniel P. Berrangé
b996e99c51 po: add its rules for translating polkit file strings
xgettext / msgfmt have generic support for extracting / merging strings
in XML files, however, they need to be told something about the schema
to know which fields are translatable. This is done by providing 'its'
rules. Usually the 'its' rules would be shipped in a -devel package of
the app which owns the schema definition, but polkit does not do this.
Thus libvirt (and other apps) must ship their own local 'its' rules for
polkit.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-01-06 18:58:31 +00:00
Marc-André Lureau
062a2c07cc qemu_tpm: do not delete parent directory for custom source
When the vTPM source path is specified, such as:
   <source type=".." path="/my/tpm"/>

Do not delete the parent directory, but only the given file/dir.

Fixes: commit f1304cc566 ("qemu_tpm: handle file/block storage source")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-06 15:58:42 +01:00
Marc-André Lureau
958283a21f qemu_tpm: lock the state explicitly when running swtpm
Commit bb5e26749fe5b ("qemu: explicit swtpm state locking") attempted to
lock the state, but only for swtpm-setup. The capability
"tpmstate-opt-lock" is actually only exposed by swtpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-06 15:58:29 +01:00
Marc-André Lureau
90014e7bc4 Revert "qemu: explicit swtpm state locking"
This reverts commit bb5e26749fe5b5856a3541be2cbe147701e6e121.

swtpm-setup doesn't have "tpmstate-lock", only swtpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-01-06 15:58:15 +01:00
Michal Privoznik
18b8e6d3cc hyperv: Introduce and export 'facility' variable.
In its upstream commit [1] openwsman dropped 'facility' variable
which is documented as:

 * all processes that use the libu must define a "facility" variable somewhere
 * to satisfy this external linkage reference.
 *
 * Such variable will be used as the syslog(3) facility argument.

Well, prior to that commit, openwsman itself declared the
variable (and set it to LOG_DAEMON). Now it's up to us.

Yeah, the variable naming is terrible and also I we are not using
libu directly, but apparently libwsman.so requires it anyway:

  $ objdump -T /usr/lib64/libwsman.so | grep facility
  0000000000000000      D  *UND*  0000000000000000  Base        facility

1: d72c51f21b
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2025-01-06 14:21:18 +01:00
Xianglai Li
a91b22ffc6 apparmor: Allow running loongarch64 VMs
Allows to load firmware in the qemu-efi-loongarch64 directory
Allows the binary qemu-system-loongarch64 to be run

This makes it possible to run loongarch64 VMs when AppArmor
is enabled

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2025-01-02 13:48:12 +01:00
Martin Kletzander
247357cc29 qemu: Add support for direct and extended tlbflush features
They require special handling since they are dependent on the basic
tlbflush feature itself and therefore are not handled automatically as
part of virDomainHyperv enum, just like the stimer-direct feature.

Resolves: https://issues.redhat.com/browse/RHEL-7122
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-26 10:46:59 +01:00
Martin Kletzander
ac08b362da conf, docs: Add support for direct and extended tlbflush features
Similarly to stimer-direct these are subelements of <tlbflush/> in the
domain XML.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-26 10:46:59 +01:00
Praveen K Paladugu
f7c33eeeb7 ch: Enable logging curl responses from ch
Log curl responses from cloud-hypervisor process during Boot request, using
domain's logContext.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-20 16:24:58 +01:00
Praveen K Paladugu
db4e837598 ch: move curl_data and curl_callback definitions
Move the definitions of curl_data and curl_callback to be used
within virCHMonitorPutNoContent.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-20 16:24:58 +01:00
Praveen K Paladugu
72a9a91e3b ch: Enable logging for ch domains
Use domainLogContext to enable logging for ch domain process during create
and restore steps.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-20 16:24:58 +01:00
Praveen K Paladugu
334d2f604c hypervisor: Move QEMU log context to hypervisor
While doing so, also drop QEMU specific arguments from
domainLogContextNew() and replace them with hypervisor agnostic
ones.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-20 16:24:58 +01:00
Daniel P. Berrangé
94b393dd6e util/xml: open XML files before calling libxml2
Libxml2 has awful error reporting behaviour when reading files. When
we fail to load a file from the test driver we see:

  $ virsh -c test:///wibble.xml
  I/O warning : failed to load external entity "/wibble.xml"
  error: failed to connect to the hypervisor
  error: XML error: failed to parse xml document '/wibble.xml'

where the I/O warning line is something printed by libxml2 itself,
which also lacks any useful detail.

Switching to our own file reading code we can massively improve
things:

  $ ./build/tools/virsh -c test:///wibble.xml
  error: failed to connect to the hypervisor
  error: Failed to open file '/wibble.xml': No such file or directory

Using 10 MB as an upper limit on XML file size ought to be sufficient
for any XML files libvirt is reading.

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-20 10:00:22 +00:00
Daniel P. Berrangé
7f2fd38ee7 util/xml: don't assume libxml2 has the filename of the document
The libxml2 error handling gets the filename from a libxml2 struct, but
it is better to not assume libxml2 knows the filename being parsed, as
we might have simply provided it a pre-loaded string.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-20 10:00:22 +00:00
Daniel P. Berrangé
0635cd9555 util/xml: fix extraction of XML context
Currently given an input of '<dom\n' we emit an error:

  error: Failed to define domain from tests/qemuxmlconfdata/broken-xml-invalid.xml
  error: at line 2: Couldn't find end of Start Tag dom line 1
  (null)
  ^

With this fix we emit:

  error: Failed to define domain from tests/qemuxmlconfdata/broken-xml-invalid.xml
  error: at line 2: Couldn't find end of Start Tag dom line 1
  <dom
  ----^

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-20 10:00:22 +00:00
Daniel P. Berrangé
f7cbb136c3 src: drop obsolete checks for virDomainConfigFile failure
This cannot ever return NULL

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-20 09:58:37 +00:00
Daniel P. Berrangé
8575724aef rpc: remove logind support for virNetDaemon
The virNetDaemon code now only concerns itself with preventing auto
shutdown of the local daemon. Logind is now handled by the new
virInhibitor object, for QEMU, LXC and LibXL. This fixes two notable
bugs

 * Running virtual networks would prevent system shutdown
 * Loaded ephemeral secrets would prevent system shutdown

Fixes 9e3cc0ff5e81ed2056a6a528893fd2cb5609d70b
Fixes 37800af9a400385801da6d73654249fdb51a93d8
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-19 18:03:20 +00:00
Daniel P. Berrangé
48f0b6dfa1 src: convert drivers over to new virInhibitor APIs
This initial conversion of the drivers switches them over to use
the virInhibitor APIs in local daemon only mode. Communication to
logind is still handled by the virNetDaemon class logic.

This mostly just replaces upto 3 fields in the driver state
with a single new virInhibitor object, but otherwise should not
change functionality besides replacing atomics with mutex protected
APIs.

The exception is the LXC driver which has been trying to inhibit
shutdown shutdown but silently failing to, since nothing ever
remembered to set the 'inhibitCallback' pointer in the driver
state struct.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-19 18:03:15 +00:00
Daniel P. Berrangé
d2e5aa4f4e util: introduce object for holding a system inhibitor lock
The system inhibitor locks are currently handled by code in the
virNetDaemon class. The driver code invokes a callback provided
by the daemon when it wants to start or end inhibition.

When the first inhibition is started, the daemon will call out
to logind to apply it system wide.

This has many flaws

 * A single message is registered with logind regardless of
   what driver holds the inhibition
 * An inhibition of daemon shutdown can't be acquired
   without also inhibiting system shutdown
 * Config of the inhibitions cannot be tailored by the
   driver

The new virInhibitor object addresses these:

 * The object directly manages an inhibition with logind
   privately to the driver, enabling custom messages to
   be set.
 * It is possible to acquire an inhibition locally to the
   daemon without forwarding it to logind.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-19 18:03:04 +00:00
Jiri Denemark
a0a8c95d07 cpu_map: Add missing CPU features
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:05 +01:00
Jiri Denemark
3d55a2e593 cpu_map: Add ibpb-brtype CPU feature
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:05 +01:00
Jiri Denemark
2284e8c29b cpu_map: Add zero-fcs-fds CPU feature
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:05 +01:00
Jiri Denemark
dc12ca3949 cpu_map: Add fdp-excptn-only CPU feature
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:05 +01:00
Jiri Denemark
212b7d8e28 cpu_map: Add sha512, sm3, and sm4 CPU features
Introduced by Clearwater Forest platform.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:05 +01:00
Jiri Denemark
41a6de76bc cpu_map: Add GraniteRapids-v2 CPU model
Introduced by QEMU 9.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:04 +01:00
Jiri Denemark
30f05acf35 cpu_map: Add avx10* CPU features
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:24:04 +01:00
Jiri Denemark
060fd63c26 qemu: Call migrate-incoming with exit-on-error=false
The exit-on-error=false argument of migrate-incoming tells the QEMU
process to keep running when incoming migration fails, which helps us in
two ways:

1. When migration enters Finish phase to cleanup the process, the domain
   might not even exist on the destination (because it has already been
   cleaned up by EOF monitor callback) and we would get rather unhelpful
   "operation failed: domain is no longer running" error message.

2. We can get the error that caused incoming migration to fail directly
   from QEMU via query-migrate QMP command.

https://issues.redhat.com/browse/RHEL-7041

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:21:21 +01:00
Jiri Denemark
090a2f27c2 qemu: Replace qemuDomainCheckMonitor with qemuMigrationJobCheckStatus
The function is only used during incoming migration in the beginning of
Finish phase to detect if QEMU already died but EOF handler haven't had
a chance to do its job yet. It calls query-status QMP command, but
ignores the result. By calling query-migrate instead we can achieve the
same functionality if QEMU is dead and even get meaningful error from
"error-desc" in case the incoming migration failed and QEMU is still
running.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:21:21 +01:00
Jiri Denemark
3100f43a1d qemu: Detect exit-on-error argument of migrate-incoming
The exit-on-error argument (added in QEMU 9.1.0) can be used to tell
QEMU not to exit when incoming migration fails so that the error can be
retrieved via QMP. This patch adds a new capability bit indicating
support for the new argument.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-19 15:21:21 +01:00
Michal Privoznik
9636ac40a3 qemu_capabilities: Avoid memleak in virQEMUCapsProbeFullDeprecatedProperties()
As one of its arguments, the
virQEMUCapsProbeFullDeprecatedProperties() gets a pointer to
GStrv (a string list), which it may eventually replace. It's
single caller (virQEMUCapsProbeQMPHostCPU()) passes a string list
indeed. Now, when replacing one string list with another plain
g_free() is not enough as we need to free individual strings too.

==13573== 34 bytes in 8 blocks are definitely lost in loss record 271 of 576
==13573==    at 0x4844878: malloc (vg_replace_malloc.c:446)
==13573==    by 0x51789D1: g_malloc (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573==    by 0x5193E82: g_strdup (in /usr/lib64/libglib-2.0.so.0.7800.6)
==13573==    by 0x4997F73: g_strdup_inline (gstrfuncs.h:321)
==13573==    by 0x4997F73: virJSONValueArrayToStringList (virjson.c:1296)
==13573==    by 0x5027CF7: qemuMonitorJSONParseCPUModelExpansion (qemu_monitor_json.c:5139)
==13573==    by 0x50281C9: qemuMonitorJSONGetCPUModelExpansion (qemu_monitor_json.c:5245)
==13573==    by 0x501044F: qemuMonitorGetCPUModelExpansion (qemu_monitor.c:3261)
==13573==    by 0x4F190D0: virQEMUCapsProbeQMPHostCPU (qemu_capabilities.c:3227)
==13573==    by 0x4F2145E: virQEMUCapsInitQMPMonitor (qemu_capabilities.c:5758)
==13573==    by 0x10FFF8: testQemuCaps (qemucapabilitiestest.c:111)
==13573==    by 0x110B53: virTestRun (testutils.c:143)
==13573==    by 0x11063E: doCapsTest (qemucapabilitiestest.c:200)

Fixes: 51c098347d7f2af9b4386ac0adc4431997d06f3d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2024-12-19 09:14:53 +01:00
Michal Privoznik
0162f2008e qemu: Enable I/O APIC even more frequently
In my previous commit v10.10.0-48-g2d222ecf6e I've made us enable
I/O APIC when there is an IOMMU with EIM. This works well. What
does not work is case when there's just an IOMMU without EIM but
with 256+ vCPUS. Problem is that post parsing happens in two
stages: general domain post parse (where
qemuDomainDefEnableDefaultFeatures() is called) and then per
device post parse (where qemuDomainIOMMUDefPostParse() is
called). Now, in aforementioned case it is the device post parse
phase where EIM is enabled but the code that would enable
VIR_DOMAIN_FEATURE_IOAPIC has already run.

To resolve this, make the domain post parse callback "foresee"
the future enabling of EIM so that it can turn on I/O APIC
beforehand.

Resolves: https://issues.redhat.com/browse/RHEL-65844
Fixes: 2d222ecf6e73614a400b830ac56e9aaa1bc55ecc
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-18 15:27:12 +01:00
Daniel P. Berrangé
ef7c0f46f9 rpm: ensure we own directories we might create
An RPM must own any directories its creates, unless it can guarantee a
dependancy has ownership. Two packages owning the same directory is fine
if permissions are consistent.

We don't require augeas as a dep in most packages, so we must own the
augeas lens directories. Likewise for systemtap tapset dirs.

Our own cpu map dir also needs ownership.

A few files are re-sorted, so that the files are listed immediately
adjacent to the %dir that contains them.

https://bugzilla.redhat.com/show_bug.cgi?id=2280979
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-17 11:20:53 +00:00
Jiri Denemark
9e227634d3 Fix a few typos in error messages
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/722
Reported-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-17 12:16:19 +01:00
Collin Walling
62658bbf06 conf: add deprecated_features attribute
Add a new a attribute, deprecated_features='on|off' to the <cpu>
element.  This is used to toggle features flagged as deprecated on the
CPU model on or off.  When this attribute is paired with 'on',
deprecated features will not be filtered.  When paired with 'off', any
CPU features that are flagged as deprecated will be listed under the
CPU model with the 'disable' policy.

Example:

  <cpu mode='host-model' check='partial' deprecated_features='off'/>

The absence of this attribute is equivalent to the 'on' option.

The deprecated features that will populate the domain XML are the same
features that result in the virsh domcapabilities command with the
--disable-deprecated-features argument present.

It is recommended to define a domain XML with this attribute set to
'off' to ensure migration to machines that may outright drop these
features in the future.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
15d45964e4 virsh: add --disable-deprecated-features flag to domcapabilities
Add a new flag, --disable-deprecated-features, to the domcapabilities
command.  This will modify the output to show the 'host-model' CPU
with features flagged as deprecated paired with the 'disable' policy.

virsh domcapabilities --disable-deprecated-features

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
cd1e837c22 qemu_capabilities: filter deprecated features if requested
If flag VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES
is passed to qemuConnectGetDomainCapabilities, then the domain's CPU
model features will be updated to set any deprecated features to the
'disabled' policy.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
4e2c8de204 libvirt-domain: introduce VIR_CONNECT_GET_DOMAIN_CAPABILITIES_DISABLE_DEPRECATED_FEATURES
Introduce domain flag used to filter deprecated features from the
domain's CPU model.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
51c098347d qemu_capabilities: query deprecated features for host-model
Add QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRECATED_PROPS for detecting
if query-cpu-model-expansion can report deprecated CPU model properties.
QEMU introduced this capability in 9.1 release.  Add flag and deprecated
features to the capabilities test data for QEMU 9.1 and 9.2 replies/XML
since it can now be accounted for.

When probing for the host CPU, perform a full CPU model expansion to
retrieve the list of features deprecated across the entire architecture.
The list and count are stored in the host's CPU model info within the
QEMU capabilities.  Other info resulting from this query (e.g. model
name, etc) is ignored.

The new capabilities flag is used to fence off the extra query for
architectures/QEMU binaries that do not report deprecated CPU model
features.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
45140d2930 qemu: parse deprecated-props from query-cpu-model-expansion response
query-cpu-model-expansion may report an array of deprecated properties.
This array is optional, and may not be supported for a particular
architecture or reported for a particular CPU model. If the output is
present, then capture it and store in a qemuMonitorCPUModelInfo struct
for later use.

The deprecated features will be retained in qemuCaps->kvm->hostCPU.info
and will be stored in the capabilities cache file under the <hostCPU>
element using the following format:

        <deprecatedFeatures>
                <property name='bpb'/>
                <property name='csske'/>
                <property name='cte'/>
                <property name='te'/>
        </deprecatedFeatures>

At this time the data is only queried, parsed, and cached.  The data
will be utilized in a subsequent patch.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Collin Walling
60e407deb5 qemuMonitorJSONGetCPUModelExpansion: refactor parsing functions
Refactor the CPU Model parsing functions within
qemuMonitorJSONGetCPUModelExpansion.  The new functions,
qemuMonitorJSONParseCPUModelExpansionData and
qemuMonitorJSONParseCPUModelExpansion invoke the functions they
replace and leave room for a subsequent patch to handle parsing the
(optional) deprecated_props field resulting from the command.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-17 11:45:50 +01:00
Michal Privoznik
2d222ecf6e qemu: Enable I/O APIC if needed
This is a follow up of my previous commits. If the number of
vCPUs exceeds some arbitrary value (255) then QEMU requires IOMMU
with EIM and intremap enabled. But in turn, intremap IOMMU
requires split I/O APIC (per virDomainDefIOMMUValidate()). Since
after my previous commits (e.g. v10.10.0-rc1~183) IOMMU is added
automagically, the I/O APIC can be also enabled automagically.

Relates to: https://issues.redhat.com/browse/RHEL-65844
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-12-16 15:43:16 +01:00
Alexander Kuznetsov
99474f8e50 logging: Change return type of virLogDaemonConfigFilePat to void
This function return value is invariant since 18f3771, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-16 11:28:21 +01:00
Alexander Kuznetsov
0e1a848733 util: Change return type of virSCSIVHostDeviceSetUsedBy to void
This function return value is invariant since 18f3771, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-16 11:28:21 +01:00
Alexander Kuznetsov
20afcd4b14 util: Change return type of virSCSIDeviceSetUsedBy to void
This function return value is invariant since 18f3771, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-16 11:28:21 +01:00
Alexander Kuznetsov
ed8eec073f util: Change return type of virPCIDeviceSetUsedBy to void
This function return value is invariant since 18f3771, so change
its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-16 11:28:21 +01:00
Laine Stump
4e987a86b5 qemu: re-use existing ActualNetDef for more interface types during update-device
For the full history behind this patch, look at the following:

   https://issues.redhat.com/browse/RHEL-7036
   commit v10.7.0-101-ga37bd2a15b
   commit v10.8.0-rc2-8-gbcd5ae4e73

Summary: original problem was unexpected failure of update-device when
the user hadn't changed anything other than online status of the guest
NIC (which should always be allowed).

The first commit "fixed" this by avoiding the allocation of a new
ActualNetDef (i.e. creating a new networkport) for *all* network
device updates (because that was inappropriately changing which
ethernet physdev should be used for a macvtap connection, which by
design can't be handled in an update-device).

But this commit caused a regression for update-device of bridge-based
network devices (because some the updates of certain attributes *do*
require the ActualNetDef be re-allocated), so...

The 2nd commit narrowed the list of network types that get the "don't
allocate new ActualNetDef" treatment (so that only interfaces
connected to a network that uses a pool of ethernet VFs *being used in
passthrough mode* qualify).

But then it was pointed out that this re-broke simple updates of
devices that used a direct/macvtap network in "bridge" mode (because
it's possible to list multiple physdevs to use for bridge mode, in
which case the network driver attempts to "load balance" (and so a new
allocation might have a different ethernet physdev which, again, can't
be supported in a device-update).

So this (single line of code) patch *widens* the list of network types
that don't allocate a new ActualNetDef to also include the other
direct (macvtap) modes, e.g. bridge, private, etc.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 11:44:05 -05:00
Alexander Kuznetsov
2195037265 util: virsysinfo: Change return type of functions that never fail to void
These functions return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Alexander Kuznetsov
abd9887b6c hyperv: Change return type of hypervCheckParams to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Alexander Kuznetsov
f3179d5abe rpc: Change return type of virNetClientAddStream to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Alexander Kuznetsov
b0da352c58 rpc: Change return type of virNetClientAddProgram to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Alexander Kuznetsov
5afe228ea7 rpc: Change return type of virNetServerAddProgram to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Alexander Kuznetsov
393b0471a7 access: Change return type of virAccessDriverStackAppend to void
This function return value is invariant since VIR_EXPAND_N check
removal in 7d2fd6e, so change its type and remove all dependent checks.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Reported-by: Pavel Nekrasov <p.nekrasov@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-13 16:20:44 +01:00
Jiri Denemark
da2439b746 cpu_map: Add EPYC-Genoa-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:59 +01:00
Jiri Denemark
9bc479a3c0 cpu_map: Add Opteron_G5-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
d092730fb4 cpu_map: Add Opteron_G4-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
422d90dc56 cpu_map: Add Opteron_G3-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
51ffa44fb4 cpu_map: Add Opteron_G2-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
a1625b73f6 cpu_map: Add Opteron_G1-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
332136e49a cpu_map: Add phenom-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
6b775a68ec cpu_map: Add athlon-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
8f5e36cbce cpu_map: Add KnightsMill-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:58 +01:00
Jiri Denemark
537f136549 cpu_map: Add Penryn-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
2d061eba8c cpu_map: Add Conroe-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
6d25eafaec cpu_map: Add kvm64-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
2c6a015a7f cpu_map: Add qemu64-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
4a8259b5a3 cpu_map: Add kvm32-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
d9b23d77c0 cpu_map: Add qemu32-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
a3cab1ae67 cpu_map: Add core2duo-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
c9fa77bfe8 cpu_map: Add n270-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
ae14b20aaa cpu_map: Add coreduo-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
886fd169c5 cpu_map: Add pentium3-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:57 +01:00
Jiri Denemark
df34ae48e9 cpu_map: Add pentium2-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
70a4ec29a7 cpu_map: Add pentium-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
2abf6bd47c cpu_map: Add 486-v1 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
8bc6ebb495 sync_qemu_models_i386: Generate missing -v1 variants
QEMU supports -v1 variant of any CPU model even though the list of
versions is not defined (i.e., even if { .version = 1 } item is
missing).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
19b56603c4 sync_qemu_models_i386: Update meson.build
When adding new CPU models to CPU map it's easy (and very common) to
forget to add the new files to meson.build. We already update index.xml
with the new models so updating meson.build too makes sense.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
50c6d727b6 cpu_map: Sort data files in meson.build
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:41:56 +01:00
Jiri Denemark
b1725fbfb8 virsh: Fix --timeout option of migrate command
When starting a migration with --timeout, we create a thread to call the
migration API and in parallel setup a timer for the timeout. The
description of --timeout says: "run action specified by --timeout-*
option (suspend by default) if live migration exceeds timeout", which is
not really the way this feature was implemented. Before live migration
starts we first need to contact the source to get the domain definition
and send it to the destination where a new QEMU process has to be
started. This can take some (unpredictably long) time while the timeout
timer is already running. If a very short timeout is set (which doesn't
really make sense, but it's allowed), we may even end up taking the
timeout action before the actual migration had a chance to start.

With this patch the timeout is started only after we get non-zero
dataTotal from virDomainGetJobInfo, which means the migration (of either
storage or memory) really started.

https://issues.redhat.com/browse/RHEL-41264

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-13 14:37:21 +01:00
Michal Privoznik
6cc93bf288 qemu: Grab a QUERY job when formatting domain XML
It may happen that, for instance after daemon restart, that one
thread is still in qemuProcessReconnect(), i.e. filling in
runtime information by talking to QEMU on monitor. If another
thread then tries to format domain XML (which is currently
guarded by plain mutex on virDomainObj) it'll produce incomplete
and misleading information (e.g. current size of virtio-mem).
This happens because the reconnecting thread talks to QEMU on
monitor and thus unlocks the domain object frequently allowing
the XML formatting thread to acquire the mutex meanwhile.

Resolves: https://issues.redhat.com/browse/RHEL-71042
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-12-12 14:46:25 +01:00
Praveen K Paladugu
56d448ad0f ch: Enable user aliases
Enable parsing user aliases in ch driver.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-12-12 11:08:47 +01:00
Ján Tomko
81da7a2c2a qemu: tpm: do not update profile name for transient domains
If we do not have a persistent definition, there's no point in
looking for it since we cannot store it.

Also skip the update if the tpm device(s) in the persistent
definition are different.

This fixes the crash when starting a transient domain.

https://issues.redhat.com/browse/RHEL-69774
https://gitlab.com/libvirt/libvirt/-/issues/715

Fixes: d79542eec669eb9c449bb8228179e7a87e768017
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-12-11 20:10:43 +01:00
Heinrich Schuchardt
c63bdd17b9 virt-aa-helper: allow riscv64 EDK II
Debian has packaged EDK II for 64-bit RISC-V in directory
/usr/share/qemu-efi-riscv64/.

For usage with libvirt update the AppArmor helper.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-12-10 09:39:53 +01:00
Peter Krempa
daa560858b qemuDomainDiskChangeSupportedIothreads: Change error wording to fix grammar
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-12-10 08:54:29 +01:00
Daniel P. Berrangé
300362421e rpm: replace 'git' with 'git-core'
We don't need the full git package, git-core is sufficient and a smaller
build root install.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-05 09:43:22 +00:00
Daniel P. Berrangé
57835f432f qemu: enable QEMU core dump by default on Linux
The Linux MADV_DONTDUMP flag was added to Linux kernels > 3.3,
back in 2012, and the dump-guest-core flag was added to QEMU
> 1.0 at the same time.

IOW, on Linux we have long been able to assume that QEMU core
dumps will exclude guest memory, unless the user has overridden
the host level defaults in the domain XML.

It is desirable to permit QEMU core dumps out of the box to make
it easier for users to report crashes to their OS vendor without
having to reconfigure and restart libvirt daemons and their
running guests.

While there is a risk that an admin may have set 'dump_guest_core'
to true, while leaving 'max_core' to 0, on balance the benefits
of easier troubleshooting outweigh the risk of changing the
defaults to permit core dumps.

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-12-05 09:42:37 +00:00
Leigh Brown
dd217cd938 lxc: remove no longer working netns check
Since iproute2 v6.12.0, the command "ip link set lo netns -1" can
no longer be used to check for netns support, as it now validates
PIDs are not less than zero.

Since every kernel we care about has the support, just remove the
check.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Leigh Brown <leigh@solinno.co.uk>
2024-12-05 09:32:44 +00:00
Jiri Denemark
dba710374d util: Fix typo in virNetDevOpenvswitchInterfaceSetQos
The typo is causing virtqemud to crash when starting a domain with ovs
bridge interface and QOS.

https://issues.redhat.com/browse/RHEL-69840

Fixes: a3b8753db975d8b92b122ccc7daee986974f8b18
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-12-04 16:27:00 +01:00
Jiri Denemark
be784aa513 Post-release version bump to 11.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-02 13:20:38 +01:00
Jiri Denemark
7e5641bbc0 Release of libvirt-10.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-12-02 13:16:51 +01:00
Göran Uddeborg
94338f1375 Translated using Weblate (Swedish)
Currently translated at 98.3% (10383 of 10555 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Translated using Weblate (Swedish)

Currently translated at 98.1% (10364 of 10555 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-30 23:38:37 +01:00
Ján Tomko
b0a782f708 docs: document external swtpm
When external swtpm support was added back in 9.0.0, I omitted
the update of the XML docs.

Add it now, especially since the 'emulator' backend can now
also use the <source> element.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-11-28 14:40:50 +01:00
Göran Uddeborg
984f6bb43f Translated using Weblate (Swedish)
Currently translated at 97.9% (10343 of 10555 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-28 12:22:58 +01:00
김인수
349ea8669c Translated using Weblate (Korean)
Currently translated at 100.0% (10555 of 10555 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>

Translated using Weblate (Korean)

Currently translated at 99.7% (10526 of 10555 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2024-11-28 12:22:57 +01:00
Michal Privoznik
304b93dbb5 NEWS: Document features/improvements/bug fixes I've participated in
There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 12:18:52 +01:00
Peter Krempa
f850c2a569 virschematest: Don't skip all "directory" tests
Due to a bug in the optimization to avoid testing symlinked tests
multiple times all tests were skipped.

In commit f997fcca71a16b102e6ee663 I made an attempt to optimize the
tests by avoiding testing symlinks. This optimization was buggy as I've
passed the 'd_name' field of 'struct dirent' which is just the filename
to 'g_lstat()'. 'g_lstat()' obviously always failed with ENOENT. As the
logic checked only for successful return of 'g_lstat()' the optimizatio
was a dud.

Now in 4d8ebbfee83edb2 the 'g_lstat()' call was replaced by
'virFileIsLink()' checking all non-zero values. This meant that if
'virFileIsLink()' failed the test was skipped. Now since a bad argument
was passed this failed always and thus was always skipped making
'virschematest' useless.

Fix it by passing the full path of the test and also explicitly check
for '1' return value instead of any non-zero.

Fixes: f997fcca71a16b102e6ee663a3fb86bed8de9d7d
Fixes: 4d8ebbfee83edb26b19a62465b9f98d0126db991
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-28 10:28:49 +01:00
Peter Krempa
99dadf9e08 schemas: domaincaps: Add schema for CPU 'blockers'
Due to broken 'virschematest' commit f4dc248a952aaebcc793c7809c6c083d9
forgot to introduce schema for the new element.

Fixes: f4dc248a952aaebcc793c7809c6c083d9cc30d0c
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-28 10:28:49 +01:00
Peter Krempa
fcd9b78863 schemas: domaincaps: Add schema for 'canonical' cpu model name
Due to 'virschematest' being broken commit fff2bbee7feb0fdfbf40aac4fe9
forgot to add schema for the new attribute.

Fixes: fff2bbee7feb0fdfbf40aac4fe9efd070f72ce9e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-28 10:28:49 +01:00
Peter Krempa
5e514c6733 schemas: domaincaps: Add schema for 'panic' device
Due to 'virschematest' being broken commit a52cd504b3618c67abf3a07c669
introduced a new element to the domain caps but didn't add schema for
it.

Fixes: a52cd504b3618c67abf3a07c669fd5e5ab18aa50
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-28 10:28:49 +01:00
Peter Krempa
2704648936 schemas: domain: Make <identity> subelement of NFS disk source optional
Both the 'user' and 'group' attribute are optional so <identity> can
be empty. Allow it to be omitted completely. The parser and qemu code
can handle that.

The schema was introduced in 943871f971d680f72726a9d6e9330eec264f6588
and in d018c8dc9ebcd0496c7a564bc2e8b1c9cbd8d96f an offending test was
added.

Fixes: 943871f971d680f72726a9d6e9330eec264f6588
Fixes: d018c8dc9ebcd0496c7a564bc2e8b1c9cbd8d96f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-28 10:28:49 +01:00
Peter Krempa
0bd01ef765 NEWS: Mention qcow2 'data-file', block NVRAM, and internal snapshot reversion
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:28:44 +01:00
Peter Krempa
976300fdf4 qemuDomainGetStorageSourceByDevstr: Lookup also '<dataStore>'
The <dataStore> volumes have their own 'id' so we need to be able to
look them up for the given image chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:56 +01:00
Peter Krempa
515ed143ec qemuDomainVirStorageSourceFindByNodeName: Match also '<dataStore>' sources
As the source for the data file is a completely separate
virStorageSource including it's own index we need to match it
explicitly, so that code such as storage threshold events work properly
and separately for the data file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:56 +01:00
Peter Krempa
71935d4972 qemuDomainVirStorageSourceFindByNodeName: Extract nodename matching
Extract the matching of the node name of a single virStorage source so
that the logic can be reused in the upcoming patch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:56 +01:00
Peter Krempa
2a9349c8e8 qemu: snapshot: Change 'data-file' to read-only after snapshot
For the reason outlined in previous commit qemu doesn't do this
automatically. Handle it manually after the snapshot.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:56 +01:00
Peter Krempa
754ca45c45 qemu: block: Ensure that <dataStore> is in appropriate state
In contrast to normal backing chain members where qemu does honour the
'auto-read-only' property the 'data-file' nodes are not automatically
reopened by qemu. Libvirt now has the infrastructure to reopen them
explicitly so use it for all transitions of the 'commit' block job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:56 +01:00
Peter Krempa
ed656f4c8f qemuBlockReopenAccess: Don't require backing chain terminator for non-chained images
Add an exception for image formats not supporting backing images so that
they can be reopened RW/RO without the need for adding a terminating
virStorageSource as they simply can't have a backing image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:55 +01:00
Peter Krempa
b83e87ca78 qemuBlockReopenAccess: Fix update of 'readonly' state
Refactors done in 24b667eeed78d2df (and also 9ec0e28e876b17df9)
broke the expected handling of the update of 'readonly' flag of a
virStorage. The source is actually set to the proper state but rolled
back to the previous state as the 'cleanup' label should have been
'error' and thus not reached on success.

Additionally some of the code paths violate the statement in the comment
after updating 'readonly' that only 'goto error' must be used.

Fixes: 24b667eeed78d2df0376a38a592ed9d8c2744bdc
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:55 +01:00
Peter Krempa
b510f8ca8a qemuBlockReopenAccess: Add debug log entry about state of the image
Log the node name and current and expected state to simplify debugging.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-28 10:27:55 +01:00
Michal Privoznik
c4d6bd3bf5 qemu: Validate QoS values in qemuDomainSetInterfaceParameters()
This is similar to one of my previous commits (v10.7.0-rc1~22)
which introduced a check that <bandwidth/> values fit into
certain limits. My original commit validated values when parsing
<bandwidth/> XML, but completely missed the case when values are
set over virDomainSetInterfaceParameters() API.

Solution is simple - just perform validation after bandwidth
structure is reconstructed from arguments passed to the API.

Resolves: https://issues.redhat.com/browse/RHEL-65372
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-27 15:11:13 +01:00
Jiri Denemark
9b55a130b7 NEWS: Document support for versioned CPU models
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-27 14:51:05 +01:00
Jiri Denemark
c0b6774d50 cpu: Check blockers in virCPUCompareUnusable only if they exist
virCPUCompareUnusable can be called with blockers == NULL in case the
CPU model itself is usable (i.e., QEMU reports an empty list of
blockers), but the CPU definition contains some additional features
which have to be checked.

Fixes: v10.8.0-129-g5f8abbb7d0
Reported-by: Han Han <hhan@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Tested-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-27 14:50:44 +01:00
Weblate
444f45135a 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2024-11-26 15:30:12 +01:00
Jiri Denemark
b35d559d6c po: Refresh potfile for v10.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-26 15:26:38 +01:00
Göran Uddeborg
68aaadd3a4 Translated using Weblate (Swedish)
Currently translated at 98.0% (10325 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-26 15:13:19 +01:00
Laine Stump
e9e5ebe6a6 network: add tc filter rule to nftables backend to fix checksum of DHCP responses
Please see the commit log for commit v10.9.0-rc1-1-g42ab0148dd for the
history and explanation of the problem that this patch is fixing.

A shorter explanation is that when a guest is connected to a libvirt
virtual network using a virtio-net adapter with in-kernel "vhost-net"
packet processing enabled, it will fail to acquire an IP address from
a DHCP seever running on the host.

In commit v10.9.0-rc1-1-g42ab0148dd we tried fixing this by *zeroing
out* the checksums of these packets with an nftables rule (nftables
can't recompute the checksum, but it can set it to 0) . This
*appeared* to work initially, but it turned out that zeroing the
checksum ends up breaking dhcp packets on *non* virtio/vhost-net guest
interfaces. That attempt was reverted in commit v10.9.0-rc2.

Fortunately, there is an existing way to recompute the checksum of a
packet as it leaves an interface - the "tc" (traffic control) utility
that libvirt already uses for bandwidth management. This patch uses a
tc filter rule to match dhcp response packets on the bridge and
recompute their checksum.

The filter rule must be attached to a tc qdisc, which may also have a
filter attached for bandwidth management (in the <bandwidth> element
of the network config). Not only must we add the qdisc only once
(which was already handled by the patch two prior to this one), but
also the filter rule for checksum fixing and the filter rule for
bandwidth management must be different priorities so they don't clash;
this is solved by adding the checksum-fix filter with "priority 2",
while the bandwidth management filter remains "priority 1" (both will
always be evaluated anyway, it's just a matter of which is evaluated
first).

So far this method has worked with every different guest we could
throw at it, including several that failed with the previous method.

Fixes: b89c4991daa0ee9371f10937fab3b03c5ffdabc6
Reported-by: Rich Jones <rjones@redhat.com>
Reported-by: Andrea Bolognani <abologna@redhat.com>
Fix-Suggested-by: Eric Garver <egarver@redhat.com>
Fix-Suggested-by: Phil Sutter <psutter@redhat.com>
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Laine Stump
6412c2cb51 util: add new "tc" layer for virFirewallCmd objects
If the layer of a virFirewallCmd is "tc", then the "tc" utility will
be executed using the arguments that had been added to the
virFirewallCmd

tc layer doesn't support auto-rollback command creation (any rollback
needs to be added manually with virFirewallAddRollbackCmd()), and also
tc layer isn't supported by the iptables backend (it would have been
straightforward to add, but the iptables backend doesn't need it, and
I didn't want to take the chance of causing a regression in that
code for no good reason).

Signed-off-by: Laine Stump <laine@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Laine Stump
f1d94bbfa6 util: don't re-add the qdisc used for tx filters if it already exists
There will soon be two separate users of tc on virtual networks, and
both will use the "qdisc root handle 1: htb" to add tx filters. One or the
other could get the first chance to add the qdisc, and then if at a
later time the other decides to use it, we need to prevent the 2nd
user from attempting to re-add the qdisc (because that just generates
an error).

We do this by running "tc qdisc show dev $bridge handle 1:" then
checking if the output of that command contains both "qdisc" and " 1:
".[*] If it does then the qdisc has already been added. If not then we
need to add it now.

[*]As of this writing, the output more exactly starts with "qdisc
htb 1: root", but our comparison is made purposefully generous to
increase the chances that it will continue to work properly if tc
modifies the format of its output.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Laine Stump
35a5bf25d1 util: put the command that adds a tx filter qdisc into a separate function
virNetDevBandwidthSet() adds a queue discipline (qdisc) for each
interface that it will need to add tc transmit filters to, and the
filters are then attached to the qdisc.

There are other circumstances where some other function will need to
add tc transmit filters to an interface (in particular an upcoming
patch to the network driver nftables backend that will use a tc tx
filter to fix the checksum of dhcp packets), so that function will
also need a qdisc for the tx filter. To assure both always use exactly
the same qdisc, this patch puts the command that adds the tx filter
qdisc into a separate helper function that can (and will) be called
from either place

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Laine Stump
250435546a util: make it optional to clear existing tc qdiscs/filters in virNetDevBandwidthSet()
virNetDevBandwidthSet() always clears all existing qdiscs and their
subordinate filters before adding all the new qdiscs/filters. This is
normally exactly what we want, but there is one case (the network
driver) where the Qdisc added by virNetDevBandwidthSet() may already
be in use by the nftables backend (which will add a rule to fix the
checksum of dhcp packets); in that case, we *don't* want
virNetDevBandwidthSet() to clear out the qdisc that was already added
for nftables, and none of the bandwidth filters have been added yet,
so there already aren't any "old" filters that need to be removed
either - it is safe to just skip virNetDevBandwidthClear() in this
case.

To allow the network driver to set bandwidth without first clearing
it, this patch adds the flag VIR_NETDEV_BANDWIDTH_SET_CLEAR_ALL to the
virNetDevBandwidthSetFlags enum, and recognizes it in
virNetDevBandwidthSet() - if the flag is set, then
virNetDevBandwidth() will call virNetDevBandwidthClear() just as it
always has. But if the flag isn't set it *won't* call
virNetDevBandwidthClear().

As suggested above, VIR_NETDEV_BANDWIDTH_SET_CLEAR_ALL is set for all
calls to virNetdevBandwidthSet() except for two places in the network
driver.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Laine Stump
fa50454c05 util: use a single flags arg for virNetDevBandwidthSet(), not multiple bools
Having two bools in the arg list is on the borderline of being
confusing to anyone trying to read the code, but we're about to add a
3rd. This patch replaces the two bools with a single flags argument
which will instead have one or more bits from virNetDevBandwidthFlags
set.

Signed-off-by: Laine Stump <laine@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-26 14:36:14 +01:00
Jiri Denemark
6490d6ac11 cpu_map: Add KnightsMill CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
b5c15cf0d0 cpu_map: Add Denverton CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
6e09d69cff cpu_map: Add versions of Dhyana CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
3310ab0e58 cpu_map: Add versions of EPYC CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
cbccbe6e43 cpu_map: Add versions of EPYC-Rome CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
33209d63cd cpu_map: Add versions of EPYC-Milan CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
d0e5e984b6 cpu_map: Add versions of Nehalem CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
679305a98e cpu_map: Add versions of Westmere CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:36 +01:00
Jiri Denemark
57b5f8078b cpu_map: Add versions of SandyBridge CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
d00ba759c4 cpu_map: Add versions of IvyBridge CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
569a06b07e cpu_map: Add versions of Haswell CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
80d374422c cpu_map: Add versions of Broadwell CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
8bf6c7eb84 cpu_map: Add versions of Skylake-Client CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
6a3f1bc466 cpu_map: Add versions of Skylake-Server CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
4ad434654a cpu_map: Add versions of Cascadelake-Server CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
5bb09e6790 cpu_map: Add versions of Icelake-Server CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
eed7a2c4f7 cpu_map: Add versions of Cooperlake CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
860f40053d cpu_map: Add versions of Snowridge CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-26 13:04:35 +01:00
Jiri Denemark
5faffbc514 cpu_map: Add versions of SapphireRapids CPU model
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
073f825dab cpu_map: Add versions of GraniteRapids CPU model
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
135a3ad2a4 cpu_map: Add versions of SierraForest CPU model
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
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
Adam Julis
74ef4888ff qemuDomainDiskChangeSupported: Add missing iothreads check
GSList of iothreads is not allowed to be changed while the
virtual machine is running.

Resolves: https://issues.redhat.com/browse/RHEL-23607
Signed-off-by: Adam Julis <ajulis@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 13:04:58 +01:00
Peter Krempa
5872ab7fe9 manpage: virsh: Add warning about 'migrate' with '--persistent' together with '--xml'
When a VM is being migrated to a destination host it can be made
persistent on the destination by using '--persistent'. That may not
work as intended if '--xml' is used as well as that allows overriding
certain aspects of the VM xml, but does not involve the persistent
definition. In most cases users will need to supply also
'--persistent-xml' with the same set of modification.

Modify the man page to clarify the above so that users don't end up with
broken VM after migrating and restarting it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 13:02:11 +01:00
Peter Krempa
055379df23 API: migration: Warn about use of VIR_MIGRATE_PERSIST_DEST with VIR_MIGRATE_PARAM_DEST_XML
When a VM is being migrated to a destination host it can be made
persistent on the destination by using VIR_MIGRATE_PERSIST_DEST. That
may not work as intended if VIR_MIGRATE_PARAM_DEST_XML or the 'xmlin'
parameter is used as that allows overriding certain aspects of the VM
xml, but does not involve the persistent definition.
In most cases users will need to supply also VIR_MIGRATE_PARAM_PERSIST_XML
with the same set of modification.

Modify the man page to clarify the above so that users don't end up with
broken VM after migrating and restarting it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 13:02:11 +01:00
Peter Krempa
6f237f4642 Revert "qemu: migration: Improve handling of VIR_MIGRATE_PARAM_DEST_XML with VIR_MIGRATE_PERSIST_DEST"
The original intention was to improve the behaviour of the
VIR_MIGRATE_PERSIST_DEST flag which makes the VM persistent after
migration on the destination when used with VIR_MIGRATE_PARAM_DEST_XML.

While it worked as intended with p2p migration where the migration is
driven from the virtqemud instance on the source of the migration, which
can distinguish between the user-provided input XML and the one fetched
from the source of the migration, it's not easily possible to achieve
the same behaviour with normal migration driven from the client library.

The approach also still had corner cases (originally deemed worth
changing) such as if the persistent definition was modified it would be
overwritten.

As there is no clear fix which would improve both styles of migrations
with no corner cases revert the change.

Upcoming commits will modify the documentation to add warning about the
use of VIR_MIGRATE_PERSIST_DEST with VIR_MIGRATE_PARAM_DEST_XML/xmlin
without using VIR_MIGRATE_PARAM_PERSIST_XML instead of a code fix.

This reverts commit 6a385590926d01ab2f2137d1d0833ae797cd2839.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 13:02:11 +01:00
Han Han
6d9bf5b63c NEWS: Add the news for CVE-2024-4418
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 11:24:40 +01:00
Han Han
5ca7daf397 NEWS: Add the news for CVE-2024-2494
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 11:24:38 +01:00
Han Han
eb2775e1d6 NEWS: cpu_map: Add the EPYC-Genoa cpu mode
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 11:24:36 +01:00
Han Han
ef57b7431f NEWS: qemu: Add support for hyperv enlightenments features
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-19 11:24:32 +01:00
Andrea Bolognani
da2132d124 docs: Recommend virtio instead of virtio-(non-)transitional
When virtio-(non-)transitional models were introduced, the
documentation was updated to include them; at the same time,
language was introduced indicating that using the existing
virtio model is no longer recommended.

This is unnecessarily harsh, and has resulted in people
incorrectly believing (through no fault of their own) that the
virtio model has been deprecated.

In reality, it's perfectly fine to use the virtio model as the
stress-free option that, while often not producing the ideal
PCI topology, will generally get the job done and work reliably
across libvirt versions and machine types.

Tweak the documentation so that it hopefully carries the
desired message across.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-11-19 10:16:59 +01:00
Richard W.M. Jones
7b73e681a2 vmx: Get the VMware boolean uefi.secureBoot.enabled
Some VMware guests have a boolean uefi.secureBoot.enabled.  If found,
and it's set to "TRUE", and if it's a UEFI guest, then add this clause
into the domain XML:

  <os firmware='efi'>
    <firmware>
      <feature enabled='yes' name='enrolled-keys'/>
      <feature enabled='yes' name='secure-boot'/>
    </firmware>
  </os>

This approximates the meaning of this VMware flag.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Fixes: https://issues.redhat.com/browse/RHEL-67836
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 15:29:43 +01:00
Peter Krempa
ec8be9aceb qemu: Avoid use of '-loadvm' commandline argument for internal snapshot reversion
The '-loadvm' commandline parameter has exactly the same semantics as
the HMP 'loadvm' command. This includes the selection of which block
device is considered to contain the 'vmstate' section.

Since libvirt recently switched to the new QMP commands which allow a
free selection of where the 'vmstate' is placed, snapshot reversion will
no longer work if libvirt's algorithm disagrees with qemu's. This is the
case when the VM has UEFI NVRAM image, in qcow2 format, present.

To solve this we'll use the QMP counterpart 'snapshot-load' to load the
snapshot instead of using '-loadvm'. We'll do this before resuming
processors after startup of qemu and thus the behaviour is identical to
what we had before.

The logic for selecting the images now checks both the snapshot metadata
and the VM definition. In case images not covered by the snapshot
definition do have the snapshot it's included in the reversion, but it's
fatal if the snapshot is not present in a disk covered in snapshot
metadata.

The vmstate is selected based on where it's present as libvirt doesn't
store this information.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
2da32ff468 qemu: monitor: Extract vmstate presence for internal snapshots in qemuBlockGetNamedNodeData
Refactor the parts of qemuBlockGetNamedNodeData which fetch the names of
internal snapshots present in the on-disk state of QCOW2 images to also
extract the presence of the 'vmstate' section.

This requires conversion of the snapshot list to a hash table as we
always know the name of the snapshot that we're looking for, and the
hash table allows also storing of additional data which we'll use to
store the presence of the 'vmstate'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
6902e77c01 qemu: Add enum entries for 'snapshot-load' qemu job
The internal snapshot code will use the 'snapshot-load' command so we
need to add the corresponding job type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
2ed93e1a4b qemu: monitor: Add monitor infrastructure for 'snapshot-load' QMP command
Libvirt currently loads snapshots via the '-loadvm' commandline option
but that uses the same logic as the 'loadvm' text monitor command used
to pick the disk image with the 'vmstate' section. Since libvirt now
implements our own logic to pick the 'vmstate' device it can happen that
we pick a different than qemu and thus qemu would fail to load the
snapshot. This happens currently on VMs with UEFI firmware with NVRAM
image in qcow2 format.

To fix this libvirt will need to use the 'snapshot-load' QMP command
instead of relying on '-savevm'.

Implement the monitor bits for 'snapshot-load'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
c82dd60b2e qemuSnapshotForEachQcow2: Handle also NVRAM image for internal snapshots
The live VM snapshot code already does handle the NVRAM image when it's
in use, so we should also handle it when modifying/creating the
snapshots via qemu-img when inactive.

Add the handling to qemuSnapshotForEachQcow2 which is used for all
inactive operations.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
5ca0552d31 qemuSnapshotForEachQcow2: Refactor
Refactor the function to avoid recursive call to rollback and simplify
calling parameters.

To achieve that most of the fatal checks are extracted into a dedicated
loop that runs before modifying the disk state thus removing the need to
rollback altoghether. Since rollback is still necessary when creation of
the snapshot fails half-way through the rollback is extracted to handle
only that scenario.

Additionally callers would only pass the old 'try_all' argument as true
on all non-creation ("-c") modes. This means that we can infer it from
the operation instead of passing it as an extra argument.

This refactor will also make it much simpler to implement handling of
the NVRAM pflash backing file (in case it's qcow2) for internal
snapshots.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
5dfd0a0ce8 qemu: Move 'qemuDomainSnapshotForEachQcow2(Raw)' to qemu_snapshot.c
The functions are exclusively used in the snapshot module. Move and
rename them:

  qemuDomainSnapshotForEachQcow2Raw -> qemuSnapshotForEachQcow2Internal
  qemuDomainSnapshotForEachQcow2 -> qemuSnapshotForEachQcow2

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
60838fee08 qemuDomainSnapshotForEachQcow2Raw: Remove 'driver' argument
Now that it's unused except for the recursive call it can be dropped
from all of the call tree.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Peter Krempa
20ffcb912f qemu: Don't store path to qemu img
The 'virCommand' helpers already look up the full path to the binary in
PATH if it's not specified. This means that the qemu driver doesn't have
to lookup and store the path to 'qemu-img' in the conf object but rather
can be cleaned up to use this new infrastructure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 13:51:13 +01:00
Praveen K Paladugu
25fdb57d8e ch: Enable callbacks for ch domain events
Enable callbacks for define, undefine, started, booted, stopped,
destroyed events of ch guests.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 10:58:38 +01:00
Praveen K Paladugu
ed1cef6264 ch: enable virNodeGetMemoryStats API
Enable virNodeGetMemoryStats API to return the stats of host memory.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 10:45:34 +01:00
Göran Uddeborg
91d6a0a1a9 Translated using Weblate (Swedish)
Currently translated at 96.5% (10165 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-18 08:59:51 +01:00
Göran Uddeborg
cf37b66835 Translated using Weblate (Swedish)
Currently translated at 96.3% (10145 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-18 08:59:51 +01:00
Göran Uddeborg
af3d7fa7df Translated using Weblate (Swedish)
Currently translated at 96.1% (10118 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-18 08:59:51 +01:00
Göran Uddeborg
4454af822e Translated using Weblate (Swedish)
Currently translated at 95.9% (10098 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-18 08:59:51 +01:00
Weblate
25f72a3b72 Translated using Weblate (Swedish)
Currently translated at 95.8% (10087 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-18 08:59:51 +01:00
Göran Uddeborg
221b2fe856 Translated using Weblate (Swedish)
Currently translated at 95.8% (10087 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-18 08:59:51 +01:00
Pavel Borecki
a0554d6922 Translated using Weblate (Czech)
Currently translated at 96.9% (10206 of 10526 strings)

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

Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2024-11-18 08:59:51 +01:00
Stefan Berger
d79542eec6 qemu: Read back the profile name after creation of a TPM instance
Get the JSON profile that the swtpm instance was created with from the
output of 'swtpm socket --tpm2 --print-info 0x20 --tpmstate ...'. Get the
name of the profile from the JSON and set it in the current and persistent
emulator descriptions as 'name' attribute and have the persistent
description stored with this update. The user should avoid setting this
'name' attribute since it is meant to be read-only. The following is
an example of how the XML could look like:

  <profile source='local:restricted' name='custom:restricted'/>

If the user provided no profile node, and therefore swtpm_setup picked its
default profile, the XML may now shows the 'name' attribute with the name
of the profile. This makes the 'source' attribute now optional.

  <profile name='default-v1'/>

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:49 +01:00
Stefan Berger
957bda01c8 qemu: Move adding --tpmstate to swtpm command line into own function
Factor-out code related to adding the --tpmstate option to the swtpm
command line into its own function.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:44 +01:00
Stefan Berger
fc9a333f37 qemu: Move adding of keys to swtpm command line into own function
Factor-out code related to adding key to the swtpm command line into its
own function.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:41 +01:00
Stefan Berger
cd37721d19 qemu: Extend swtpm_setup command line to set a profile by its name
Run swtpm_setup with the --profile-name option if the user provided the
name of a profile. swtpm_setup will try to load the profile from
directories with local profiles and distro profiles and if no profile
by this name with appended '.json' suffix could be found there, it will
fall back to try to use an internal profile with the given name.

Also set the --profile-remove-disabled option if the user provided a value
in the remove_disabled attribute in the profile XML node.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:38 +01:00
Stefan Berger
526f08da62 docs: Add documentation for the TPM backend profile node
Add documentation for the TPM backend profile node and point the reader to
further documentation about TPM profiles available in the swtpm man page.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:35 +01:00
Stefan Berger
90c40d3b9c conf: Add support for profile parameter on TPM emulator in domain XML
Extend the parser and XML builder with support for the profile parameter
and its remove_disabled attribute.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:33 +01:00
Stefan Berger
498b5b7440 schema: Extend schema for TPM emulator profile node
Extend the schema for the TPM emulator profile node. Require that the
profile the user provides is described in a 'source' attribute. An optional
remove_disabled attribute is also supported for swtpm to automatically
remove algorithms from the 'custom' profile if they are disabled by FIPS
mode on the host.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:30 +01:00
Stefan Berger
15ba6edabd conf: Define enum virDomainTPMProfileRemoveDisabled
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:27 +01:00
Stefan Berger
1079532d74 util: Add parsing support for swtpm_setup's cmdarg-profile capability
Add support for parsing swtpm_setup 'cmdarg-profile' capability
(since v0.10).

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:24 +01:00
Stefan Berger
279b14cb81 qemu: Pass virQEMUDriverConfig rather than some of its fields
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:22 +01:00
Stefan Berger
8bba15bdc1 conf: Move TPM emulator parameters into own struct
To avoid passing TPM emulator parameters around individually, move them
into a structure and pass around the structure.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-18 08:46:18 +01:00
Jiri Denemark
b0aa9d31f2 qemu: Avoid useless tmp variable in qemuCanonicalizeMachine
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-15 15:22:23 +01:00
Praveen K Paladugu
5904676d2f ch: explicitly set INFILESIZE to 0
While sending API requests that don't need any body, explicitly set
CURLOPT_INFILESIZE to 0.

Without this option, curl sends a chunked request with `Expect: 100-continue`
header. The client, in this case curl, expects a response from the server,
ch in this case, to respond within a timeout period.

If guest definition has a PCI passthrough device configuration,
cloud-hypervisor process cannot respond within above mentioned timeout.
Even if cloud-hypervisor responds after the timeout, curl cannot read
the response. Because of this, virsh request to create a guest, hangs. This
only happens while using "mshv" hypervisor.

By setting CURLOPT_INFILESIZE to O, curl drops the Expect header and
sychronously waits for server to respond.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:41 +01:00
Praveen K Paladugu
cec5bb372a ch: reattach PCI devices to host while stopping guest
Reattach PCI devices to host, while stopping ch guest.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:38 +01:00
Praveen K Paladugu
1e8cc91f9d ch: allow hostdev in domain definitions
Allow hostdev configurations in ch guest definitions.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:35 +01:00
Wei Liu
c6dbc6042d ch: prepare host for PCI passthrough
Prepare host to passthrough PCI devices for ch guests.

Co-authored-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:31 +01:00
Wei Liu
acfe2e7a50 ch: prepare domain definition for pci passthrough
Check if the domain definition is valid for PCI passthrough and update
it if necessary.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:27 +01:00
Wei Liu
5d4f9e1bdd ch: add host device manager to driver
Co-authored-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:24 +01:00
Praveen K Paladugu
89ef0c0f2b hypervisor: move HostdevHostSupportsPassthroughVFIO
Move HostdevHostSupportsPassthroughVFIO method to hypervisor to be
shared between qemu and ch drivers.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:22 +01:00
Praveen K Paladugu
b05f6134c9 hypervisor: move HostdevNeedsVFIO to hypervisor
Move HostdevNeedsVFIO method to hypervisor to be reused between qemu
and ch drivers.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 13:15:12 +01:00
Peter Krempa
0dad1ec009 kbase: virtiofs: Clarify migration support statement
virtiofs 1.11 contains support for migration so update the 'Note' which
states that migration is not supported.

Additionally mention that VM snapshots don't save state of the files
shared via virtiofs so reverting is not a good idea.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-15 10:34:29 +01:00
Peter Krempa
f35f817ebf qemu: process: Introduce setup of block-device backed NVRAM
In case when a management application will require to store the nvram in
a block device instead of a file libvirt needs to be able to set up the
block device.

This patch introduces support for setting up the block device by using
'qemu-img convert' to produce a qcow2-formatted block device.

The use of 'qcow2' is made mandatory as the UEFI firmware requires that
the NVRAM image has the exact expected size, which is almost impossible
with block devices. 'qcow2' also allows libvirt to detect wheher the
block device is formatted allowing file-like semantics.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:05 +01:00
Peter Krempa
fce4319f58 qemu: process: Extract setup of file-backed nvram from template
The setup of nvram will later be extended to also support block-device
backed nvram, so extract the file-backed nvram setup steps from
'qemuPrepareNVRAM' into 'qemuPrepareNVRAMFile'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:05 +01:00
Peter Krempa
32228ecb02 conf: Remove nonsensical requirement of nvram format matching firmware format
The nvram image can have any supported format and there's no technical
requirement of them having the same format. In fact the actual nvram
image doesn't necessarily need to have the same format as the template
if the user is willing to format it themselves (as libvirt is not going
to convert it).

Remove the nonsensical check and adjust tests. The test case required
swapping around the format in order to work properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
d3016e47be qemuFirmwareMatchDomain: Don't base firmware selection on nvram image format
Basing the selection on the format of the actual NVRAM image makes no
sense as user may format the image themselves.

Additionally it doesn't make much sense to even limit the firmware
selection based on the nvram template itself. As format of the template
is given and firmware images don't really provide any choice.

Remove the limitation so that autoselection can pick a template
regardless of the selected format or template format.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
2aa644a2fc qemuPrepareNVRAM: Refuse conversion of NVRAM backing file format
Refuse situations where the user configures a different format for a
file-backed nvram than the template file has.

At this point it's still required that the NVRAM and firmware share
format, but that is going to be relaxed, thus we need to refuse
configurations that the code can't handle.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
6540cc08b1 conf: Always format firmware image format
The code historically skipped the 'format' field for 'raw' images as we
didn't output it when no format support was present. Stop misleading and
output the format also for 'raw' images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
49ce561e3f conf: domain: Output 'format' attribute of '<nvram>' also for' raw images
As the 'format' field is meant to carry the format of the nvram image we
should output it even when the image is 'raw'.

Currently this is not a problem but later patches will allow mismatch
between the nvram format and loader format (as nothing really
technically requires them to be the same and this then could become
problem).

Modify the condition and update tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
366907e520 firmware: Add 'templateFormat' XML attribute and plumb it in
Currently the qemu firmware code weirdly depends on the 'format' field
of the nvram image itself to do the auto-selection process as well as
then uses it to declare the actual type to qemu.

As it's not technically required that the template and the on disk image
share the type introduce a 'templateFormat' field which will split off
from the shared purpose of the type and will be used for the selection
and instantiation process, while 'format' will be left for the actual
type of the on disk image.

This patch introduces the field, adds XML infrastructure as well as
plumbs it to the firmware bits.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
f90567f3a8 docs: formatdomain: Clarify that NVRAM template is also being autoselected
The NVRAM template file may be autoselected same as the loader/firmware
image. Add a hint that this can occur and also that it doesn't
necessarily need to be from the 'qemu.conf' configured files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
a448d4a18a conf: domain: Clarify nvram/loader format logic
Restructure the code to assign first (as this is simpler to refactor in
the future) and avoid mixing implicit value checks with explicit ones by
checking for _NONE.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:04 +01:00
Peter Krempa
d57630c282 qemu: Install backing store terminators for 'pflash' blockdevs
The qemu driver does support qcow2 images for the firmware and nvram
pflash devices, but we do not do the full backing chain setup for them
as we don't expect that those images would actually have a backing
store. We don't tell that to qemu though which theoretically can lead to
qemu probing the backing store from the image itself. We don't want that
for now.

Deny qemu probing the backing store by installing a "terminator" empty
virStorageSource as 'backingStore' for pflash and nvram.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:03 +01:00
Peter Krempa
6a8bcd1110 qemuFirmwareEnsureNVRAM: Don't try to setup non-local nvram
'qemuFirmwareEnsureNVRAM' which fills the NVRAM configuration bits which
may be missing was basing its decision to do something based on whether
the 'path' field was set. This is insufficient if remote storage is to
be considered.

Use 'virStorageSourceIsEmpty()' instead as that properly considers
remote filesystems and explain why the source is unref'd when the
function decides to rewrite the config.

The 'firmware-auto-efi-format-nvram-qcow2-network-nbd' is modified to
omit filling the 'path' field, which without this fix would result in
the nvram to be reset to a local file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:03 +01:00
Peter Krempa
273157dd9f qemuPrepareNVRAM: Don't attempt to create NVRAM on block device
'virFileRewrite()' which is used to setup the NVRAM image if it doesn't
exist or when it is requested by the user forcibly replaces the
destination file by the file it creates. For block devices this
overwrites the device node file or the symlink pointing to the device
node by a regular file instead of formatting it.

As this not only makes the VM fail to start but also breaks user's /dev/
filesystem forbid it for now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-15 09:42:03 +01:00
Andrea Bolognani
fde04774db syntax-check: Suggest ways to fix internal references
The rule catches incorrect attempts to use internal references,
but doesn't guide the developer hitting a failure towards the
not exactly obvious acceptable alternatives.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-14 11:02:42 +01:00
Andrea Bolognani
b3a4b049c4 docs: Document authselect to enable the NSS module
When using recent Fedora and RHEL versions, the manual setup that
is otherwise necessary to enable the module can be replaced with
executing a single command.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-13 22:42:19 +01:00
Andrea Bolognani
3224b25607 docs: Rework documentation for the NSS module
The page contains some confusing information, especially around
limitations that supposedly only affect one of the two variants,
and goes into what is arguably an unnecessary amount of detail
when it comes to its inner workings.

We can make the page a lot shorter and snappier without
affecting its usefulness, so let's do just that.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-13 22:42:15 +01:00
Michal Privoznik
24580d13d1 qemu: Move PostParse functions out of qemu_domain.c
Problem with qemu_domain.c is that it's constantly growing. But
there are few options for improvement. For instance, validation
functions were moved out and now live in qemu_validate.c. We can
do the same for PostParse functions, though since PostParse may
modify domain definition, some functions need to be exported from
qemu_domain.c.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-11-13 13:13:54 +01:00
Martin Kletzander
bf2af76ec2 qemu_hotplug: Do not report unknown error when hot-unplugging non-existing device
When qemuDomainDeleteDevice() gets "DeviceNotFound" error it is a
special case as we're trying to remove a device which does not exists
any more.  Such occasion is indicated by the return value -2.

Callers of the aforementioned function ought to base their behaviour on
the return value.  However not all callers take as much care for the
return value as one could realistically anticipate.

Follow the usual direction of removing possible backend object (in case
of character devices), remove the device from its XML without waiting
for the device removal from QEMU (since it is already not there) and
basically follow the same algorithm as there is when the device was
removed, skipping over the wait for the device removal.

The overall return value also needs to be adjusted since
qemuDomainDeleteDevice() does not set an error on the -2 return value
and would otherwise trigger an unknown error being reported to the user
or management application.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-12 15:41:34 +01:00
Michal Privoznik
aeebb30ba2 Drop unused function declarations
When moving function and/or renaming them sometimes corresponding
change to corresponding header file is not done. This leaves us
with functions that are declared in header files, but nowhere
implemented. Drop such declarations.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-12 15:35:53 +01:00
Michal Privoznik
6c50d11276 virnetserverclient.h: Fix typo in comment of virNetServerClientPrivPreExecRestart()
The function the comment is referring to is
virNetServerClientPrivNew() not virNetServerClintPrivNew(). The
latter doesn't even exist.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-12 15:35:53 +01:00
Martin Kletzander
a053f57ebc docs: Add Sys::Async::Virt to apps.html
As requested on the libvirt users list I am adding this mention to the
apps page.

Reported-by: Erik Huelsmann <ehuels@gmail.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-12 12:07:05 +01:00
Göran Uddeborg
dbe4bdbe3a Translated using Weblate (Swedish)
Currently translated at 95.7% (10079 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-12 11:00:29 +01:00
Weblate
17d03614de Translated using Weblate (Swedish)
Currently translated at 95.7% (10078 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-12 11:00:29 +01:00
Göran Uddeborg
4d19cbaa0d Translated using Weblate (Swedish)
Currently translated at 95.7% (10078 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-12 11:00:29 +01:00
Weblate
e13d1f0c8c Translated using Weblate (Swedish)
Currently translated at 95.7% (10077 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-12 11:00:29 +01:00
Göran Uddeborg
abef180b69 Translated using Weblate (Swedish)
Currently translated at 95.7% (10077 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-12 11:00:29 +01:00
Weblate
75ac9929bb Translated using Weblate (Swedish)
Currently translated at 95.7% (10076 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-12 11:00:29 +01:00
Göran Uddeborg
d359855df7 Translated using Weblate (Swedish)
Currently translated at 95.7% (10076 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-12 11:00:29 +01:00
Weblate
1287dc21a6 Translated using Weblate (Swedish)
Currently translated at 95.5% (10061 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-12 11:00:29 +01:00
Göran Uddeborg
e088f2107e Translated using Weblate (Swedish)
Currently translated at 95.5% (10061 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-12 11:00:29 +01:00
Martin Kletzander
309c5cd4a3 ci: Update with newer lcitool
This switches to newer freebsd 14.1 and implements the new RUN_PIPELINE
behaviour introduced by Daniel.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-12 11:00:26 +01:00
Michal Privoznik
d88ebd4374 ch_monitor: Report OS error when removing socket fails
When removing a socket in virCHMonitorClose() fails, a warning is
printed. But it doesn't contain errno nor g_strerror() which may
shed more light into why removing of the socket failed.

Oh, and since virCHMonitorClose() is registered as autoptr
cleanup for virCHMonitor() it may happen that virCHMonitorClose()
is called with mon->socketpath allocated but file not existing
yet (see virCHMonitorNew()). Thus ignore ENOENT and do not print
warning in that case - the file doesn't exist anyways.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-12 09:11:47 +01:00
Michal Privoznik
f1f4cbb50a ch_monitor: Avoid possible double free in virCHMonitorClose()
The virCHMonitorClose() is meant to be called when monitor to
cloud-hypervisor process closes. It removes the socket and frees
string containing path to the socket.

In general, there is a problem with the following pattern:

  if (var) {
      do_something();
      g_free(var);
  }

because if the pattern executes twice the variable is freed
twice. That's why we have VIR_FREE() macro. Well, replace plain
g_free() with g_clear_pointer(). Mind you, this is NOT a
destructor where clearing pointers is needless.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-12 09:11:36 +01:00
John Levon
4be361a385 test_driver: provide basic disk hotunplug support
Signed-off-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-12 09:10:44 +01:00
John Levon
c530a96151 test_driver: provide basic disk hotplug support
Add some basic plumbing, based on the qemu driver.

Signed-off-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-12 09:10:44 +01:00
Göran Uddeborg
c7611a6b13 Translated using Weblate (Swedish)
Currently translated at 95.5% (10059 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-11 12:49:55 +01:00
Göran Uddeborg
756257497d Translated using Weblate (Swedish)
Currently translated at 95.3% (10039 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-11 12:49:55 +01:00
Weblate
5ea60597b0 Translated using Weblate (Swedish)
Currently translated at 95.2% (10024 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-11 12:49:55 +01:00
Göran Uddeborg
ff836adb4b Translated using Weblate (Swedish)
Currently translated at 95.2% (10024 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-11 12:49:55 +01:00
Göran Uddeborg
5fbf054360 Translated using Weblate (Swedish)
Currently translated at 95.1% (10017 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-11 12:49:55 +01:00
Göran Uddeborg
948c9cf7a1 Translated using Weblate (Swedish)
Currently translated at 94.9% (9997 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-11 12:49:55 +01:00
Weblate
1872a09f14 Translated using Weblate (Swedish)
Currently translated at 94.8% (9984 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-11 12:49:55 +01:00
Göran Uddeborg
340b5dad78 Translated using Weblate (Swedish)
Currently translated at 94.8% (9984 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-11 12:49:54 +01:00
Weblate
863df80534 Translated using Weblate (Swedish)
Currently translated at 94.7% (9976 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-11 12:49:54 +01:00
Göran Uddeborg
d4c2dc239a Translated using Weblate (Swedish)
Currently translated at 94.7% (9976 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-11 12:49:54 +01:00
Weblate
6721985db7 Translated using Weblate (Swedish)
Currently translated at 94.6% (9967 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-11 12:49:54 +01:00
Göran Uddeborg
b86dd42113 Translated using Weblate (Swedish)
Currently translated at 94.6% (9967 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-11 12:49:54 +01:00
Martin Kletzander
27ae5e602a qemu_hotplug: Report better error message for platform serial devices
This should be better than the current for both hotplug:

    error: internal error: Invalid target model for serial device

and hot-unplug:

    error: An error occurred, but the cause is unknown

which should not be reached at all.

Resolves: https://issues.redhat.com/browse/RHEL-66222
Resolves: https://issues.redhat.com/browse/RHEL-66223
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 12:48:42 +01:00
Martin Kletzander
52c2e3e0a7 qemu: Expose qemuChrIsPlatformDevice outside from qemu_command
Then it can be used from qemu_hotplug.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 12:48:42 +01:00
Boris Fiuczynski
9dc2226e68 NEWS: qemu: add multi boot device support on s390x
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 12:20:03 +01:00
Boris Fiuczynski
bf0308b2d4 qemu: command: add multi boot device support on s390x
If QEMU supports multi boot device make use of it instead of using the
single boot device machine parameter.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 10:15:06 +01:00
Boris Fiuczynski
48fd995f3b tests: add capabilities for QEMU 9.2.0 on s390x
Let us introduce the xml and reply files for QEMU 9.2.0 on s390x.

A QEMU at commit v9.1.0-1348-g11b8920ed2 was used to generate this data.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 10:15:06 +01:00
Boris Fiuczynski
3ccf692e08 qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM
Add capability QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM to detect multi boot
device support in QEMU by checking the virtio-blk-ccw device property
existence of loadparm.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-11 10:15:06 +01:00
Michal Privoznik
a3b8753db9 virnetdevopenvswitch: Warn on unsupported QoS settings
Let me preface this with stating the obvious: documentation on
QoS in OVS is very sparse. This is all based on my observation
and OVS codebase analysis.

For the following QoS setting:

  <bandwidth>
    <inbound average="512" peak="1024" burst="32"/>
  </bandwidth>

the following QoS setting is generated into OVS (NB, our XML
values are in KiB/s, OVS has them in bits/s):

  # ovs-vsctl list qos
  _uuid               : a087226b-2da6-4575-ad4c-bf570cb812a9
  external_ids        : {ifname=vnet1, vm-id="7714e6b5-4885-4140-bc59-2f77cc99b3b5"}
  other_config        : {burst="262144", max-rate="8192000", min-rate="4096000"}
  queues              : {0=655bf3a7-e530-4516-9caf-ec9555dfbd4c}
  type                : linux-htb

from which the following topology is generated:

  # for i in qdisc class; do tc -s -d -g $i show dev vnet1; done
  qdisc htb 1: root refcnt 2 r2q 10 default 0x1 direct_packets_stat 0 ver 3.17 direct_qlen 1000
   Sent 2186 bytes 16 pkt (dropped 0, overlimits 0 requeues 0)
   backlog 0b 0p requeues 0

  +---(1:fffe) htb rate 8192Kbit ceil 8192Kbit linklayer ethernet burst 1499b/1mpu 60b cburst 1499b/1mpu 60b level 7
       |       Sent 2186 bytes 16 pkt (dropped 0, overlimits 0 requeues 0)
       |       backlog 0b 0p requeues 0
       |
       +---(1:1) htb prio 0 quantum 51200 rate 4096Kbit ceil 8192Kbit linklayer ethernet burst 32Kb/1mpu 60b cburst 32Kb/1mpu 60b level 0
                 Sent 2186 bytes 16 pkt (dropped 0, overlimits 0 requeues 0)
                 backlog 0b 0p requeues 0

Long story short, the default class (1:) for an OVS interface has
average and peak set exactly as requested. But since it's nested
under another class (1:fffe), it can borrow unused bandwidth. And
the parent is set to have rate = ceil = peak from our XML. From
[1]: htb_tc_install() calls htb_parse_qdisc_details__() which
sets: 'hc->min_rate = hc->max_rate;' and then calls
htb_setup_class_(..., tc_make_handle(1, 0xfffe), tc_make_handle(1, 0), &hc);
to set up the top parent class.

In other words - the interface is set up to so that it can always
consume 'peak' bandwidth and there is no way for us to set it up
differently. It's too late to deny setting 'peak' different to
'average' at XML validation phase so do the next best thing -
throw a warning, just like we do in case <bandwidth/> is set for
an unsupported <interface/> type.

1: https://github.com/openvswitch/ovs/blob/main/lib/netdev-linux.c#L5039
Resolves: https://issues.redhat.com/browse/RHEL-53963
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-11-08 10:41:02 +01:00
zk dc
9132b486a3 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 95.5% (10058 of 10526 strings)

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

Signed-off-by: zk dc <zkdc2345@qq.com>
2024-11-08 04:57:53 +01:00
Michal Privoznik
844d1036eb qemu_domain: Automagically add IOMMU if needed
If a Q35 domain has huge number of vCPUS (over 255, currently), then
it needs IOMMU with Extended Interrupt Mode enabled (see check in
qemuValidateDomainVCpuTopology()).

Well, we already add some devices and to other tricks when
parsing new domain XML. Might as well add IOMMU device if above
condition is met.

Resolves: https://issues.redhat.com/browse/RHEL-65844
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-07 10:46:33 +01:00
Michal Privoznik
b15047ff26 qemu: Turn EIM IOMMU on automagically
If a Q35 domain has huge number of vCPUS (over 255, currently), then
it needs IOMMU with Extended Interrupt Mode enabled (see check in
qemuValidateDomainVCpuTopology()).

Well, we already add some devices and to other tricks when
parsing new domain XML. Might as well turn the EIM on for IOMMU
device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-07 10:46:33 +01:00
Michal Privoznik
a9797d7c43 libvirt_private.syms: Export virDomainIOMMUDefNew()
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-07 10:46:32 +01:00
Göran Uddeborg
e393d688a3 Translated using Weblate (Swedish)
Currently translated at 94.5% (9957 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-07 02:28:57 +01:00
Ján Tomko
e45313c031 ch: check return value of virJSONValueArrayAppend
It only errors out when presented with a non-array, but we do check
it everywhere else.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-06 17:12:32 +01:00
Ján Tomko
da66bf53b0 util: json: check return value of virJSONValueFromJsonC
In virJSONValueFromJsonC, the return value of virJSONValueFromJsonC
was not checked in one case.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-06 17:12:32 +01:00
Ján Tomko
13f40898ab qemu: chardev: avoid impossible overflow
In the rare case where int and long long are not the same size,
the multiplication of an int variable and an int constant might
overflow. Cast the constant to long long to avoid this.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: baa4edfb79d5ee861a08b5ec11416c5c156d8cd2
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-11-06 17:12:32 +01:00
Léane GRASSER
2e64ca6ef2 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-06 12:34:00 +01:00
Ján Tomko
736e386273 docs: fix since tag for TPM with custom path
The feature was pushed after the 10.9.0 release.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 579fd44612d044981a5b81a70b03d4a8c0d8930e
2024-11-05 16:42:51 +01:00
Ján Tomko
806e266fa1 docs: formatdomain: fix XML snippets
Fix indentation, missing slashes for unpaired tags and missing angle
brackets.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2024-11-05 16:33:23 +01:00
Marc-André Lureau
bb5e26749f qemu: explicit swtpm state locking
With upcoming v0.10 swtpm (commit
aa483aeb6d),
file locking with "lock" option is now supported and reflected in
"tpmstate-opt-lock" capability.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Marc-André Lureau
f1304cc566 qemu_tpm: handle file/block storage source
When swtpm reports "nvram-backend-dir", it can accepts a single file or
block device where TPM state will be stored. --tpmstate must be
backend-uri=file://<path>.

Teach the storage to use custom directory or file source location.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Marc-André Lureau
a110042d0c schema: add TPM emulator <source type='dir' path='..'>
Learn to parse a directory for the TPM state.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Marc-André Lureau
579fd44612 schema: add TPM emulator <source type='file' path='..'>
Learn to parse a file path for the TPM state.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Marc-André Lureau
6d4eb07a55 tpm: rename 'storagepath' to 'source_path'
Mechanically replace existing 'storagepath' with 'source_path', as the
following patches introduce <source path='..'> configuration.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Marc-André Lureau
cc0aab9395 util: check swtpm nvram-backend-{dir,file} capabilities
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2024-11-05 15:25:53 +01:00
Göran Uddeborg
78a9e7bf4a Translated using Weblate (Swedish)
Currently translated at 94.4% (9937 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-05 09:59:03 +01:00
Remus-Gabriel Chelu
ef8ea25a7c Translated using Weblate (Romanian)
Currently translated at 15.0% (1580 of 10526 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2024-11-05 09:59:03 +01:00
Martin Kletzander
a52cd504b3 qemu: Report supported panic device models in domcapabilities
Domain capabilities include information about support for various
devices and models.

Panic devices are not included in the output which means that management
applications need to include the logic for choosing the right device
model or request a default model and try defining such a domain.

Add reporting of panic device models into the domain capabilities based
on the logic in qemuValidateDomainDefPanic() and also report whether
panic devices are supported based on whether at least one model is
supported.  That way consumers of the domain capability XML can
differentiate between libvirt not reporting the panic device models or
no model being supported.

Resolves: https://issues.redhat.com/browse/RHEL-65187
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-05 09:57:37 +01:00
Jiri Denemark
5d9b886a4e spec: Fix attributes for some qemu dirs in %{_rundir}
The recent attempt to fix the attributes used wrong mode for some
directories used by the QEMU driver. Only dbus and swtpm directories use
770, all other directories are created with 755.

Fixes: 961fb8944d0c2d7d5cc0783888a20317e725a248
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-11-04 16:39:41 +01:00
Göran Uddeborg
dec2f370ca Translated using Weblate (Swedish)
Currently translated at 94.2% (9917 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-04 14:45:48 +01:00
Ján Tomko
faf6edfa74 json: do not call json_tokener_free with NULL
Add an error message for the rare case if json_tokener_new
fails (allocation failure) and guard any use of json_tokener_free
where tok might be NULL (this was possible in libvirt-nss
when the json file could not be opened).

https://gitlab.com/libvirt/libvirt/-/issues/581

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Simon Pilkington
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
2024-11-04 12:15:10 +01:00
Göran Uddeborg
23d78e1c58 Translated using Weblate (Swedish)
Currently translated at 94.0% (9897 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-03 15:32:22 +01:00
Weblate
e081541b32 Translated using Weblate (Swedish)
Currently translated at 94.0% (9895 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-03 14:08:41 +01:00
Göran Uddeborg
14bf42613f Translated using Weblate (Swedish)
Currently translated at 94.0% (9895 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-03 14:08:41 +01:00
Andi Chandler
021fafe5f6 Translated using Weblate (English (United Kingdom))
Currently translated at 49.6% (5227 of 10526 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2024-11-02 13:30:42 +01:00
Göran Uddeborg
44de1c58a6 Translated using Weblate (Swedish)
Currently translated at 93.8% (9877 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-02 11:36:57 +01:00
Göran Uddeborg
6da4de016e Translated using Weblate (Swedish)
Currently translated at 93.6% (9854 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-02 00:25:42 +01:00
Peter Krempa
eb4ed1fe15 docs: domain: Be more upfront about 'sgio' not being actually supported
The support for the 'sgio' attribute for SCSI-backed devices was dropped
as there wasn't really ever any upstream support for it.

The docs do state that support for this depends on the hypervisor
itself, but we can be more clear that there is no hypervisor which does
support it.

There is also a suggestion to use 'sgio' instead of 'rawio' as being
more "secure" but since it no longer works drop this suggestion.

Resolves: https://issues.redhat.com/browse/RHEL-65268
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-01 15:53:13 +01:00
Peter Krempa
d02140383d virstring: Use 'g_new0' instead of improper use of 'g_malloc0_n'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-01 15:52:18 +01:00
Peter Krempa
bb4bd9d31f Replace improper use of g_malloc(0) with g_new0
Completely remove use of g_malloc (without zeroing of the allocated
memory) and forbid further use.

Replace use of g_malloc0 in cases where the variable holding the pointer
has proper type.

In all of the above cases we can use g_new0 instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-01 15:52:18 +01:00
Peter Krempa
354a3d2be4 virJSONValueFromString: Prefix error message from 'json-c'
The error message from 'json-c' was passed along without any libvirt
string which makes it hard to find in the source and isn't exactly clear
when present in logs:

 libvirtd[843]: internal error : invalid utf-8 string

Prefix the message with 'failed to parse JSON'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2024-11-01 15:51:53 +01:00
Jiri Denemark
e71a510605 qemu: Fix maximum physical address size in baseline CPU
We should include maximum physical address size in the CPU definition
created by virConnectBaselineHypervisorCPU only if we know the value for
all input CPUs. Otherwise we would create a CPU definition that is not
usable on all hosts from which we gathered the CPU info.

https://issues.redhat.com/browse/RHEL-24850

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-11-01 10:19:24 +01:00
Jiri Denemark
f22d00a9e6 Post-release version bump to 10.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-11-01 10:16:35 +01:00
1121 changed files with 251431 additions and 314750 deletions

View File

@ -48,6 +48,7 @@
<shi_lei@massclouds.com> <shilei.massclouds@gmx.com>
<adrian.brzezinski@eo.pl> <redhat@adrb.pl>
<matt@datto.com> <mcoleman@datto.com>
<dbarboza@ventanamicro.com> <danielhb413@gmail.com>
# Name consolidation:
# Preferred author spelling <preferred email>
@ -70,6 +71,7 @@ Wang Yufei (James) <james.wangyufei@huawei.com>
Deepak C Shetty <dpkshetty@gmail.com>
Dave Allan <dallan@redhat.com>
Richard W.M. Jones <rjones@redhat.com>
Daniel Henrique Barboza <dbarboza@ventanamicro.com>
# Non-trivial consolidation:
# see git documentation for information about the format

293
NEWS.rst
View File

@ -8,6 +8,260 @@ the changes introduced by each of them.
For a more fine-grained view, use the `git log`_.
v11.2.0 (unreleased)
====================
* **Security**
* **Removed features**
* **New features**
* **Improvements**
* **Bug fixes**
v11.1.0 (2025-03-03)
====================
* **Packaging changes**
* De-modularize the 'fs' storage file backend
The storage file backend for local files uses only code which we compile
into the internal libraries anyways so there's no point in having it
as a loadable module. The ``storage-file/libvirt_storage_file_fs.so`` module
no longer exists and its functionality is embedded directly.
* **Removed features**
* vbox: removed support for version 6.1 APIs
Libvirt no longer supports use of VirtualBox 6.1 since this version reached
its end of life on 2024/01.
* **New features**
* nodedev: Support ccwgroup based qeth devices
CCW group devices are devices that use multiple subchannels on the
mainframe's channel subsystem. A qeth group device maps to subchannels and
their corresponding device numbers and device bus-IDs. The ``ccwgroup``
device nodes are placed besides the subchannel nodes under computer and list
the group members within a new ``ccwgroup`` capability. A new capability
``ccwgroup_member`` is added into capability ``ccw`` to represent a device
membership to a ccwgroup. Filters are added to find ccwgroups as well as
ccwgroup members.
* ch: Support handling events from cloud-hypervisor
The ch driver now supports handling events from the cloud-hypervisor.
Events include VM lifecyle operations such as shutdown, pause, resume,
etc. Libvirt will now read these events and take actions such as
updating domain state, etc.
* Introduce virtio-mem ``<memory/>`` model for s390 guests
The virtio-mem model of ``<memory/>`` device can now be used with s390
guests.
* Support using passt as the backend for interface type='vhostuser'
The combination of vhostuser transport with passt as the backend
provides high performance, fully featured networking without the
need for libvirt or QEMU to have any elevated privileges or
capabilities. Configuration and features are identical to the
configuration for type='user' with the passt backend.
* **Improvements**
* qemu: I/O error messages can be queried via ``virDomainGetMessages()``
The qemu hypervisor driver now preserves the last I/O error message along
with the timestamp when it was recorded and preserves it to be queried via
``virDomainGetMessages()``.
* **Bug fixes**
* tools: ssh-proxy: Check if domain is running before connecting to it
If domain is not running but has a static CID configured for its VSOCK then
the ssh-proxy parsed it anyways. This may have resulted in mistakenly
connecting to a different domain. Domain status is checked before parsing
its CID.
* apparmor: Allow SGX if configured
If domain has ``<memory model='sgx-epc'\>`` configured then libvirt now
adds corresponding devices into a per-domain profile so that AppArmor does
not deny QEMU access to them.
* qemu: Fix crash when starting a domain on a host with unknown host CPU
On hosts where we cannot detect a host CPU model (mostly aarch64 hosts)
starting a domain with a custom CPU model caused a crash of virtqemud.
The bug was introduced in libvirt-10.9.0
v11.0.0 (2025-01-15)
====================
* **New features**
* network/qemu/lxc: support vlans on standard Linux host bridges
The network, qemu, and lxc drivers now support (using the
``<vlan>`` subelement) vlan tagging and trunking on network
interfaces connected to a standard Linux host bridge.
* qemu: Add support for direct and extended tlbflush features
Domains can now utilise more tlbflush hyperv features.
* **Improvements**
* ch: Enable user aliases
User can now specify custom aliases for devices in domain XML
* qemu: Grab a QUERY job when formatting domain XML
Under some specific conditions it might have happened that domain XML did
not contain runtime information or returned an XML that's in process of
changing (e.g. by a thread that's hotplugging a device). Formatting domain
XML now serializes properly with other threads.
* virtiofs: Allow read only mode
The ``<filesystem/>`` with `virtiofsd` backend can now use ``<readonly/>``
tag to export underlying filesystem in read only mode.
* qemu: allow migration of vGPU from mdev device <-> SRIOV VF device
Some GPU vendors are switching from using vGPUs creating using
mdev and identified with a uuid, to vGPUs created as SRIOV VFs and
identified by their PCI address, and want to support live
migration from a host using one type of vGPU to the other
type. This is now possible.
* **Bug fixes**
* qemu: tpm: do not update profile name for transient domains
Fix a possible crash when starting a transient domain which was
introduced in the previous release.
* qemu: Fix snapshot to not delete disk image with internal snapshot
When a VM has internal snapshot that is parent to external snapshot and user
reverts to the internal snapshot and deletes the external snapshot libvirt
would delete the disk image containing the internal snapshot. This would
result in data loss.
* qemu: Do not format invalid XML with hyperv features in passthrough mode
When hyperv features were specified together with ``mode="passthrough"``
libvirt parsed and formatted such features in the domain XML even though
they were not used at all, resulting in XML that is not valid based on our
schema. This is now fixed by not parsing any specified features when the
passthrough mode is used.
* qemu: Fix a crash when starting a domain with ovs bridge and QOS
* cpu: Add missing -v1 variants for CPU models
Some CPU models (mostly old ones) were missed when versioned CPU model
names were introduced in the previous release.
* qemu: Fix false error when recovering failed post-copy migration
In some cases libvirt would report a failure to recover post-copy migration
even though the recovery started just fine and migration would eventually
successfully finish.
v10.10.0 (2024-12-02)
=====================
* **New features**
* qemu: add multi boot device support on s390x
For classical mainframe guests (i.e. LPAR or z/VM installations), you
always have to explicitly specify the disk where you want to boot from (or
"IPL" from, in s390x-speak -- IPL means "Initial Program Load").
In the past QEMU only used the first device in the boot order to IPL from.
With the new multi boot device support on s390x that is available with QEMU
version 9.2 and newer, this limitation is lifted. If the IPL fails for the
first device with the lowest boot index, the device with the second lowest
boot index will be tried and so on until IPL is successful or there are no
remaining boot devices to try.
Limitation: The s390x BIOS will try to IPL up to 8 total devices, any
number of which may be disks or network devices.
* qemu: Add support for versioned CPU models
Updates to QEMU CPU models with -vN suffix can now be used in libvirt just
like any other CPU model.
* qemu: Support for the 'data-file' QCOW2 image feature
The QEMU hypervisor driver now supports QCOW2 images with 'data-file'
feature present (both when probing form the image itself and when specified
explicitly via ``<dataStore>`` element). This can be useful when it's
required to keep data "raw" on disk, but the use case requires features
of the QCOW2 format such as incremental backups.
* swtpm: Add support for profiles
Upcoming swtpm release will have TPM profile support that allows to
restrict a TPM's provided set of crypto algorithms and commands. Users can
now select profile by using ``<profile/>`` in their TPM XML definition.
* **Improvements**
* qemu: Support UEFI NVRAM images on block storage
Libvirt now allows users to use block storage as backend for UEFI NVRAM
images and allows them to be in format different than the template. When
qcow2 is used as the format, the images are now also auto-populated from the
template.
* qemu: Automatically add IOMMU when needed
When domain of 'qemu' or 'kvm' type has more than 255 vCPUs IOMMU with EIM
mode is required. Starting with this release libvirt automatically adds one
(or turns on the EIM mode if there's IOMMU without it).
* ch: allow hostdevs in domain definition
The Cloud Hypervisor driver (ch) now supports ``<hostdev/>``-s.
* ch: Enable callbacks for ch domain events
The Cloud Hypervisor driver (ch) now supports emitting events on domain
define, undefine, start, boot, stop and destroy.
* **Bug fixes**
* qemu: Fix reversion and inactive deletion of internal snapshots with UEFI NVRAM
In `v10.9.0 (2024-11-01)`_ creation of internal snapshots of VMs with UEFI
firmware was allowed, but certain operations such as reversion or inactive
deletion didn't work properly as they didn't consider the NVRAM qcow2 file.
* virnetdevopenvswitch: Warn on unsupported QoS settings
For OpenVSwitch vNICs libivrt does not set QoS directly using 'tc' but
offloads setting to OVS. But OVS is not as feature full as libvirt in this
regard and setting different 'peak' than 'average' results in vNIC always
sticking with 'peak'. Produce a warning if that's the case.
v10.9.0 (2024-11-01)
====================
@ -168,6 +422,17 @@ v10.7.0 (2024-09-02)
domain XML for descendants of the generic PC machine type (``i440fx``,
``q35``, ``xenfv`` and ``isapc``).
* qemu: Add support for hyperv enlightenment feature ``hv-emsr-bitmap``
It is introduced since ``QEMU 7.10``, allowing L0 (KVM) and L1 (Hyper-V)
hypervisors to collaborate to avoid unnecessary updates to L2 MSR-Bitmap
upon vmexits.
* qemu: Add support for hyperv enlightenment feature ``hv-xmm-input``
It is introduced since ``QEMU 7.10``, allowing to pass parameters for
certain hypercalls using XMM registers (“XMM Fast Hypercall Input”).
* **Improvements**
* ch: support restore with network devices
@ -297,6 +562,18 @@ v10.5.0 (2024-07-01)
v10.4.0 (2024-06-03)
====================
* **Security**
* ``CVE-2024-4418``: Fix stack use-after-free in virNetClientIOEventLoop()
Fix race condition leading to a stack use-after-free bug was found in libvirt.
Due to a bad assumption in the virNetClientIOEventLoop() method, the data
pointer to a stack-allocated virNetClientIOEventData structure ended up being
used in the virNetClientIOEventFD callback while the data pointer's stack frame
was concurrently being "freed" when returning from virNetClientIOEventLoop().
This flaw allows a local, unprivileged user to access virtproxyd without
authenticating.
* **New features**
* qemu: Support for ras feature for virt machine type
@ -450,6 +727,18 @@ v10.3.0 (2024-05-02)
v10.2.0 (2024-04-02)
====================
* **Security**
* ``CVE-2024-2494``: remote: check for negative array lengths before allocation
Fix the flaw of the RPC library APIs of libvirt. The RPC server
de-serialization code allocates memory for arrays before the non-negative
length check is performed by the C API entry points. Passing a negative length
to the g_new0 function results in a crash due to the negative length being
treated as a huge positive number. A local unprivileged user could use this
flaw to perform a denial of service attack by causing the libvirt daemon to
crash.
* **New features**
* ch: Basic save and restore support for ch driver
@ -840,6 +1129,10 @@ v9.8.0 (2023-10-02)
<source dev='/dev/vhost-vdpa-0'>
...
* cpu_map: Add the EPYC-Genoa cpu model
This model is introduced since ``QEMU 8.1``.
* **Improvements**
* qemu: add nbdkit backend for network disks

View File

@ -92,8 +92,8 @@ sc_prohibit_raw_virclassnew:
# Avoid raw malloc and free, except in documentation comments.
sc_prohibit_raw_allocation:
@prohibit='^.[^*].*\<((m|c|re)alloc|free) *\([^)]' \
halt='use VIR_ macros from viralloc.h instead of malloc/free' \
@prohibit='^.[^*].*\<((m|c|re)alloc|free|g_malloc) *\([^)]' \
halt='use g_new0/g_malloc0/g_free instead of malloc/free/g_malloc' \
$(_sc_search_regexp)
# Avoid functions that can lead to double-close bugs.
@ -401,6 +401,8 @@ msg_gen_function += virReportError
msg_gen_function += virReportErrorHelper
msg_gen_function += virReportSystemError
msg_gen_function += virLastErrorPrefixMessage
msg_gen_function += vshError
msg_gen_function += vshWarn
# Uncomment the following and run "ninja test" to see diagnostics
# that are not yet marked for translation, but that need to be rewritten
@ -408,7 +410,6 @@ msg_gen_function += virLastErrorPrefixMessage
# msg_gen_function += fprintf
# msg_gen_function += testError
# msg_gen_function += vshPrint
# msg_gen_function += vshError
space = $(null) $(null)
func_re= ($(subst $(space),|,$(msg_gen_function)))
@ -1135,7 +1136,7 @@ sc_prohibit_backup_files:
sc_avoid_remote_reference_to_local_file:
@prohibit='<#' \
in_vc_files='\.rst$$' \
halt='use local reference within a file' \
halt='use `section`_ or `here <section_>`__ instead of `here <#section>`__' \
$(_sc_search_regexp)
# This Perl code is slightly obfuscated. Not only is each "$" doubled
@ -1273,9 +1274,10 @@ po_file ?= $(top_srcdir)/po/POTFILES
# This is all generated files for RPC code.
generated_files = \
$(top_builddir)/src/*.[ch] \
$(top_builddir)/src/*/*.[ch]
$(top_builddir)/src/*/*.[ch] \
$(top_builddir)/src/*/*.policy.in
_gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
_gl_translatable_string_re ?= (^<policyconfig>|\b(N?_|gettext *)\([^)"]*("|$$))
# sc_po_check can fail if generated files are not built first
sc_po_check:
@ -1437,7 +1439,7 @@ exclude_file_name_regexp--sc_require_config_h_first = \
^(examples/|tools/virsh-edit\.c$$|tests/virmockstathelpers\.c$$|scripts/rpcgen/tests/test_demo\.c$$)
exclude_file_name_regexp--sc_trailing_blank = \
/sysinfodata/.*\.data|/virhostcpudata/.*\.cpuinfo|tests/virshtestdata/.*$$
/sysinfodata/.*\.data|/virhostcpudata/.*\.cpuinfo|tests/virshtestdata/.*|docs/fonts|scripts/rpcgen/tests/.*\.bin|tests/viracpidata/.*|tests/virpcitestdata/*|tests/virstoragetestdata/images/.*\.qcow2$$
exclude_file_name_regexp--sc_unmarked_diagnostics = \
^(scripts/apibuild.py|tests/virt-aa-helper-test|docs/js/.*\.js)$$

View File

@ -1,117 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture arm64
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-aarch64-linux-gnu \
libacl1-dev:arm64 \
libapparmor-dev:arm64 \
libattr1-dev:arm64 \
libaudit-dev:arm64 \
libblkid-dev:arm64 \
libc6-dev:arm64 \
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \
libiscsi-dev:arm64 \
libjson-c-dev:arm64 \
libnl-3-dev:arm64 \
libnl-route-3-dev:arm64 \
libnuma-dev:arm64 \
libparted-dev:arm64 \
libpcap0.8-dev:arm64 \
libpciaccess-dev:arm64 \
librbd-dev:arm64 \
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
libxen-dev:arm64 \
libxml2-dev:arm64 \
systemtap-sdt-dev:arm64
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/aarch64-linux-gnu-gcc'\n\
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/aarch64-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'aarch64'\n\
cpu = 'aarch64'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/aarch64-linux-gnu
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="aarch64-linux-gnu"
export MESON_OPTS="--cross-file=aarch64-linux-gnu"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture armel
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-arm-linux-gnueabi \
libacl1-dev:armel \
libapparmor-dev:armel \
libattr1-dev:armel \
libaudit-dev:armel \
libblkid-dev:armel \
libc6-dev:armel \
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libglib2.0-dev:armel \
libglusterfs-dev:armel \
libgnutls28-dev:armel \
libiscsi-dev:armel \
libjson-c-dev:armel \
libnl-3-dev:armel \
libnl-route-3-dev:armel \
libnuma-dev:armel \
libparted-dev:armel \
libpcap0.8-dev:armel \
libpciaccess-dev:armel \
librbd-dev:armel \
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
libxml2-dev:armel \
systemtap-sdt-dev:armel
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/arm-linux-gnueabi-gcc'\n\
ar = '/usr/bin/arm-linux-gnueabi-gcc-ar'\n\
strip = '/usr/bin/arm-linux-gnueabi-strip'\n\
pkgconfig = '/usr/bin/arm-linux-gnueabi-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'arm'\n\
cpu = 'arm'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/arm-linux-gnueabi
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabi-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabi-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="arm-linux-gnueabi"
export MESON_OPTS="--cross-file=arm-linux-gnueabi"

View File

@ -1,117 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture armhf
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-arm-linux-gnueabihf \
libacl1-dev:armhf \
libapparmor-dev:armhf \
libattr1-dev:armhf \
libaudit-dev:armhf \
libblkid-dev:armhf \
libc6-dev:armhf \
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libglib2.0-dev:armhf \
libglusterfs-dev:armhf \
libgnutls28-dev:armhf \
libiscsi-dev:armhf \
libjson-c-dev:armhf \
libnl-3-dev:armhf \
libnl-route-3-dev:armhf \
libnuma-dev:armhf \
libparted-dev:armhf \
libpcap0.8-dev:armhf \
libpciaccess-dev:armhf \
librbd-dev:armhf \
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
libxen-dev:armhf \
libxml2-dev:armhf \
systemtap-sdt-dev:armhf
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/arm-linux-gnueabihf-gcc'\n\
ar = '/usr/bin/arm-linux-gnueabihf-gcc-ar'\n\
strip = '/usr/bin/arm-linux-gnueabihf-strip'\n\
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'arm'\n\
cpu = 'armhf'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/arm-linux-gnueabihf
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabihf-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabihf-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="arm-linux-gnueabihf"
export MESON_OPTS="--cross-file=arm-linux-gnueabihf"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture i386
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-i686-linux-gnu \
libacl1-dev:i386 \
libapparmor-dev:i386 \
libattr1-dev:i386 \
libaudit-dev:i386 \
libblkid-dev:i386 \
libc6-dev:i386 \
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libglib2.0-dev:i386 \
libglusterfs-dev:i386 \
libgnutls28-dev:i386 \
libiscsi-dev:i386 \
libjson-c-dev:i386 \
libnl-3-dev:i386 \
libnl-route-3-dev:i386 \
libnuma-dev:i386 \
libparted-dev:i386 \
libpcap0.8-dev:i386 \
libpciaccess-dev:i386 \
librbd-dev:i386 \
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
libxml2-dev:i386 \
systemtap-sdt-dev:i386
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/i686-linux-gnu-gcc'\n\
ar = '/usr/bin/i686-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/i686-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'x86'\n\
cpu = 'i686'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/i686-linux-gnu
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-linux-gnu-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-linux-gnu-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="i686-linux-gnu"
export MESON_OPTS="--cross-file=i686-linux-gnu"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture mips64el
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-mips64el-linux-gnuabi64 \
libacl1-dev:mips64el \
libapparmor-dev:mips64el \
libattr1-dev:mips64el \
libaudit-dev:mips64el \
libblkid-dev:mips64el \
libc6-dev:mips64el \
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \
libiscsi-dev:mips64el \
libjson-c-dev:mips64el \
libnl-3-dev:mips64el \
libnl-route-3-dev:mips64el \
libnuma-dev:mips64el \
libparted-dev:mips64el \
libpcap0.8-dev:mips64el \
libpciaccess-dev:mips64el \
librbd-dev:mips64el \
libreadline-dev:mips64el \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
libxml2-dev:mips64el \
systemtap-sdt-dev:mips64el
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/mips64el-linux-gnuabi64-gcc'\n\
ar = '/usr/bin/mips64el-linux-gnuabi64-gcc-ar'\n\
strip = '/usr/bin/mips64el-linux-gnuabi64-strip'\n\
pkgconfig = '/usr/bin/mips64el-linux-gnuabi64-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'mips64'\n\
cpu = 'mips64el'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/mips64el-linux-gnuabi64
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips64el-linux-gnuabi64-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips64el-linux-gnuabi64-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="mips64el-linux-gnuabi64"
export MESON_OPTS="--cross-file=mips64el-linux-gnuabi64"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture mipsel
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-mipsel-linux-gnu \
libacl1-dev:mipsel \
libapparmor-dev:mipsel \
libattr1-dev:mipsel \
libaudit-dev:mipsel \
libblkid-dev:mipsel \
libc6-dev:mipsel \
libcap-ng-dev:mipsel \
libcurl4-gnutls-dev:mipsel \
libdevmapper-dev:mipsel \
libfuse-dev:mipsel \
libglib2.0-dev:mipsel \
libglusterfs-dev:mipsel \
libgnutls28-dev:mipsel \
libiscsi-dev:mipsel \
libjson-c-dev:mipsel \
libnl-3-dev:mipsel \
libnl-route-3-dev:mipsel \
libnuma-dev:mipsel \
libparted-dev:mipsel \
libpcap0.8-dev:mipsel \
libpciaccess-dev:mipsel \
librbd-dev:mipsel \
libreadline-dev:mipsel \
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
libssh-gcrypt-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
libxml2-dev:mipsel \
systemtap-sdt-dev:mipsel
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/mipsel-linux-gnu-gcc'\n\
ar = '/usr/bin/mipsel-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/mipsel-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/mipsel-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'mips'\n\
cpu = 'mipsel'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/mipsel-linux-gnu
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mipsel-linux-gnu-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mipsel-linux-gnu-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="mipsel-linux-gnu"
export MESON_OPTS="--cross-file=mipsel-linux-gnu"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture ppc64el
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-powerpc64le-linux-gnu \
libacl1-dev:ppc64el \
libapparmor-dev:ppc64el \
libattr1-dev:ppc64el \
libaudit-dev:ppc64el \
libblkid-dev:ppc64el \
libc6-dev:ppc64el \
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \
libiscsi-dev:ppc64el \
libjson-c-dev:ppc64el \
libnl-3-dev:ppc64el \
libnl-route-3-dev:ppc64el \
libnuma-dev:ppc64el \
libparted-dev:ppc64el \
libpcap0.8-dev:ppc64el \
libpciaccess-dev:ppc64el \
librbd-dev:ppc64el \
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
libxml2-dev:ppc64el \
systemtap-sdt-dev:ppc64el
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/powerpc64le-linux-gnu-gcc'\n\
ar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/powerpc64le-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'ppc64'\n\
cpu = 'powerpc64le'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/powerpc64le-linux-gnu
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/powerpc64le-linux-gnu-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/powerpc64le-linux-gnu-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="powerpc64le-linux-gnu"
export MESON_OPTS="--cross-file=powerpc64le-linux-gnu"

View File

@ -1,116 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture s390x
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y dpkg-dev
apt-get install --no-install-recommends -y \
gcc-s390x-linux-gnu \
libacl1-dev:s390x \
libapparmor-dev:s390x \
libattr1-dev:s390x \
libaudit-dev:s390x \
libblkid-dev:s390x \
libc6-dev:s390x \
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \
libiscsi-dev:s390x \
libjson-c-dev:s390x \
libnl-3-dev:s390x \
libnl-route-3-dev:s390x \
libnuma-dev:s390x \
libparted-dev:s390x \
libpcap0.8-dev:s390x \
libpciaccess-dev:s390x \
librbd-dev:s390x \
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
libxml2-dev:s390x \
systemtap-sdt-dev:s390x
mkdir -p /usr/local/share/meson/cross
printf "[binaries]\n\
c = '/usr/bin/s390x-linux-gnu-gcc'\n\
ar = '/usr/bin/s390x-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/s390x-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 's390x'\n\
cpu = 's390x'\n\
endian = 'big'\n" > /usr/local/share/meson/cross/s390x-linux-gnu
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"
export ABI="s390x-linux-gnu"
export MESON_OPTS="--cross-file=s390x-linux-gnu"

View File

@ -1,100 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
function install_buildenv() {
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
clang \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gcc \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libacl1-dev \
libapparmor-dev \
libattr1-dev \
libaudit-dev \
libblkid-dev \
libc6-dev \
libcap-ng-dev \
libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \
libiscsi-dev \
libjson-c-dev \
libnetcf-dev \
libnl-3-dev \
libnl-route-3-dev \
libnuma-dev \
libparted-dev \
libpcap0.8-dev \
libpciaccess-dev \
librbd-dev \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
libxen-dev \
libxml2-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
systemtap-sdt-dev \
wireshark-dev \
xsltproc
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen
dpkg-reconfigure locales
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
mkdir -p /usr/libexec/ccache-wrappers
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
}
export CCACHE_WRAPPERSDIR="/usr/libexec/ccache-wrappers"
export LANG="en_US.UTF-8"
export MAKE="/usr/bin/make"
export NINJA="/usr/bin/ninja"
export PYTHON="/usr/bin/python3"

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
libssh-gcrypt-dev:mipsel \
libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \

View File

@ -57,7 +57,7 @@ function install_buildenv() {
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \

View File

@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \

View File

@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \

View File

@ -82,7 +82,7 @@ function install_buildenv() {
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \

View File

@ -83,7 +83,7 @@ function install_buildenv() {
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \

View File

@ -57,7 +57,7 @@ function install_buildenv() {
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \

View File

@ -8,7 +8,7 @@ function install_buildenv() {
dnf update -y
dnf install -y \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
codespell \

View File

@ -8,7 +8,7 @@ function install_buildenv() {
dnf update -y
dnf install -y \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
codespell \

View File

@ -9,7 +9,7 @@ function install_buildenv() {
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
clang \
@ -82,6 +82,7 @@ function install_buildenv() {
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
systemtap-sdt-dtrace \
wireshark-devel \
xen-devel
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED

View File

@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@ -10,7 +10,7 @@ CROSS_PKGS=''
MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PIP3='/usr/local/bin/pip'
PKGS='augeas bash-completion ca_root_nss ccache4 codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/alpine:3.19
FROM docker.io/library/alpine:3.21
RUN apk update && \
apk upgrade && \

View File

@ -1,123 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture arm64 && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-aarch64-linux-gnu \
libacl1-dev:arm64 \
libapparmor-dev:arm64 \
libattr1-dev:arm64 \
libaudit-dev:arm64 \
libblkid-dev:arm64 \
libc6-dev:arm64 \
libcap-ng-dev:arm64 \
libcurl4-gnutls-dev:arm64 \
libdevmapper-dev:arm64 \
libfuse-dev:arm64 \
libglib2.0-dev:arm64 \
libglusterfs-dev:arm64 \
libgnutls28-dev:arm64 \
libiscsi-dev:arm64 \
libjson-c-dev:arm64 \
libnl-3-dev:arm64 \
libnl-route-3-dev:arm64 \
libnuma-dev:arm64 \
libparted-dev:arm64 \
libpcap0.8-dev:arm64 \
libpciaccess-dev:arm64 \
librbd-dev:arm64 \
libreadline-dev:arm64 \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \
libxen-dev:arm64 \
libxml2-dev:arm64 \
systemtap-sdt-dev:arm64 && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/aarch64-linux-gnu-gcc'\n\
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/aarch64-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'aarch64'\n\
cpu = 'aarch64'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/aarch64-linux-gnu && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-gcc
ENV ABI "aarch64-linux-gnu"
ENV MESON_OPTS "--cross-file=aarch64-linux-gnu"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture armel && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-arm-linux-gnueabi \
libacl1-dev:armel \
libapparmor-dev:armel \
libattr1-dev:armel \
libaudit-dev:armel \
libblkid-dev:armel \
libc6-dev:armel \
libcap-ng-dev:armel \
libcurl4-gnutls-dev:armel \
libdevmapper-dev:armel \
libfuse-dev:armel \
libglib2.0-dev:armel \
libglusterfs-dev:armel \
libgnutls28-dev:armel \
libiscsi-dev:armel \
libjson-c-dev:armel \
libnl-3-dev:armel \
libnl-route-3-dev:armel \
libnuma-dev:armel \
libparted-dev:armel \
libpcap0.8-dev:armel \
libpciaccess-dev:armel \
librbd-dev:armel \
libreadline-dev:armel \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \
libxml2-dev:armel \
systemtap-sdt-dev:armel && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/arm-linux-gnueabi-gcc'\n\
ar = '/usr/bin/arm-linux-gnueabi-gcc-ar'\n\
strip = '/usr/bin/arm-linux-gnueabi-strip'\n\
pkgconfig = '/usr/bin/arm-linux-gnueabi-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'arm'\n\
cpu = 'arm'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/arm-linux-gnueabi && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabi-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabi-gcc
ENV ABI "arm-linux-gnueabi"
ENV MESON_OPTS "--cross-file=arm-linux-gnueabi"

View File

@ -1,123 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture armhf && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-arm-linux-gnueabihf \
libacl1-dev:armhf \
libapparmor-dev:armhf \
libattr1-dev:armhf \
libaudit-dev:armhf \
libblkid-dev:armhf \
libc6-dev:armhf \
libcap-ng-dev:armhf \
libcurl4-gnutls-dev:armhf \
libdevmapper-dev:armhf \
libfuse-dev:armhf \
libglib2.0-dev:armhf \
libglusterfs-dev:armhf \
libgnutls28-dev:armhf \
libiscsi-dev:armhf \
libjson-c-dev:armhf \
libnl-3-dev:armhf \
libnl-route-3-dev:armhf \
libnuma-dev:armhf \
libparted-dev:armhf \
libpcap0.8-dev:armhf \
libpciaccess-dev:armhf \
librbd-dev:armhf \
libreadline-dev:armhf \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \
libxen-dev:armhf \
libxml2-dev:armhf \
systemtap-sdt-dev:armhf && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/arm-linux-gnueabihf-gcc'\n\
ar = '/usr/bin/arm-linux-gnueabihf-gcc-ar'\n\
strip = '/usr/bin/arm-linux-gnueabihf-strip'\n\
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'arm'\n\
cpu = 'armhf'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/arm-linux-gnueabihf && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabihf-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/arm-linux-gnueabihf-gcc
ENV ABI "arm-linux-gnueabihf"
ENV MESON_OPTS "--cross-file=arm-linux-gnueabihf"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture i386 && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-i686-linux-gnu \
libacl1-dev:i386 \
libapparmor-dev:i386 \
libattr1-dev:i386 \
libaudit-dev:i386 \
libblkid-dev:i386 \
libc6-dev:i386 \
libcap-ng-dev:i386 \
libcurl4-gnutls-dev:i386 \
libdevmapper-dev:i386 \
libfuse-dev:i386 \
libglib2.0-dev:i386 \
libglusterfs-dev:i386 \
libgnutls28-dev:i386 \
libiscsi-dev:i386 \
libjson-c-dev:i386 \
libnl-3-dev:i386 \
libnl-route-3-dev:i386 \
libnuma-dev:i386 \
libparted-dev:i386 \
libpcap0.8-dev:i386 \
libpciaccess-dev:i386 \
librbd-dev:i386 \
libreadline-dev:i386 \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \
libxml2-dev:i386 \
systemtap-sdt-dev:i386 && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/i686-linux-gnu-gcc'\n\
ar = '/usr/bin/i686-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/i686-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/i686-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'x86'\n\
cpu = 'i686'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/i686-linux-gnu && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-linux-gnu-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/i686-linux-gnu-gcc
ENV ABI "i686-linux-gnu"
ENV MESON_OPTS "--cross-file=i686-linux-gnu"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture mips64el && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-mips64el-linux-gnuabi64 \
libacl1-dev:mips64el \
libapparmor-dev:mips64el \
libattr1-dev:mips64el \
libaudit-dev:mips64el \
libblkid-dev:mips64el \
libc6-dev:mips64el \
libcap-ng-dev:mips64el \
libcurl4-gnutls-dev:mips64el \
libdevmapper-dev:mips64el \
libfuse-dev:mips64el \
libglib2.0-dev:mips64el \
libglusterfs-dev:mips64el \
libgnutls28-dev:mips64el \
libiscsi-dev:mips64el \
libjson-c-dev:mips64el \
libnl-3-dev:mips64el \
libnl-route-3-dev:mips64el \
libnuma-dev:mips64el \
libparted-dev:mips64el \
libpcap0.8-dev:mips64el \
libpciaccess-dev:mips64el \
librbd-dev:mips64el \
libreadline-dev:mips64el \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \
libxml2-dev:mips64el \
systemtap-sdt-dev:mips64el && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/mips64el-linux-gnuabi64-gcc'\n\
ar = '/usr/bin/mips64el-linux-gnuabi64-gcc-ar'\n\
strip = '/usr/bin/mips64el-linux-gnuabi64-strip'\n\
pkgconfig = '/usr/bin/mips64el-linux-gnuabi64-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'mips64'\n\
cpu = 'mips64el'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/mips64el-linux-gnuabi64 && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips64el-linux-gnuabi64-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mips64el-linux-gnuabi64-gcc
ENV ABI "mips64el-linux-gnuabi64"
ENV MESON_OPTS "--cross-file=mips64el-linux-gnuabi64"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture mipsel && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-mipsel-linux-gnu \
libacl1-dev:mipsel \
libapparmor-dev:mipsel \
libattr1-dev:mipsel \
libaudit-dev:mipsel \
libblkid-dev:mipsel \
libc6-dev:mipsel \
libcap-ng-dev:mipsel \
libcurl4-gnutls-dev:mipsel \
libdevmapper-dev:mipsel \
libfuse-dev:mipsel \
libglib2.0-dev:mipsel \
libglusterfs-dev:mipsel \
libgnutls28-dev:mipsel \
libiscsi-dev:mipsel \
libjson-c-dev:mipsel \
libnl-3-dev:mipsel \
libnl-route-3-dev:mipsel \
libnuma-dev:mipsel \
libparted-dev:mipsel \
libpcap0.8-dev:mipsel \
libpciaccess-dev:mipsel \
librbd-dev:mipsel \
libreadline-dev:mipsel \
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
libssh-gcrypt-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \
libxml2-dev:mipsel \
systemtap-sdt-dev:mipsel && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/mipsel-linux-gnu-gcc'\n\
ar = '/usr/bin/mipsel-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/mipsel-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/mipsel-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'mips'\n\
cpu = 'mipsel'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/mipsel-linux-gnu && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mipsel-linux-gnu-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/mipsel-linux-gnu-gcc
ENV ABI "mipsel-linux-gnu"
ENV MESON_OPTS "--cross-file=mipsel-linux-gnu"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture ppc64el && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-powerpc64le-linux-gnu \
libacl1-dev:ppc64el \
libapparmor-dev:ppc64el \
libattr1-dev:ppc64el \
libaudit-dev:ppc64el \
libblkid-dev:ppc64el \
libc6-dev:ppc64el \
libcap-ng-dev:ppc64el \
libcurl4-gnutls-dev:ppc64el \
libdevmapper-dev:ppc64el \
libfuse-dev:ppc64el \
libglib2.0-dev:ppc64el \
libglusterfs-dev:ppc64el \
libgnutls28-dev:ppc64el \
libiscsi-dev:ppc64el \
libjson-c-dev:ppc64el \
libnl-3-dev:ppc64el \
libnl-route-3-dev:ppc64el \
libnuma-dev:ppc64el \
libparted-dev:ppc64el \
libpcap0.8-dev:ppc64el \
libpciaccess-dev:ppc64el \
librbd-dev:ppc64el \
libreadline-dev:ppc64el \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \
libxml2-dev:ppc64el \
systemtap-sdt-dev:ppc64el && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/powerpc64le-linux-gnu-gcc'\n\
ar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/powerpc64le-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 'ppc64'\n\
cpu = 'powerpc64le'\n\
endian = 'little'\n" > /usr/local/share/meson/cross/powerpc64le-linux-gnu && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/powerpc64le-linux-gnu-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/powerpc64le-linux-gnu-gcc
ENV ABI "powerpc64le-linux-gnu"
ENV MESON_OPTS "--cross-file=powerpc64le-linux-gnu"

View File

@ -1,122 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libclang-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture s390x && \
eatmydata apt-get update && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
eatmydata apt-get install --no-install-recommends -y \
gcc-s390x-linux-gnu \
libacl1-dev:s390x \
libapparmor-dev:s390x \
libattr1-dev:s390x \
libaudit-dev:s390x \
libblkid-dev:s390x \
libc6-dev:s390x \
libcap-ng-dev:s390x \
libcurl4-gnutls-dev:s390x \
libdevmapper-dev:s390x \
libfuse-dev:s390x \
libglib2.0-dev:s390x \
libglusterfs-dev:s390x \
libgnutls28-dev:s390x \
libiscsi-dev:s390x \
libjson-c-dev:s390x \
libnl-3-dev:s390x \
libnl-route-3-dev:s390x \
libnuma-dev:s390x \
libparted-dev:s390x \
libpcap0.8-dev:s390x \
libpciaccess-dev:s390x \
librbd-dev:s390x \
libreadline-dev:s390x \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \
libxml2-dev:s390x \
systemtap-sdt-dev:s390x && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
mkdir -p /usr/local/share/meson/cross && \
printf "[binaries]\n\
c = '/usr/bin/s390x-linux-gnu-gcc'\n\
ar = '/usr/bin/s390x-linux-gnu-gcc-ar'\n\
strip = '/usr/bin/s390x-linux-gnu-strip'\n\
pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'\n\
\n\
[host_machine]\n\
system = 'linux'\n\
cpu_family = 's390x'\n\
cpu = 's390x'\n\
endian = 'big'\n" > /usr/local/share/meson/cross/s390x-linux-gnu && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-gcc
ENV ABI "s390x-linux-gnu"
ENV MESON_OPTS "--cross-file=s390x-linux-gnu"

View File

@ -1,103 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/debian:11-slim
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
black \
ca-certificates \
ccache \
clang \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gcc \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libacl1-dev \
libapparmor-dev \
libattr1-dev \
libaudit-dev \
libblkid-dev \
libc6-dev \
libcap-ng-dev \
libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \
libiscsi-dev \
libjson-c-dev \
libnetcf-dev \
libnl-3-dev \
libnl-route-3-dev \
libnuma-dev \
libparted-dev \
libpcap0.8-dev \
libpciaccess-dev \
librbd-dev \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
libxen-dev \
libxml2-dev \
libxml2-utils \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
python3-pytest \
qemu-utils \
sed \
systemtap-sdt-dev \
wireshark-dev \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mipsel \
libsasl2-dev:mipsel \
libselinux1-dev:mipsel \
libssh-gcrypt-dev:mipsel \
libssh-dev:mipsel \
libssh2-1-dev:mipsel \
libtirpc-dev:mipsel \
libudev-dev:mipsel \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \

View File

@ -59,7 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:arm64 \
libsasl2-dev:arm64 \
libselinux1-dev:arm64 \
libssh-gcrypt-dev:arm64 \
libssh-dev:arm64 \
libssh2-1-dev:arm64 \
libtirpc-dev:arm64 \
libudev-dev:arm64 \

View File

@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armel \
libsasl2-dev:armel \
libselinux1-dev:armel \
libssh-gcrypt-dev:armel \
libssh-dev:armel \
libssh2-1-dev:armel \
libtirpc-dev:armel \
libudev-dev:armel \

View File

@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:armhf \
libsasl2-dev:armhf \
libselinux1-dev:armhf \
libssh-gcrypt-dev:armhf \
libssh-dev:armhf \
libssh2-1-dev:armhf \
libtirpc-dev:armhf \
libudev-dev:armhf \

View File

@ -93,7 +93,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:i386 \
libsasl2-dev:i386 \
libselinux1-dev:i386 \
libssh-gcrypt-dev:i386 \
libssh-dev:i386 \
libssh2-1-dev:i386 \
libtirpc-dev:i386 \
libudev-dev:i386 \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:mips64el \
libsasl2-dev:mips64el \
libselinux1-dev:mips64el \
libssh-gcrypt-dev:mips64el \
libssh-dev:mips64el \
libssh2-1-dev:mips64el \
libtirpc-dev:mips64el \
libudev-dev:mips64el \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:ppc64el \
libsasl2-dev:ppc64el \
libselinux1-dev:ppc64el \
libssh-gcrypt-dev:ppc64el \
libssh-dev:ppc64el \
libssh2-1-dev:ppc64el \
libtirpc-dev:ppc64el \
libudev-dev:ppc64el \

View File

@ -94,7 +94,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev:s390x \
libsasl2-dev:s390x \
libselinux1-dev:s390x \
libssh-gcrypt-dev:s390x \
libssh-dev:s390x \
libssh2-1-dev:s390x \
libtirpc-dev:s390x \
libudev-dev:s390x \

View File

@ -59,7 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-gcrypt-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \

View File

@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:40
FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@ -19,7 +19,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
codespell \

View File

@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:40
FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@ -19,7 +19,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf update -y && \
nosync dnf install -y \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
codespell \

View File

@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:39
FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y nosync && \
printf '#!/bin/sh\n\
@ -20,7 +20,7 @@ exec "$@"\n' > /usr/bin/nosync && \
nosync dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
bash-completion-devel \
ca-certificates \
ccache \
clang \
@ -93,6 +93,7 @@ exec "$@"\n' > /usr/bin/nosync && \
systemd-devel \
systemd-rpm-macros \
systemtap-sdt-devel \
systemtap-sdt-dtrace \
wireshark-devel \
xen-devel && \
nosync dnf autoremove -y && \

View File

@ -11,8 +11,11 @@
# - RUN_PIPELINE - force creation of a CI pipeline when
# pushing to a branch in a forked repository. Official
# CI pipelines are triggered when merge requests are
# created/updated. Setting this variable to a non-empty
# value allows CI testing prior to opening a merge request.
# created/updated. Setting this variable allows CI
# testing prior to opening a merge request. A value
# of "0" will create the pipeline but leave all jobs
# to be manually started, while "1" will immediately
# run all default jobs.
#
# - RUN_PIPELINE_UPSTREAM_ENV - same semantics as RUN_PIPELINE,
# but uses the CI environment (containers) from the upstream project
@ -38,11 +41,13 @@
#
# Aliases can be set for common usage
#
# $ git config --local alias.push-ci "push -o ci.variable=RUN_PIPELINE=1"
# $ git config --local alias.push-ci "push -o ci.variable=RUN_PIPELINE=0"
# $ git config --local alias.push-ci-now "push -o ci.variable=RUN_PIPELINE=1"
#
# Allowing the less verbose invocation
#
# $ git push-ci
# $ git push-ci (create pipeline but don't start jobs)
# $ git push-ci-now (create pipeline and start default jobs)
#
# Pipeline variables can also be set in the repository
# pipeline config globally, or set against scheduled pipelines
@ -50,6 +55,7 @@
variables:
RUN_UPSTREAM_NAMESPACE: libvirt
CONTAINER_UPSTREAM_NAMESPACE: libvirt
FF_SCRIPT_SECTIONS: 1

View File

@ -35,7 +35,7 @@
fi
- cat /packages.txt
variables:
IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
IMAGE: $CI_REGISTRY/$CONTAINER_UPSTREAM_NAMESPACE/libvirt/ci-$NAME:latest
rules:
### PUSH events
@ -47,19 +47,27 @@
when: on_success
# forks: pushes to a branch when a pipeline run in upstream env is explicitly requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "0"'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1"'
when: on_success
# forks: pushes to branches with pipeline requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "0"'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1"'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
@ -171,7 +179,7 @@
fi
- cat /packages.txt
variables:
IMAGE: $CI_REGISTRY/$RUN_UPSTREAM_NAMESPACE/libvirt/ci-$NAME-cross-$CROSS:latest
IMAGE: $CI_REGISTRY/$CONTAINER_UPSTREAM_NAMESPACE/libvirt/ci-$NAME-cross-$CROSS:latest
rules:
### PUSH events
@ -183,19 +191,27 @@
when: on_success
# forks: pushes to a branch when a pipeline run in upstream env is explicitly requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "0"'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1"'
when: on_success
# forks: pushes to branches with pipeline requested
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "0"'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
variables:
IMAGE: $TARGET_BASE_IMAGE
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1"'
when: on_success
variables:
IMAGE: $TARGET_BASE_IMAGE
@ -302,15 +318,21 @@
when: on_success
# forks: pushes to branches with pipeline requested (including pipeline in upstream environment)
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "0"'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE == "1"'
when: on_success
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV && $JOB_OPTIONAL'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "0"'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1" && $JOB_OPTIONAL'
when: manual
allow_failure: true
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $RUN_PIPELINE_UPSTREAM_ENV == "1"'
when: on_success
# upstream+forks: Run pipelines on MR, web, api & scheduled

View File

@ -33,15 +33,15 @@ x86_64-almalinux-9-clang:
TARGET_BASE_IMAGE: docker.io/library/almalinux:9
x86_64-alpine-319:
x86_64-alpine-321:
extends: .native_build_job
needs:
- job: x86_64-alpine-319-container
- job: x86_64-alpine-321-container
optional: true
allow_failure: false
variables:
NAME: alpine-319
TARGET_BASE_IMAGE: docker.io/library/alpine:3.19
NAME: alpine-321
TARGET_BASE_IMAGE: docker.io/library/alpine:3.21
x86_64-alpine-edge:
@ -70,30 +70,6 @@ x86_64-centos-stream-9:
- libvirt-rpms
x86_64-debian-11:
extends: .native_build_job
needs:
- job: x86_64-debian-11-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
x86_64-debian-11-clang:
extends: .native_build_job
needs:
- job: x86_64-debian-11-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
x86_64-debian-12:
extends: .native_build_job
needs:
@ -127,21 +103,6 @@ x86_64-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
x86_64-fedora-39:
extends: .native_build_job
needs:
- job: x86_64-fedora-39-container
optional: true
allow_failure: false
variables:
NAME: fedora-39
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:39
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-40:
extends: .native_build_job
needs:
@ -157,6 +118,21 @@ x86_64-fedora-40:
- libvirt-rpms
x86_64-fedora-41:
extends: .native_build_job
needs:
- job: x86_64-fedora-41-container
optional: true
allow_failure: false
variables:
NAME: fedora-41
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-rawhide:
extends: .native_build_job
needs:
@ -246,110 +222,6 @@ x86_64-ubuntu-2404-clang:
# Cross build jobs
aarch64-debian-11:
extends: .cross_build_job
needs:
- job: aarch64-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: aarch64
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
armv6l-debian-11:
extends: .cross_build_job
needs:
- job: armv6l-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: armv6l
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
armv7l-debian-11:
extends: .cross_build_job
needs:
- job: armv7l-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: armv7l
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
i686-debian-11:
extends: .cross_build_job
needs:
- job: i686-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: i686
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
mips64el-debian-11:
extends: .cross_build_job
needs:
- job: mips64el-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: mips64el
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
mipsel-debian-11:
extends: .cross_build_job
needs:
- job: mipsel-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: mipsel
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
ppc64le-debian-11:
extends: .cross_build_job
needs:
- job: ppc64le-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: ppc64le
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
s390x-debian-11:
extends: .cross_build_job
needs:
- job: s390x-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: s390x
JOB_OPTIONAL: 1
NAME: debian-11
TARGET_BASE_IMAGE: docker.io/library/debian:11-slim
aarch64-debian-12:
extends: .cross_build_job
needs:
@ -544,29 +416,29 @@ s390x-debian-sid:
TARGET_BASE_IMAGE: docker.io/library/debian:sid-slim
mingw32-fedora-40:
mingw32-fedora-41:
extends: .cross_build_job
needs:
- job: mingw32-fedora-40-container
- job: mingw32-fedora-41-container
optional: true
allow_failure: false
variables:
CROSS: mingw32
JOB_OPTIONAL: 1
NAME: fedora-40
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
NAME: fedora-41
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
mingw64-fedora-40:
mingw64-fedora-41:
extends: .cross_build_job
needs:
- job: mingw64-fedora-40-container
- job: mingw64-fedora-41-container
optional: true
allow_failure: false
variables:
CROSS: mingw64
NAME: fedora-40
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:40
NAME: fedora-41
TARGET_BASE_IMAGE: registry.fedoraproject.org/fedora:41
mingw32-fedora-rawhide:
@ -602,7 +474,7 @@ x86_64-freebsd-13:
allow_failure:
exit_codes: 3
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-13-3
CIRRUS_VM_IMAGE_NAME: freebsd-13-4
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
@ -617,7 +489,7 @@ x86_64-freebsd-14:
allow_failure:
exit_codes: 3
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-14-0
CIRRUS_VM_IMAGE_NAME: freebsd-14-2
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y

View File

@ -14,11 +14,11 @@ x86_64-almalinux-9-container:
NAME: almalinux-9
x86_64-alpine-319-container:
x86_64-alpine-321-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-319
NAME: alpine-321
x86_64-alpine-edge-container:
@ -35,14 +35,6 @@ x86_64-centos-stream-9-container:
NAME: centos-stream-9
x86_64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11
x86_64-debian-12-container:
extends: .container_job
allow_failure: false
@ -57,13 +49,6 @@ x86_64-debian-sid-container:
NAME: debian-sid
x86_64-fedora-39-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-39
x86_64-fedora-40-container:
extends: .container_job
allow_failure: false
@ -71,6 +56,13 @@ x86_64-fedora-40-container:
NAME: fedora-40
x86_64-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-41
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
@ -109,70 +101,6 @@ x86_64-ubuntu-2404-container:
# Cross container jobs
aarch64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-aarch64
armv6l-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-armv6l
armv7l-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-armv7l
i686-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-i686
mips64el-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-mips64el
mipsel-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-mipsel
ppc64le-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-ppc64le
s390x-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-s390x
aarch64-debian-12-container:
extends: .container_job
allow_failure: false
@ -292,19 +220,19 @@ s390x-debian-sid-container:
NAME: debian-sid-cross-s390x
mingw32-fedora-40-container:
mingw32-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: fedora-40-cross-mingw32
NAME: fedora-41-cross-mingw32
mingw64-fedora-40-container:
mingw64-fedora-41-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-40-cross-mingw64
NAME: fedora-41-cross-mingw64
mingw32-fedora-rawhide-container:

View File

@ -18,9 +18,13 @@ check-dco:
when: on_success
# forks: pushes to branches with pipeline requested (including upstream env pipelines)
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE == "0"'
when: manual
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE == "1"'
when: on_success
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV'
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV == "0"'
when: manual
- if: '$CI_PROJECT_NAMESPACE != $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $RUN_PIPELINE_UPSTREAM_ENV == "1"'
when: on_success
# upstream+forks: that's all folks

View File

@ -29,23 +29,23 @@ centos-stream-9-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
fedora-39-tests:
fedora-41-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-39
DISTRO: fedora-41
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- x86_64-fedora-39
- x86_64-fedora-41
- project: libvirt/libvirt-perl
job: x86_64-fedora-39
job: x86_64-fedora-41
ref: master
artifacts: true
- project: libvirt/libvirt-python
job: x86_64-fedora-39
job: x86_64-fedora-41
ref: master
artifacts: true
@ -53,22 +53,22 @@ fedora-39-tests:
# and libvirt-python CI jobs, so the new target needs to be introduced
# there before it can be used here. The VM template for the target
# also needs to be created on the runner host.
.fedora-39-upstream-qemu-tests:
.fedora-41-upstream-qemu-tests:
extends: .integration_tests
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-39
DISTRO: fedora-41
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
needs:
- x86_64-fedora-39
- x86_64-fedora-41
- project: libvirt/libvirt-perl
job: x86_64-fedora-39
job: x86_64-fedora-41
ref: master
artifacts: true
- project: libvirt/libvirt-python
job: x86_64-fedora-39
job: x86_64-fedora-41
ref: master
artifacts: true

View File

@ -124,6 +124,9 @@ run_integration() {
DAEMONS="virtinterfaced virtlockd virtlogd virtnetworkd virtnodedevd virtnwfilterd virtproxyd virtqemud virtsecretd virtstoraged"
fi
# Force libvirt to use iptables to make sure libvirt-tck tests don't fail
run_cmd_quiet sudo augtool set /files/etc/libvirt/network.conf/firewall_backend "'iptables'"
echo "DAEMONS=$DAEMONS"
for daemon in $DAEMONS
do

View File

@ -19,7 +19,7 @@ targets:
RPM: skip
CC: clang
alpine-319: x86_64
alpine-321: x86_64
alpine-edge:
jobs:
@ -34,46 +34,6 @@ targets:
paths:
- libvirt-rpms
debian-11:
jobs:
- arch: x86_64
builds: false
- arch: x86_64
suffix: -clang
builds: false
- arch: aarch64
containers: false
builds: false
- arch: armv6l
containers: false
builds: false
- arch: armv7l
builds: false
- arch: i686
containers: false
builds: false
- arch: mips64el
containers: false
builds: false
- arch: mipsel
containers: false
builds: false
- arch: ppc64le
containers: false
builds: false
- arch: s390x
containers: false
builds: false
debian-12:
jobs:
- arch: x86_64
@ -144,7 +104,7 @@ targets:
containers: false
builds: false
fedora-39:
fedora-40:
jobs:
- arch: x86_64
artifacts:
@ -152,7 +112,7 @@ targets:
paths:
- libvirt-rpms
fedora-40:
fedora-41:
jobs:
- arch: x86_64
artifacts:

View File

@ -26,7 +26,7 @@ name will default to a preselected hypervisor, but it's probably not a
wise thing to do in most cases. See the `connection URI <uri.html>`__
page for a full descriptions of the values allowed.
OnDevice the application obtains a
Once the application obtains a
`virConnectPtr <html/libvirt-libvirt-host.html#virConnectPtr>`__
connection to the hypervisor it can then use it to manage the
hypervisor's available domains and related virtualization resources,

View File

@ -206,6 +206,11 @@ Libraries
Allows using simple ruby objects to manipulate hypervisors, guests,
storage, network etc. It is based on top of the `native ruby
bindings <https://ruby.libvirt.org/>`__.
`Perl Async bindings <https://github.com/ehuelsmann/perl-sys-async-virt#readme>`__
Perl `Sys::Async::Virt library <https://metacpan.org/pod/Sys::Async::Virt>`__
supporting the asynchronous paradigm introduced by `Future::AsyncAwait
<https://metacpan.org/pod/Future::AsyncAwait>`__ that tries to stay close to
the `Sys::Virt API <https://metacpan.org/pod/Sys::Virt>`__.
LiveCD / Appliances
-------------------

View File

@ -268,24 +268,34 @@ harddisk, cdrom, network) determining where to obtain/find the boot image.
Some UEFI firmwares may want to use a non-volatile memory to store some
variables. In the host, this is represented as a file and the absolute path
to the file is stored in this element. Moreover, when the domain is started
up libvirt copies so called master NVRAM store file defined in ``qemu.conf``.
If needed, the ``template`` attribute can be used to per domain override map
of master NVRAM stores from the config file. Note, that for transient domains
if the NVRAM file has been created by libvirt it is left behind and it is
management application's responsibility to save and remove file (if needed to
be persistent). :since:`Since 1.2.8`
up libvirt copies so called master NVRAM store file either selected by the
firmware autoselection process or defined in ``qemu.conf``.
If needed, the ``template`` attribute can be used to override the
automatically chosen NVRAM template and ``templateFormat`` to specify the
format for the template file (currently supported are ``raw`` and ``qcow2``).
When firmware auto-selection is in use the ``templateFormat`` field reflects
the format of the picked template. :since:`Since 10.10.0 (QEMU only)`
Note, that for transient domains if the NVRAM file has been created by
libvirt it is left behind and it is management application's responsibility
to save and remove file (if needed to be persistent). :since:`Since 1.2.8`
:since:`Since 8.5.0`, it's possible for the element to have ``type`` attribute
(accepts values ``file``, ``block`` and ``network``) in that case the NVRAM
storage is described by a ``<source>`` sub-element with the same syntax as
``disk``'s source. See `Hard drives, floppy disks, CDROMs`_.
``disk``'s source. See `Hard drives, floppy disks, CDROMs`_. For ``block``
backed NVRAM images it may be necessary to ensure that the block device
has the correct guest visible size based on hypervisor expectations. This
may require use of non ``raw`` format image that allows arbitrary disk
size.
**Note:** ``network`` backed NVRAM the variables are not instantiated from
the ``template`` and it's user's responsibility to provide a valid NVRAM image.
This element supports a ``format`` attribute, which has the same semantics
as the attribute of the same name for the ``<loader>`` element.
:since:`Since 9.2.0 (QEMU only)`
This element supports a ``format`` attribute, which specifies the format
of the NVRAM image. :since:`Since 9.2.0 (QEMU only)` Note that hypervisors
may not support automatic population of the nvram if ``format`` differs from
``templateFormat`` or may support only a specific ``format``.
It is not valid to provide this element if the loader is marked as
stateless.
@ -387,6 +397,7 @@ and full virtualized guests.
<kernel>/root/f8-i386-vmlinuz</kernel>
<initrd>/root/f8-i386-initrd</initrd>
<cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
<shim>/path/to/shim.efi</shim>
<dtb>/root/ppc.dtb</dtb>
</os>
...
@ -407,6 +418,10 @@ and full virtualized guests.
The contents of this element specify arguments to be passed to the kernel (or
installer) at boot time. This is often used to specify an alternate primary
console (eg serial port), or the installation media source / kickstart file
``shim``
Use specified fully-qualified path to load an initial UEFI bootloader that
handles chaining to a trusted full bootloader under secure boot
environments.
``dtb``
The contents of this element specify the fully-qualified path to the
(optional) device tree binary (dtb) image in the host OS.
@ -480,9 +495,26 @@ These options apply to any form of booting of the guest OS.
...
``acpi``
The ``table`` element contains a fully-qualified path to the ACPI table. The
``type`` attribute contains the ACPI table type (currently only ``slic`` is
supported) :since:`Since 1.3.5 (QEMU)` :since:`Since 5.9.0 (Xen)`
The ``table`` element contains a fully-qualified path to the ACPI table,
with the ``type`` attribute dictating what data must be present in the
file:
* ``raw``: a single ACPI table with header and data, with ACPI
signature auto-detected from header (:since:`Since 11.2.0 (QEMU)`).
* ``rawset``: concatenation of multiple ACPI tables with header
and data, each with any ACPI signature, auto-detected from header
(:since:`Since 11.2.0 (Xen)`).
* ``slic``: a single ACPI table with header and data, providing
software licensing information. The ACPI table signature in the
header will be forced to ``SLIC`` (:since:`Since 1.3.5 (QEMU)`,
mis-interpreted as ``rawset`` :since:`Since 5.9.0 (Xen)`).
* ``msdm``: a single ACPI table with header and data, providing
Microsoft Data Management information. The ACPI table signature
in the header will be forced to ``MSDM``
(:since:`Since 11.2.0 (QEMU)`).
Each type may be used only once, except for ``raw`` which can
appear multiple times.
SMBIOS System Information
@ -1478,38 +1510,46 @@ In case no restrictions need to be put on CPU model and its features, a simpler
presented to the guest. This is the default when no ``mode`` attribute is
specified. This mode makes it so that a persistent guest will see the same
hardware no matter what host the guest is booted on.
``host-model``
The ``host-model`` mode is essentially a shortcut to copying host CPU
definition from capabilities XML into domain XML. Since the CPU definition
is copied just before starting a domain, exactly the same XML can be used
on different hosts while still providing the best guest CPU each host
supports. The ``match`` attribute can't be used in this mode. Specifying
CPU model is not supported either, but ``model``'s ``fallback`` attribute
may still be used. Using the ``feature`` element, specific flags may be
enabled or disabled specifically in addition to the host model. This may
be used to fine tune features that can be emulated. :since:`(Since 1.1.1)`
. Libvirt does not model every aspect of each CPU so the guest CPU will
not match the host CPU exactly. On the other hand, the ABI provided to the
The ``host-model`` mode is essentially a shortcut to copying host-model
CPU definition from `domain capabilities XML
<formatdomaincaps.html#cpu-configuration>`__ into domain XML. Since the
CPU definition is copied just before starting a domain, exactly the same
XML can be used on different hosts while still providing the best guest
CPU each host supports. The ``match`` attribute can't be used in this
mode. Specifying CPU model is not supported either, but ``model``'s
``fallback`` attribute may still be used. Using the ``feature`` element,
specific flags may be enabled or disabled specifically in addition to the
host model. This may be used to fine tune features that can be emulated.
:since:`(Since 1.1.1)`
Libvirt does not model every aspect of each CPU so the guest CPU will not
match the host CPU exactly. On the other hand, the ABI provided to the
guest is reproducible. During migration, complete CPU model definition is
transferred to the destination host so the migrated guest will see exactly
the same CPU model for the running instance of the guest, even if the
destination host contains more capable CPUs or newer kernel; but shutting
down and restarting the guest may present different hardware to the guest
according to the capabilities of the new host. Prior to libvirt 3.2.0 and
QEMU 2.9.0 detection of the host CPU model via QEMU is not supported. Thus
the CPU configuration created using ``host-model`` may not work as
expected. :since:`Since 3.2.0 and QEMU 2.9.0` this mode works the way it
was designed and it is indicated by the ``fallback`` attribute set to
``forbid`` in the host-model CPU definition advertised in `domain
capabilities XML <formatdomaincaps.html#cpu-configuration>`__. When
``fallback`` attribute is set to ``allow`` in the domain capabilities
XML, it is recommended to use ``custom`` mode with just the CPU model
from the host capabilities XML. :since:`Since 1.2.11` PowerISA allows
processors to run VMs in binary compatibility mode supporting an older
version of ISA. Libvirt on PowerPC architecture uses the ``host-model``
to signify a guest mode CPU running in binary compatibility mode.
Example: When a user needs a power7 VM to run in compatibility mode on a
Power8 host, this can be described in XML as follows :
transferred to the destination host so the migrated guest will see
exactly the same CPU model for the running instance of the guest, even if
the destination host contains more capable CPUs or newer kernel; but
shutting down and restarting the guest may present different hardware to
the guest according to the capabilities of the new host.
Prior to libvirt 3.2.0 and QEMU 2.9.0 detection of the host CPU model via
QEMU is not supported. Thus the CPU configuration created using
``host-model`` may not work as expected. :since:`Since 3.2.0 and QEMU
2.9.0` this mode works the way it was designed and it is indicated by the
``fallback`` attribute set to ``forbid`` in the host-model CPU definition
advertised in `domain capabilities XML
<formatdomaincaps.html#cpu-configuration>`__. When ``fallback`` attribute
is set to ``allow`` in the domain capabilities XML, it is recommended to
use ``custom`` mode with just the CPU model from the host capabilities
XML.
:since:`Since 1.2.11` PowerISA allows processors to run VMs in binary
compatibility mode supporting an older version of ISA. Libvirt on
PowerPC architecture uses the ``host-model`` to signify a guest mode CPU
running in binary compatibility mode. Example: When a user needs a power7
VM to run in compatibility mode on a Power8 host, this can be described
in XML as follows:
::
@ -1989,7 +2029,10 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off.
<vendor_id state='on' value='KVM Hv'/>
<frequencies state='on'/>
<reenlightenment state='on'/>
<tlbflush state='on'/>
<tlbflush state='on'>
<direct state='on'/>
<extended state='on'/>
</tlbflush>
<ipi state='on'/>
<evmcs state='on'/>
<emsr_bitmap state='on'/>
@ -2028,6 +2071,7 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off.
<async-teardown enabled='yes'/>
<ras state='on'/>
<ps2 state='on'/>
<aia value='aplic-imsic'/>
</features>
...
@ -2064,9 +2108,9 @@ are:
Enable various features improving behavior of guests running Microsoft
Windows.
=============== ====================================================================== ============================================ =======================================================
=============== ====================================================================== ============================================ ========================================================================
Feature Description Value Since
=============== ====================================================================== ============================================ =======================================================
=============== ====================================================================== ============================================ ========================================================================
relaxed Relax constraints on timers on, off :since:`1.0.0 (QEMU 2.0)`
vapic Enable virtual APIC on, off :since:`1.1.0 (QEMU 2.0)`
spinlocks Enable spinlock support on, off; retries - at least 4095 :since:`1.1.0 (QEMU 2.0)`
@ -2078,13 +2122,13 @@ are:
vendor_id Set hypervisor vendor id on, off; value - string, up to 12 characters :since:`1.3.3 (QEMU 2.5)`
frequencies Expose frequency MSRs on, off :since:`4.7.0 (QEMU 2.12)`
reenlightenment Enable re-enlightenment notification on migration on, off :since:`4.7.0 (QEMU 3.0)`
tlbflush Enable PV TLB flush support on, off :since:`4.7.0 (QEMU 3.0)`
tlbflush Enable PV TLB flush support on, off; direct - on,off; extended - on,off :since:`4.7.0 (QEMU 3.0), direct and extended modes 11.0.0 (QEMU 7.1.0)`
ipi Enable PV IPI support on, off :since:`4.10.0 (QEMU 3.1)`
evmcs Enable Enlightened VMCS on, off :since:`4.10.0 (QEMU 3.1)`
avic Enable use Hyper-V SynIC with hardware APICv/AVIC on, off :since:`8.10.0 (QEMU 6.2)`
emsr_bitmap Avoid unnecessary updates to L2 MSR Bitmap upon vmexits. on, off :since:`10.7.0 (QEMU 7.1)`
xmm_input Enable XMM Fast Hypercall Input on, off :since:`10.7.0 (QEMU 7.1)`
=============== ====================================================================== ============================================ =======================================================
=============== ====================================================================== ============================================ ========================================================================
:since:`Since 8.0.0`, the hypervisor can be configured further by setting
the ``mode`` attribute to one of the following values:
@ -2275,6 +2319,13 @@ are:
disable the emulation of a PS/2 controller used by ``ps2`` bus input devices.
If the attribute is not defined, the hypervisor default will be used.
:since:`Since 10.7.0` (QEMU only)
``aia``
Configure aia (Advanced Interrupt Architecture) for RISC-V 'virt'
guests. Possible values for the ``value`` attribute are ``aplic`` (one
emulated APLIC device present per socket), ``aplic-imsic`` (one APLIC and
one IMSIC device present per core), or ``none`` (no support for AIA).
If the attribute is not defined, the hypervisor default
will be used. :since:`Since 11.1.0` (QEMU/KVM and RISC-V guests only)
Time keeping
------------
@ -2723,6 +2774,25 @@ paravirtualized driver is specified via the ``disk`` element.
<source dev='/dev/vhost-vdpa-0' />
<target dev='vdg' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/path/to/datastore.qcow2'>
<dataStore type='file'>
<format type='raw'/>
<source file='/path/to/datastore'/>
<dataStore/>
</source>
<backingStore type='file'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/base-with-data-file.qcow'>
<dataStore type='block'>
<format type='raw'/>
<source dev='/dev/mapper/base2'/>
<dataStore/>
</source>
</backingStore>
<target dev='vdh' bus='virtio'/>
</disk>
</devices>
...
@ -2756,8 +2826,8 @@ paravirtualized driver is specified via the ``disk`` element.
``model``
Indicates the emulated device model of the disk. Typically this is
indicated solely by the ``bus`` property but for ``bus`` "virtio" the
model can be specified further with "virtio-transitional",
"virtio-non-transitional", or "virtio". See `Virtio transitional devices`_
model can be specified further with "virtio", "virtio-transitional" or
"virtio-non-transitional". See `virtio device models`_
for more details. :since:`Since 5.2.0`
``rawio``
Indicates whether the disk needs rawio capability. Valid settings are
@ -2767,14 +2837,13 @@ paravirtualized driver is specified via the ``disk`` element.
per-process basis). This attribute is only valid when device is "lun". NB,
``rawio`` intends to confine the capability per-device, however, current
QEMU implementation gives the domain process broader capability than that
(per-process basis, affects all the domain disks). To confine the
capability as much as possible for QEMU driver as this stage, ``sgio`` is
recommended, it's more secure than ``rawio``. :since:`Since 0.9.10`
(per-process basis, affects all the domain disks). :since:`Since 0.9.10`
``sgio``
If supported by the hypervisor and OS, indicates whether unprivileged
SG_IO commands are filtered for the disk. Valid settings are "filtered" or
"unfiltered" where the default is "filtered". Only available when the
``device`` is 'lun'. :since:`Since 1.0.2`
``device`` is 'lun'. The attribute exists :since:`Since 1.0.2`, although
currently it's no longer supported by any hypervisor.
``snapshot``
Indicates the default behavior of the disk during disk snapshots:
``internal`` requires a file format such as qcow2 that can store both
@ -3094,6 +3163,28 @@ paravirtualized driver is specified via the ``disk`` element.
attribute.
:since:`Since 9.8.0`
``dataStore``
This element describes external data store, which is storage holding the
actual data blocks of the given storage image. In such case the disk source
image holds only the metadata. This feature is currently supported only
by the ``qcow2`` format. :since:`Since 10.10.0`
The following attribute is supported in ``dataStore``:
``type``
The ``type`` attribute represents the type of storage used by the data store,
see disk type attribute above for more details and possible values.
Moreover, ``dataStore`` supports the following sub-elements:
``format``
The ``format`` element contains ``type`` attribute which specifies the
internal format of the data store. Only ``raw`` value is supported.
``source``
This element has the same structure as the ``source`` element in ``disk``.
It specifies which file, device, or network location contains the data of
the described data store.
For a "file" or "volume" disk type which represents a cdrom or floppy (the
``device`` attribute), it is possible to define policy what to do with the
@ -3373,10 +3464,27 @@ paravirtualized driver is specified via the ``disk`` element.
*Note:* ``iothread`` is mutually exclusive with ``iothreads``.
- The optional ``iothreads`` sub-element allows specifying multiple IOThreads
via the ``iothread`` sub-element with attribute ``id`` the disk will use
for I/O operations. Optionally the ``iothread`` element can have multiple
``queue`` subelements specifying that given iothread should be used to
handle given queues. :since:`Since 10.0.0 (QEMU 9.0, virtio disks only)`.
Example::
for I/O operations. The virt queues (see ``queues`` attribute below) are
automatically distributed among the configured iothreads.
Optionally the ``iothread`` element can have multiple ``queue``
subelements with mandatory ``id`` atribute specifying that the iothread
should be used to handle given virt queue. If queue mapping is present
the ``queues`` attribute of ``driver`` must be configured and all
configured virt queues must be included in the mapping. The
``virtio-blk`` device exposes request virt queues ``0`` to ``N-1`` where
N is the number of queues configured for the device.
:since:`Since 10.0.0 (QEMU 9.0, virtio disks only)`.
Examples::
<driver name='qemu' queues='4'>
<iothreads>
<iothread id='2'/>
<iothread id='3'/>
</iothreads>
</driver>
<driver name='qemu' queues='3'>
<iothreads>
@ -3507,12 +3615,13 @@ paravirtualized driver is specified via the ``disk`` element.
:since:`Since 0.10.1`
``vendor``
If present, this element specifies the vendor of a virtual hard disk or
CD-ROM device. It must not be longer than 8 printable characters.
:since:`Since 1.0.1`
CD-ROM device. It must not be longer than 8 printable characters. Only for
'scsi' ``bus``.:since:`Since 1.0.1`
``product``
If present, this element specifies the product of a virtual hard disk or
CD-ROM device. It must not be longer than 16 printable characters.
:since:`Since 1.0.1`
CD-ROM device. It must not be longer than 16 printable characters for 'scsi'
(:since:`Since 1.0.1`). For 'sata' or 'ide' not longer than 40 printable
characters (:since:`Since 11.1.0`). Other ``bus`` is not supported.
``address``
If present, the ``address`` element ties the disk to a given slot of a
controller (the actual ``<controller>`` device can often be inferred by
@ -3681,9 +3790,8 @@ A directory on the host that can be accessed directly from the guest.
info <https://lists.gnu.org/archive/html/qemu-devel/2010-09/msg00121.html>`__
:since:`Since 5.2.0`, the filesystem element has an optional attribute
``model`` with supported values "virtio-transitional",
"virtio-non-transitional", or "virtio". See `Virtio transitional devices`_
for more details.
``model`` with supported values "virtio", "virtio-transitional" or
"virtio-non-transitional". See `virtio device models`_ for more details.
The filesystem element has optional attributes ``fmode`` and ``dmode``.
These two attributes control the creation mode for files and directories
@ -3778,8 +3886,8 @@ A directory on the host that can be accessed directly from the guest.
:since:`Since 10.0.0`
``readonly``
Enables exporting filesystem as a readonly mount for guest, by default
read-write access is given (currently only works for QEMU/KVM driver; not
with virtiofs).
read-write access is given (works for QEMU/KVM driver, :since:`Since 11.0.0,
requires virtiofs 1.13.0` ).
``space_hard_limit``
Maximum space available to this guest's filesystem. :since:`Since 0.9.13`
Only supported by the OpenVZ driver.
@ -3911,11 +4019,20 @@ Note: In general you should leave this option alone, unless you are very certain
you know what you are doing.
Virtio transitional devices
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Virtio device models
~~~~~~~~~~~~~~~~~~~~
:since:`Since 5.2.0`, some of QEMU's virtio devices, when used with PCI/PCIe
machine types, accept the following ``model`` values:
Virtio devices come in several variants, some of which are only applicable to
certain machine types or scenarios. The variant can be chosen via the ``model``
attribute, which supports the following values:
``virtio``
This is the recommended choice in the absence of guest OS specific
constraints, as it will will generally work correctly across a large range
of architectures, machine types and libvirt versions.
:since:`Since 5.2.0`, the following values can additionally be used with machine
types based on PCI (either conventional PCI or PCI Express):
``virtio-transitional``
This device can work both with virtio 0.9 and virtio 1.0 guest drivers, so
@ -3927,12 +4044,6 @@ machine types, accept the following ``model`` values:
necessary. libvirt will plug the device into either a PCI Express slot or a
conventional PCI slot based on the machine type, resulting in a more
optimized PCI topology.
``virtio``
This device will work like a ``virtio-non-transitional`` device when plugged
into a PCI Express slot, and like a ``virtio-transitional`` device otherwise;
libvirt will pick one or the other based on the machine type. This is the
best choice when compatibility with libvirt versions older than 5.2.0 is
necessary, but it's otherwise not recommended to use it.
While the information outlined above applies to most virtio devices, there are a
few exceptions:
@ -3993,14 +4104,14 @@ specific features, such as:
The ``virtio-serial`` controller has two additional optional attributes
``ports`` and ``vectors``, which control how many devices can be connected
through the controller. :since:`Since 5.2.0`, it supports an optional
attribute ``model`` which can be 'virtio', 'virtio-transitional', or
'virtio-non-transitional'. See `Virtio transitional devices`_ for more details.
attribute ``model`` which can be 'virtio', 'virtio-transitional' or
'virtio-non-transitional'. See `virtio device models`_ for more details.
``scsi``
A ``scsi`` controller has an optional attribute ``model``, which is one of
'auto', 'buslogic', 'ibmvscsi', 'lsilogic', 'lsisas1068', 'lsisas1078',
'virtio-scsi', 'vmpvscsi', 'virtio-transitional', 'virtio-non-transitional',
'ncr53c90' (as builtin implicit controller only), 'am53c974', 'dc390'.
See `Virtio transitional devices`_ for more details.
See `virtio device models`_ for more details.
``usb``
A ``usb`` controller has an optional attribute ``model``, which is one of
"piix3-uhci", "piix4-uhci", "ehci", "ich9-ehci1", "ich9-uhci1", "ich9-uhci2",
@ -4346,7 +4457,7 @@ or:
...
<devices>
<hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'>
<hostdev mode='subsystem' type='scsi' rawio='yes'>
<source>
<adapter name='scsi_host0'/>
<address bus='0' target='0' unit='0'/>
@ -4402,9 +4513,9 @@ or:
</source>
</hostdev>
<hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
<source>
<address uuid='9063cba3-ecef-47b6-abcf-3fef4fdcad85'/>
</source>
<source>
<address uuid='9063cba3-ecef-47b6-abcf-3fef4fdcad85'/>
</source>
<address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
</hostdev>
</devices>
@ -4436,21 +4547,25 @@ or:
``display`` attribute to be set to ``on``.
``scsi``
For SCSI devices, user is responsible to make sure the device is not used
by host. If supported by the hypervisor and OS, the optional ``sgio`` (
:since:`since 1.0.6` ) attribute indicates whether unprivileged SG_IO
commands are filtered for the disk. Valid settings are "filtered" or
"unfiltered", where the default is "filtered". The optional ``rawio`` (
:since:`since 1.2.9` ) attribute indicates whether the lun needs the rawio
capability. Valid settings are "yes" or "no". See the rawio description
within the `Hard drives, floppy disks, CDROMs`_ section. If a disk lun in the domain
already has the rawio capability, then this setting not required.
by host.
If supported by the hypervisor and OS, the optional ``sgio`` (
:since:`since 1.0.6`, but currently no longer supported by any hypervisor
driver ) attribute indicates whether unprivileged SG_IO commands are
filtered for the disk. Valid settings are "filtered" or
"unfiltered", where the default is "filtered".
The optional ``rawio`` (:since:`since 1.2.9` ) attribute indicates whether
the lun needs the rawio capability. Valid settings are "yes" or "no".
See the rawio description within the `Hard drives, floppy disks, CDROMs`_
section. If a disk lun in the domain already has the rawio capability,
then this setting not required.
``scsi_host``
:since:`since 2.5.0` For SCSI devices, user is responsible to make sure
the device is not used by host. This ``type`` passes all LUNs presented by
a single HBA to the guest. :since:`Since 5.2.0`, the ``model`` attribute
can be specified further with "virtio-transitional",
"virtio-non-transitional", or "virtio". `Virtio transitional devices`_
for more details.
can be specified further with "virtio", "virtio-transitional" or
"virtio-non-transitional". See `virtio device models`_ for more details.
``mdev``
For mediated devices ( :since:`Since 3.2.0` ) the ``model`` attribute
specifies the device API which determines how the host's vfio driver will
@ -5019,25 +5134,34 @@ to the interface.
</devices>
...
Userspace (SLIRP or passt) connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Userspace connection using SLIRP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``user`` type connects the guest interface to the outside via a
The ``user`` interface type connects the guest interface to the outside via a
transparent userspace proxy that doesn't require any special system
privileges, making it usable in cases when libvirt itself is running
with no privileges (e.g. libvirt's "session mode" daemon, or when
libvirt is run inside an unprivileged container).
By default, this user proxy is done with QEMU's internal SLIRP driver
which has DHCP & DNS services that give the guest IP addresses
starting from ``10.0.2.15``, a default route of ``10.0.2.2`` and DNS
server of ``10.0.2.3``. :since:`Since 3.8.0` it is possible to override
the default network address by including an ``ip`` element specifying
an IPv4 address in its one mandatory attribute,
``address``. Optionally, a second ``ip`` element with a ``family``
attribute set to "ipv6" can be specified to add an IPv6 address to the
interface. ``address``. Optionally, address ``prefix`` can be
specified.
By default, this user proxy is done with QEMU's SLIRP driver, a
userspace proxy built into QEMU that has DHCP & DNS services that give
the guest an IP address of ``10.0.2.15``, a default route of
``10.0.2.2`` and DNS server at ``10.0.2.3``.
:since:`Since 3.8.0` it is possible to override the guest's default
network address by including an ``ip`` element specifying an IPv4
address in its one mandatory attribute, ``address``. Optionally, a
second ``ip`` element with a ``family`` attribute set to "ipv6" can be
specified to add an IPv6 address to the interface. ``address``.
Optionally, an address ``prefix`` can be specified. These settings are
surprisingly **not** used by SLIRP to set the exact IP address;
instead they are used to determine what network/subnet the guest's IP
address should be on, and the guest will be given an address in that
subnet, but the host portion of the address will still be "2.15". In
the example below, for example, the guest will be given the IP address
172.17.2.15 (**note that the '1.1' in the host portion of the address
has been ignored**), default route of 172.17.2.2, and DNS server
172.17.2.3.
::
@ -5047,34 +5171,74 @@ specified.
...
<interface type='user'>
<mac address="00:11:22:33:44:55"/>
<ip family='ipv4' address='172.17.2.0' prefix='24'/>
<ip family='ipv6' address='2001:db8:ac10:fd01::' prefix='64'/>
<ip family='ipv4' address='172.17.1.1' prefix='16'/>
<ip family='ipv6' address='2001:db8:ac10:fd01::1' prefix='64'/>
</interface>
</devices>
...
:since:`Since 9.0.0` an alternate backend implementation of the
``user`` interface type can be selected by setting the interface's
``<backend>`` subelement ``type`` attribute to ``passt``. In this
case, the passt transport (https://passt.top) is used. Similar to
SLIRP, passt has an internal DHCP server that provides a requesting
guest with one ipv4 and one ipv6 address; it then uses userspace
proxies and a separate network namespace to provide outgoing
UDP/TCP/ICMP sessions, and optionally redirect incoming traffic
destined for the host toward the guest instead.
Userspace connection using passt
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the passt backend is used, the ``<backend>`` attribute
``logFile`` can be used to tell the passt process for this interface
where to write its message log, and the ``<source>`` attribute ``dev``
can tell it to use a particular host interface to derive the routes
given to the guest for forwarding traffic upstream. Due to the design
decisions of passt, if using SELinux, the log file is recommended to
reside in the runtime directory of a user under which the passt
process will run, most probably ``/run/user/$UID`` where ``$UID`` is
the UID of the user, e.g. ``qemu``. Beware that libvirt does not
create this directory if it does not already exist to avoid possible,
however unlikely, issues, especially since this logfile attribute is
meant mostly for debugging.
:since:`Since 9.0.0 (QEMU and KVM only)` an alternate backend
implementation of the ``user`` interface type can be selected by
setting the interface's ``<backend>`` subelement ``type`` attribute to
``passt``. In this case, the passt transport `(details here)
<https://passt.top>`__ is used. passt is run as a separate process
from QEMU - the passt process handles the details of forwarding
network traffic back and forth to the physical network (using
userspace proxies and a separate network namespace to provide outgoing
UDP/TCP/ICMP sessions, and optionally redirecting incoming traffic
destined for the host toward the guest instead), and a socket between
passt and QEMU forwards that traffic on to the guest (and back out,
of course).
:since:`Since 11.1.0 (QEMU and KVM only)` you may prefer to use the
passt backend with the more efficient and performant type='vhostuser'
rather than type='user'. All the options related to passt in the
paragraphs below here also apply when using the passt backend with
type='vhostuser'; any other details specific to vhostuser are
described `here
<formatdomain.html#vhost-user-connection-with-passt-backend>`__.
Similar to SLIRP, passt has an internal DHCP server that provides a
requesting guest with one ipv4 and one ipv6 address. There are default
values for both of these, or you can use the ``<ip>`` element
(described above, with behavioral differences as outlined below) to
configure one IPv4 and one IPv6 address that passt's DHCP server can
provide to the guest.
Unlike SLIRP, when no ``<ip>`` address is specified, passt will by
default provide the guest with an IP address, DNS server, etc. that
are identical to those settings on the host itself (through the magic
of the proxies and a separate network namespace, this doesn't create
any conflict).
Also different from SLIRP's behavior: if you do specify IP
address(es), the exact address and netmask/prefix you specify will be
provided to the guest (i.e. passt doesn't interpret the <ip> settings
as a network address like SLIRP does, but as a host address). In
example given above, the guest IP would be set to exactly 172.17.1.1.
Just as with SLIRP, though, once traffic from the guest leaves the
host towards the rest of the network, it will always appear as if it
came from the host's IP.
There are a few other options that are configurable only for the passt
backend. For example, the ``<backend>`` attribute ``logFile`` can be
used to tell the passt process for this interface where to write its
message log, and the ``<source>`` attribute ``dev`` can tell it a
particular host interface to use when deriving the routes given to the
guest for forwarding traffic upstream. Due to the design decisions of
passt, when using SELinux on the host, it is recommended that the log
file reside in the runtime directory of the user under which the passt
process will run, most probably ``/run/user/$UID`` (where ``$UID`` is
the UID of that user), e.g. ``/run/user/1000``. Be aware that libvirt
does not create this directory if it does not already exist to avoid
possible, however unlikely, issues with orphaned directories or
permissions, etc. The logfile attribute is meant mostly for debugging,
so it shouldn't be set under normal circumstances.
Additionally, when passt is used, multiple ``<portForward>`` elements
can be added to forward incoming network traffic for the host to this
@ -5111,7 +5275,7 @@ ports **with the exception of some subset**.
<backend type='passt' logFile='/run/user/$UID/passt-domain.log'/>
<mac address="00:11:22:33:44:55"/>
<source dev='eth0'/>
<ip family='ipv4' address='172.17.2.4' prefix='24'/>
<ip family='ipv4' address='172.17.5.4' prefix='24'/>
<ip family='ipv6' address='2001:db8:ac10:fd01::20'/>
<portForward proto='tcp'>
<range start='2022' to='22'/>
@ -5664,7 +5828,7 @@ Setting NIC driver-specific options
<host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/>
<guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
</interface>
</interface>
</devices>
...
@ -5730,7 +5894,7 @@ following attributes are available for the ``virtio`` NIC driver:
The optional ``queues`` attribute controls the number of queues to be used
for either `Multiqueue
virtio-net <https://www.linux-kvm.org/page/Multiqueue>`__ or vhost-user (See
`vhost-user interface`_) network interfaces. Use of multiple packet
`vhost-user connection`_) network interfaces. Use of multiple packet
processing queues requires the interface having the
``<model type='virtio'/>`` element. Each queue will potentially be handled by
a different processor, resulting in much higher throughput.
@ -5986,28 +6150,29 @@ VLAN tags to apply to the guest's network traffic :since:`Since 0.10.0`.
Network connections that support guest-transparent VLAN tagging include
``type='bridge'`` interfaces connected to an Open vSwitch bridge, SRIOV
Virtual Functions (VF) used via ``type='hostdev'`` (direct device assignment)
and, :since:`since 1.3.5`, SRIOV VFs used via ``type='direct'`` with
``mode='passthrough'`` (macvtap "passthru" mode). All other
connection types, including standard linux bridges and libvirt's own virtual
Virtual Functions (VF) used via ``type='hostdev'`` (direct device assignment),
:since:`since 1.3.5`, SRIOV VFs used via ``type='direct'`` with
``mode='passthrough'`` (macvtap "passthru" mode) and, :since:`since 11.0.0`
standard linux bridges. Other connection types, including libvirt's own virtual
networks, **do not** support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA) switches
provide their own way (outside of libvirt) to tag guest traffic onto a specific
VLAN. Each tag is given in a separate ``<tag>`` subelement of ``<vlan>`` (for
example: ``<tag id='42'/>``). For VLAN trunking of multiple tags (which is
supported only on Open vSwitch connections), multiple ``<tag>`` subelements can
be specified, which implies that the user wants to do VLAN trunking on the
interface for all the specified tags. In the case that VLAN trunking of a single
tag is desired, the optional attribute ``trunk='yes'`` can be added to the
toplevel ``<vlan>`` element to differentiate trunking of a single tag from
normal tagging.
supported on Open vSwitch connections and standard linux bridges), multiple
``<tag>`` subelements can be specified, which implies that the user wants to do
VLAN trunking on the interface for all the specified tags. In the case that VLAN
trunking of a single tag is desired, the optional attribute ``trunk='yes'`` can
be added to the toplevel ``<vlan>`` element to differentiate trunking of a
single tag from normal tagging.
For network connections using Open vSwitch it is also possible to configure
'native-tagged' and 'native-untagged' VLAN modes :since:`Since 1.1.0`. This is
done with the optional ``nativeMode`` attribute on the ``<tag>`` subelement:
``nativeMode`` may be set to 'tagged' or 'untagged'. The ``id`` attribute of the
``<tag>`` subelement containing ``nativeMode`` sets which VLAN is considered to
be the "native" VLAN for this interface, and the ``nativeMode`` attribute
determines whether or not traffic for that VLAN will be tagged.
For network connections using Open vSwitch and standard linux bridges it is also
possible to configure 'native-tagged' and 'native-untagged' VLAN modes
:since:`Since 1.1.0`. This is done with the optional ``nativeMode`` attribute on
the ``<tag>`` subelement: ``nativeMode`` may be set to 'tagged' or 'untagged'.
The ``id`` attribute of the ``<tag>`` subelement containing ``nativeMode`` sets
which VLAN is considered to be the "native" VLAN for this interface, and the
``nativeMode`` attribute determines whether or not traffic for that VLAN will be
tagged.
Isolating guests' network traffic from each other
@ -6174,8 +6339,8 @@ similarly named elements used to configure the guest side of the interface
(described above).
vhost-user interface
^^^^^^^^^^^^^^^^^^^^
vhost-user connection
^^^^^^^^^^^^^^^^^^^^^
:since:`Since 1.2.7` the vhost-user enables the communication between a QEMU
virtual machine and other userspace process using the Virtio transport protocol.
@ -6202,16 +6367,63 @@ plane is based on shared memory.
</devices>
...
The ``<source>`` element has to be specified along with the type of char device.
Currently, only type='unix' is supported, where the path (the directory path of
the socket) and mode attributes are required. Both ``mode='server'`` and
``mode='client'`` are supported. vhost-user requires the virtio model type, thus
the ``<model>`` element is mandatory. :since:`Since 4.1.0` the element has an
optional child element ``reconnect`` which configures reconnect timeout if the
connection is lost. It has two attributes ``enabled`` (which accepts ``yes`` and
``no``) and ``timeout`` which specifies the amount of seconds after which
The ``<source>`` element has to be specified along with the type of
char device. Currently, only type='unix' is supported, where the path
(the directory path of the socket) and mode attributes are
required. Both ``mode='server'`` and ``mode='client'`` are
supported. (:since:`Since 11.1.0` the default source type for
vhostuser interfaces is 'unix' and default mode is 'client', so those
two attributes are now optional).
The vhost-user protocol only works with the virtio guest driver, so
the ``<model>`` element ``type`` attribute is mandatory (:since:`Since
11.1.0` the default model type for vhostuser interfaces is now
'virtio' so ``<model>`` is no longer mandatory). :since:`Since 4.1.0`
the ``<source>`` element has an optional child element ``reconnect``
which configures reconnect timeout if the connection is lost. It has
two attributes ``enabled`` (which accepts ``yes`` and ``no``) and
``timeout`` which specifies the amount of seconds after which
hypervisor tries to reconnect.
Note that when ``mode='server'`` is used, the hypervisor will wait for the
incoming connection to be established prior to actually running the VM. This is
not possible when hotplugging an interface with such config so the VM will
continue to run even when no connection is made. It's advised to use
``mode='client'`` instead.
vhost-user connection with passt backend
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:since:`Since 11.1.0 (QEMU and KVM only)` passt can be used as the
other end of the vhost-user connection. This is a compelling
alternative, because passt provides all of its network connectivity
without requiring any elevated privileges or capabilities, and
vhost-user uses shared memory to make this unprivileged connection
very high performance as well. You can set a type='vhostuser'
interface to use passt as the backend by adding ``<backend
type='passt'/>``. When passt is the backend, only a single driver
queue is supported, and the ``<source>`` path/type/mode are all
implied to be "matching the passt process" so **must not** be
specified. All of the passt options `described here
<formatdomain.html#userspace-connection-using-passt>`__, are also
supported for ``type='vhostuser'`` with the passt backend, e.g.
setting guest-side IP addresses with ``<ip>`` and port forwarding with
``<portForward``.
::
...
<devices>
<interface type='vhostuser'>
<backend type='passt'/>
<mac address='52:54:00:3b:83:1a'/>
<source dev='enp1s0'/>
<ip address='10.30.0.5 prefix='24'/>
</interface>
</devices>
...
Traffic filtering with NWFilter
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -6296,8 +6508,8 @@ value 'all' which when enabled grabs all input devices instead of just one,
change the grab key combination.
``input`` type ``evdev`` is currently supported only on linux devices.
(KVM only) :since:`Since 5.2.0`, the ``input`` element accepts a
``model`` attribute which has the values 'virtio', 'virtio-transitional' and
'virtio-non-transitional'. See `Virtio transitional devices`_ for more details.
``model`` attribute which has the values 'virtio', 'virtio-transitional' or
'virtio-non-transitional'. See `virtio device models`_ for more details.
The subelement ``driver`` can be used to tune the virtio options of the device:
`Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` )
@ -6408,7 +6620,7 @@ interaction with the admin.
::
<graphics type='vnc' ...>
<audio id='1'>
<audio id='1'/>
</graphics>
Where ``1`` is an id of the audio device (See `Audio backends`_). If no
@ -6545,7 +6757,7 @@ interaction with the admin.
<graphics type='dbus'/>
``p2p`` (accepts ``on`` or ``off``) enables peer-to-peer connections,
``p2p`` (accepts ``yes`` or ``no``) enables peer-to-peer connections,
established through virDomainOpenGraphics() APIs.
``address`` (accepts a `D-Bus address
@ -6565,7 +6777,7 @@ interaction with the admin.
::
<graphics type='dbus' ...>
<audio id='1'>
<audio id='1'/>
</graphics>
Where ``1`` is an id of the audio device (See `Audio backends`_).
@ -7476,7 +7688,7 @@ backend using the ``<audio>`` sub-element:
...
<devices>
<sound model='ich7'>
<audio id='1'>
<audio id='1'/>
</sound>
</devices>
...
@ -7978,7 +8190,7 @@ Example: manually added device with static PCI slot 2 requested
- 'virtio-non-transitional' :since:`Since 5.2.0`
- 'xen' - default with Xen
See `Virtio transitional devices`_ for more details.
See `virtio device models`_ for more details.
``autodeflate``
The optional ``autodeflate`` attribute allows to enable/disable (values
@ -8044,7 +8256,7 @@ Example: usage of the RNG device:
- 'virtio-transitional' :since:`Since 5.2.0`
- 'virtio-non-transitional' :since:`Since 5.2.0`
See `Virtio transitional devices`_ for more details.
See `virtio device models`_ for more details.
``rate``
The optional ``rate`` element allows limiting the rate at which entropy can
@ -8127,6 +8339,21 @@ Example: usage of the TPM Emulator
<active_pcr_banks>
<sha256/>
</active_pcr_banks>
<profile source='local:restricted' removeDisabled='check' name='custom:restricted'/>
</backend>
</tpm>
</devices>
...
Example: usage of external TPM emulator :since:`Since 9.0.0`
::
...
<devices>
<tpm model='tpm-tis'>
<backend type='external'>
<source type='unix' mode='connect' path='/tmp/path.sock'/>
</backend>
</tpm>
</devices>
@ -8170,6 +8397,12 @@ Example: usage of the TPM Emulator
parameter can be used to enable logging in the emulator backend, and
accepts non-zero integer values.
``external``
For this backend, libvirt expects the TPM emulator to be started externally.
The path to the unix socket where the emulator is listening is passed
via the ``source`` element. Other ``backend`` sub-elements do not apply
in this case, since they are controlled by the emulator command line.
``version``
The ``version`` attribute indicates the version of the TPM. This attribute
only works with the ``emulator`` backend. The following versions are
@ -8181,6 +8414,37 @@ Example: usage of the TPM Emulator
The default version used depends on the combination of hypervisor, guest
architecture, TPM model and backend.
``source``
For the ``emulator`` backend, the ``source`` element specifies the location
of the TPM state storage. :since:`Since v10.10.0`
For the ``external`` backend, it specifies the socket of the externally
started TPM emulator. :since:`Since v9.0.0`
This element does not work with the ``passthrough`` backend.
When specified, it is the user's responsability to prevent files from being
used by multiple VMs or emulators (swtpm will also use advisory locking). If
not specified, the storage configuration is left to libvirt discretion.
This element requires that swtpm v0.7 or later is installed.
The following attributes are supported:
``type``
For ``external`` backend, only type ``unix`` is supported.
For ``emulator`` backend, it's possible to provide ``file`` to utilize
a single file or block device where the TPM state will be stored,
or ``dir`` for the directory where the files will be stored.
``mode``
Connection mode for the ``unix`` socket. Only ``connect`` is supported.
Can be omitted.
``path``
The path to the TPM state storage, or the unix socket.
``persistent_state``
The ``persistent_state`` attribute indicates whether 'swtpm' TPM state is
kept or not when a transient domain is powered off or undefined. This
@ -8199,6 +8463,42 @@ Example: usage of the TPM Emulator
and may not have any effect otherwise. The selection of PCR banks only works
with the ``emulator`` backend. :since:`Since 7.10.0`
``profile``
The ``profile`` node is used to set a profile for a TPM 2.0 given in the
``source`` attribute. This attribute describes the name of the file under
which the profile is stored, e.g. 'local:restricted' describes a locally
created profile with name 'restricted.json' that is found in the directory
pointed to by swtpm_setup.conf's local_profiles_dir. This profile will be set
when the TPM is initially created and after that the profile cannot be
changed anymore. Once a profile has been set, the ``name`` attribute will be
updated with the profile's name from its JSON description, for example
'custom:restricted'. If no profile is provided, then swtpm will use the
latest built-in 'default' profile or the default profile set in
swtpm_setup.conf. Otherwise swtpm_setup will search for a profile with the
given name with appended .json suffix in a configurable local and then in a
distro directory. If none could be found in either, it will fall back trying
to use a built-in one.
The built-in 'null' profile provides backwards compatibility with
libtpms v0.9 but also restricts the user to use only TPM features that were
available at the time of libtpms v0.9. The built-in 'custom' profile, or
those with the prefix 'custom:' in the name, are the
only profiles that a user can modify and where the ``removeDisabled``
attribute has any effect. This attribute is particularly useful when a host
is running in FIPS mode and therefore some crypto algorithms (camellia,
tdes, unpadded RSA encryption, 1024-bit RSA keys, and others) are
disabled. When it is set to ``check`` (recommended) then only those
algorithms that are currently disabled will automatically be removed from
the 'custom' profile, while when it is set to ``fips-host`` then all
potentially disabled algorithms will be removed. :since:`Since 10.10.0`
TPM profiles provided by a distro can be referenced with the 'distro:'
prefix. Locally created TPM profiles can be referenced with the
'local:' prefix.
For further information about TPM profiles see the man pages for ``swtpm``
(swtpm v0.10).
``encryption``
The ``encryption`` element allows the state of a TPM emulator to be
encrypted. The ``secret`` must reference a secret object that holds the
@ -8647,8 +8947,8 @@ Vsock
~~~~~
A vsock host/guest interface. The ``model`` attribute defaults to ``virtio``.
:since:`Since 5.2.0` ``model`` can also be 'virtio-transitional' and
'virtio-non-transitional', see `Virtio transitional devices`_ for more details.
:since:`Since 5.2.0` ``model`` can also be 'virtio-transitional' or
'virtio-non-transitional', see `virtio device models`_ for more details.
The optional attribute ``address`` of the ``cid`` element specifies the CID
assigned to the guest. If the attribute ``auto`` is set to ``yes``, libvirt will
assign a free CID automatically on domain startup. :since:`Since 4.4.0`
@ -8949,7 +9249,7 @@ attributes and elements with ``type='sev'`` but differs in others. Example confi
<guestVisibleWorkarounds>...</guestVisibleWorkarounds>
<idBlock>...</idBlock>
<idAuth>...</idAuth>
<hostData>.../hostData>
<hostData>...</hostData>
</launchSecurity>
...
</domain>

View File

@ -193,12 +193,12 @@ CPUs <formatdomain.html#cpu-model-and-topology>`__.
<feature policy='require' name='vmx'/>
</mode>
<mode name='custom' supported='yes'>
<model usable='no' deprecated='no' vendor='Intel'>Broadwell</model>
<model usable='no' deprecated='no' vendor='Intel' canonical='Broadwell-v1'>Broadwell</model>
<blockers model='Broadwell'>
<feature name='hle'/>
<feature name='rtm'/>
</blockers>
<model usable='yes' deprecated='no' vendor='Intel'>Broadwell-noTSX</model>
<model usable='yes' deprecated='no' vendor='Intel' canonical='Broadwell-v2'>Broadwell-noTSX</model>
<model usable='no' deprecated='no' vendor='AMD'>EPYC-Milan</model>
<blockers model='EPYC-Milan'>
<feature name='clzero'/>
@ -265,7 +265,9 @@ more details about it:
the hypervisor's policy on usage of this model :since:`(since 7.1.0)`. The
``vendor`` attribute :since:`(since 8.9.0)` contains the vendor of the CPU
model for users who want to use CPU models with specific vendors only. CPU
models with undefined vendor will be listed with ``vendor='unkwnown'``.
models with undefined vendor will be listed with ``vendor='unkwnown'``. The
``canonical`` attribute :since:`(since 10.10.0)` contains a canonical name of
the CPU model if the model is actually an alias to another one.
I/O Threads
~~~~~~~~~~~
@ -671,6 +673,30 @@ Interface device corresponds to `network interface
``backendType``
Options for the ``type`` attribute of the ``<backend/>`` element
Panic device
^^^^^^^^^^^^
Interface device corresponds to `panic device
<formatdomain.html#panic-device>`__ (``<panic/>``) in domain XML.
::
<domainCapabilities>
...
<devices>
<panic supported='yes'>
<enum name='model'>
<value>isa</value>
<value>hyperv</value>
</enum>
</panic>
...
</devices>
</domainCapabilities>
``model``
Options for the ``model`` attribute of the ``<panic/>`` element
Features
~~~~~~~~

View File

@ -520,28 +520,29 @@ VLAN tags to apply to the guest's network traffic :since:`Since 0.10.0`.
Network connections that support guest-transparent VLAN tagging include
``type='bridge'`` interfaces connected to an Open vSwitch bridge, SRIOV
Virtual Functions (VF) used via ``type='hostdev'`` (direct device assignment)
and, :since:`since 1.3.5`, SRIOV VFs used via ``type='direct'`` with
``mode='passthrough'`` (macvtap "passthru" mode). All other
connection types, including standard linux bridges and libvirt's own virtual
networks, **do not** support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA) switches
provide their own way (outside of libvirt) to tag guest traffic onto a specific
VLAN. Each tag is given in a separate ``<tag>`` subelement of ``<vlan>`` (for
example: ``<tag id='42'/>``). For VLAN trunking of multiple tags (which is
supported only on Open vSwitch connections), multiple ``<tag>`` subelements can
be specified, which implies that the user wants to do VLAN trunking on the
interface for all the specified tags. In the case that VLAN trunking of a single
tag is desired, the optional attribute ``trunk='yes'`` can be added to the
toplevel ``<vlan>`` element to differentiate trunking of a single tag from
normal tagging.
Virtual Functions (VF) used via ``type='hostdev'`` (direct device assignment),
:since:`since 1.3.5`, SRIOV VFs used via ``type='direct'`` with
``mode='passthrough'`` (macvtap "passthru" mode) and, :since:`since 11.0.0`,
standard linux bridges. All other connection types, including libvirt's own
virtual networks, **do not** support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA)
switches provide their own way (outside of libvirt) to tag guest traffic onto a
specific VLAN. Each tag is given in a separate ``<tag>`` subelement of
``<vlan>`` (for example: ``<tag id='42'/>``). For VLAN trunking of multiple
tags (which is supported on Open vSwitch connections and standard linux
bridges), multiple ``<tag>`` subelements can be specified, which implies that
the user wants to do VLAN trunking on the interface for all the specified tags.
In the case that VLAN trunking of a single tag is desired, the optional
attribute ``trunk='yes'`` can be added to the toplevel ``<vlan>`` element to
differentiate trunking of a single tag from normal tagging.
For network connections using Open vSwitch it is also possible to configure
'native-tagged' and 'native-untagged' VLAN modes :since:`Since 1.1.0`. This is
done with the optional ``nativeMode`` attribute on the ``<tag>`` subelement:
``nativeMode`` may be set to 'tagged' or 'untagged'. The ``id`` attribute of the
``<tag>`` subelement containing ``nativeMode`` sets which VLAN is considered to
be the "native" VLAN for this interface, and the ``nativeMode`` attribute
determines whether or not traffic for that VLAN will be tagged.
For network connections using Open vSwitch :since:`since 1.1.10` and standard
linux bridges :since:`since 11.0.0` it is also possible to configure
'native-tagged' and 'native-untagged' VLAN modes. This is done with the optional
``nativeMode`` attribute on the ``<tag>`` subelement: ``nativeMode`` may be set
to 'tagged' or 'untagged'. The ``id`` attribute of the ``<tag>`` subelement
containing ``nativeMode`` sets which VLAN is considered to be the "native" VLAN
for this interface, and the ``nativeMode`` attribute determines whether or not
traffic for that VLAN will be tagged.
``<vlan>`` elements can also be specified in a ``<portgroup>`` element, as well
as directly in a domain's ``<interface>`` element. In the case that a vlan tag

View File

@ -318,7 +318,7 @@ be omitted if the file contents are base64-encoded.
::
# virsh secret-set-value 6dd3e4a5-1d76-44ce-961f-f119f5aad935 --file --plain secretinfile
# virsh secret-set-value 6dd3e4a5-1d76-44ce-961f-f119f5aad935 --file secretinfile --plain
Secret value set
**WARNING** The following approach is **insecure** and deprecated. The secret

View File

@ -16,7 +16,7 @@ The libvirt project:
`QEMU <drvqemu.html>`__,
`Xen <drvxen.html>`__,
`Virtuozzo <drvvirtuozzo.html>`__,
`VMWare ESX <drvesx.html>`__,
`VMware ESX <drvesx.html>`__,
`LXC <drvlxc.html>`__,
`BHyve <drvbhyve.html>`__ and
`more <drivers.html>`__

View File

@ -13,9 +13,13 @@ is designed to offer local file system semantics and performance.
See https://virtio-fs.gitlab.io/
*Note:* virtiofs currently does not support migration so operations such as
migration, save/managed-save, or snapshots with memory are not supported if
a VM has a virtiofs filesystem connected.
*Note:* Older versions of ``virtiofsd`` (prior to ``1.11``) do not not support
migration so operations such as migration, save/managed-save, or snapshots with
memory may not supported if a VM has a virtiofs filesystem connected.
Additionally snapshot operations managed by libvirt do not snapshot the state
of the files shared via ``virtiofs``, and thus reverting to an earlier state is
not recommended.
Sharing a host directory with a guest
=====================================

View File

@ -568,6 +568,7 @@ domcapabilities
domcapabilities [virttype] [emulatorbin] [arch] [machine]
[--xpath EXPRESSION] [--wrap]
[--disable-deprecated-features]
Print an XML document describing the domain capabilities for the
@ -609,6 +610,11 @@ a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
The **--disable-deprecated-features** argument will modify the contents
of host-model CPU XML, updating the features list with any features
flagged as deprecated for the CPU model by the hypervisor. These
features will be paired with the "disable" policy.
pool-capabilities
-----------------
@ -948,15 +954,22 @@ provide on the host. (This is different from ``cpu-compare`` which compares the
CPU definition with the host CPU without considering any specific hypervisor
and its abilities.)
The XML *FILE* may contain either a host or guest CPU definition. The host CPU
definition is the <cpu> element and its contents as printed by the
``capabilities`` command. The guest CPU definition is the <cpu> element and its
contents from the domain XML definition or the CPU definition created from the
host CPU model found in the domain capabilities XML (printed by the
``domcapabilities`` command). In addition to the <cpu> element itself, this
command accepts full domain XML, capabilities XML, or domain capabilities XML
containing the CPU definition. For more information on guest CPU definition
see: `https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#cpu-model-and-topology>`__.
The XML *FILE* should contain a guest CPU definition: either the ``<cpu>``
element and its contents from a domain XML definition or a CPU definition
created from the host CPU model found in the ``<mode name="host-model">``
element in the domain capabilities XML (printed by the ``domcapabilities``
command). The ``<mode name="host-model">`` element itself or even its
``<cpu>`` parent element found in domain capabilities XML is not accepted.
The element has to be transformed into an actual CPU definition. For more
information on guest CPU definition see:
`https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#cpu-model-and-topology>`__.
Alternatively this command will automatically extract the CPU definition when
provided with a full domain or domain capabilities XML.
For historical reasons the XML *FILE* may also contain a host CPU definition,
but such usage is strongly discouraged as it will most likely provide incorrect
results.
The *virttype* option specifies the virtualization type (usable in the 'type'
attribute of the <domain> top level element from the domain XML). *emulator*
@ -987,15 +1000,19 @@ As an alternative for *FILE* in case the XML would only contain a CPU model
with no additional features the CPU model name itself can be passed as *model*.
Exactly one of *FILE* and *model* must be used.
The XML *FILE* may contain either host or guest CPU definitions describing the
host CPU model. The host CPU definition is the <cpu> element and its contents
as printed by ``capabilities`` command. The guest CPU definition may be created
from the host CPU model found in domain capabilities XML (printed by
``domcapabilities`` command). In addition to the <cpu> elements, this command
accepts full capabilities XMLs, or domain capabilities XMLs containing the CPU
definitions. It is recommended to use only the CPU definitions from domain
capabilities, as on some architectures using the host CPU definition may either
fail or provide unexpected results.
The XML *FILE* should contain guest CPU definitions created from the host CPU
model found in the ``<mode name="host-model">`` element domain capabilities
XMLs (printed by the ``domcapabilities`` command on each host). The
``<mode name="host-model">`` elements themselves or even their ``<cpu>``
parent elements found in domain capabilities XMLs are not accepted. The
elements have to be transformed into actual CPU definitions.
Alternatively this command will automatically extract the CPU definitions when
provided with domain capabilities XMLs.
For historical reasons the XML *FILE* may also contain host CPU definitions,
but such usage is strongly discouraged as it will most likely provide incorrect
results.
When *FILE* contains only a single CPU definition, the command will print the
same CPU with restrictions imposed by the capabilities of the hypervisor.
@ -2428,14 +2445,15 @@ When selecting the *--state* group the following fields are returned:
* ``vcpu.<num>.state`` - state of the virtual CPU <num>, as
number from virVcpuState enum
* ``vcpu.<num>.time`` - virtual cpu time spent by virtual
CPU <num> (in microseconds)
* ``vcpu.<num>.wait`` - virtual cpu time spent by virtual
CPU <num> waiting on I/O (in microseconds)
CPU <num> (in nanoseconds)
* ``vcpu.<num>.wait`` - time the vCPU <num> thread was waiting in the runqueue
as the scheduler has something else running ahead of it (in nanoseconds),
requires CONFIG_SCHED_INFO on Linux
* ``vcpu.<num>.halted`` - virtual CPU <num> is halted: yes or
no (may indicate the processor is idle or even disabled,
depending on the architecture)
* ``vcpu.<num>.delay`` - time the vCPU <num> thread was enqueued by the
host scheduler, but was waiting in the queue instead of running.
* ``vcpu.<num>.delay`` - time the vCPU <num> thread was waiting in the runqueue
as the scheduler has something else running ahead of it (in nanoseconds).
Exposed to the VM as a steal time.
This group of statistics also reports additional hypervisor-originating per-vCPU
@ -2912,7 +2930,7 @@ Success is always reported in this case.
You can limit the types of information that are returned by specifying one or
more flags. Available information types flags are *--user*, *--os*,
*--timezone*, *--hostname*, *--filesystem*, *--disk* and *--interface*.
*--timezone*, *--hostname*, *--filesystem*, *--disk*, *--interface* and *--load*.
If an explicitly requested information type is not supported by the guest agent
at that point, the processes will provide an exit code of 1.
@ -2981,6 +2999,7 @@ returned:
* ``disk.<num>.serial`` - optional disk serial number
* ``disk.<num>.alias`` - the device alias of the disk (e.g. sda)
* ``disk.<num>.guest_alias`` - optional alias assigned to the disk
* ``disk.<num>.guest_bus`` - bus type as reported by the guest
*--interface* returns:
* ``if.count`` - the number of interfaces defined on this domain
@ -2991,6 +3010,12 @@ returned:
* ``if.<num>.addr.<num1>.addr`` - the IP address of addr <num1>
* ``if.<num>.addr.<num1>.prefix`` - the prefix of IP address of addr <num1>
*--load* returns:
* ``load.1m`` - average load in guest for last 1 minute
* ``load.5m`` - average load in guest for last 5 minutes
* ``load.15m`` - average load in guest for last 15 minutes
guestvcpus
----------
@ -3401,6 +3426,7 @@ migrate
[--parallel [--parallel-connections connections]]
[--bandwidth bandwidth] [--tls-destination hostname]
[--disks-uri URI] [--copy-storage-synchronous-writes]
[--available-switchover-bandwidth bandwidth]
Migrate domain to another host. Add *--live* for live migration; <--p2p>
for peer-2-peer migration; *--direct* for direct migration; or *--tunnelled*
@ -3409,7 +3435,8 @@ starting the domain on destination and without stopping it on source host.
Offline migration may be used with inactive domains and it must be used with
*--persistent* option.
*--persistent* leaves the domain persistent on destination host,
*--persistent* leaves the domain persistent on destination host (See below
for quirks when used together with *--xml*),
*--undefinesource* undefines the domain on the source host, and *--suspend*
leaves the domain paused on the destination host.
@ -3489,13 +3516,18 @@ such as GFS2 or GPFS. If you are sure the migration is safe or you just do not
care, use *--unsafe* to force the migration.
*dname* is used for renaming the domain to new name during migration, which
also usually can be omitted. Likewise, *--xml* ``file`` is usually
omitted, but can be used to supply an alternative XML file for use on
the destination to supply a larger set of changes to any host-specific
portions of the domain XML, such as accounting for naming differences
between source and destination in accessing underlying storage.
If *--persistent* is enabled, *--persistent-xml* ``file`` can be used to
supply an alternative XML file which will be used as the persistent guest
also usually can be omitted.
*--xml* ``file``, while usually not required, can be used to supply an
alternative XML file for use on the destination to supply a larger set of
changes to any host-specific portions of the domain XML, such as accounting for
naming differences between source and destination in accessing underlying
storage. If *--xml* is used together with *--persistent* it's usually required
to provide a persistent XML definition via *--persistent-xml* (see below) which
is fixed the same way as the XML passed to *--file* was.
If *--persistent* is enabled, *--persistent-xml* ``file`` can be used
to supply an alternative XML file which will be used as the persistent guest
definition on the destination host.
*--timeout* ``seconds`` tells virsh to run a specified action when live
@ -3651,6 +3683,17 @@ the context of the existing socket because it is different from the file
representation of the socket and the context is chosen by its creator (usually
by using *setsockcreatecon{,_raw}()* functions).
Optional *--available-switchover-bandwidth* overrides the automatically
computed bandwidth (in MiB/s) available for the final phase of (pre-copy)
migration during which CPUs are stopped and all the remaining memory and device
state is transferred. Knowing this bandwidth is important for accurate
estimation of the domain downtime and deciding the right moment for switching
over. Normally this would be estimated based on the bandwidth used by
migration, but this could be lower than the actual available bandwidth. Using
this option may help with migration convergence when the migration would keep
iterating over and over thinking there's not enough bandwidth to comply with
the configured maximum downtime.
migrate-compcache
-----------------
@ -5508,15 +5551,16 @@ List all of the devices available on the node that are known by libvirt.
separated by comma, e.g. --cap pci,scsi. Valid capability types include
'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target',
'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev',
'mdev_types', 'ccw', 'css', 'ap_card', 'ap_queue', 'ap_matrix'. By default,
only active devices are listed. *--inactive* is used to list only inactive
devices, and *--all* is used to list both active and inactive devices.
*--persistent* is used to list only persistent devices, and *--transient* is
used to list only transient devices. Not providing *--persistent* or
*--transient* will list all devices unless filtered otherwise. *--transient*
is mutually exclusive with *--persistent* and *--inactive*.
If *--tree* is used, the output is formatted in a tree representing parents of
each node. *--tree* is mutually exclusive with all other options but *--all*.
'mdev_types', 'ccw', 'ccwgroup', 'ccwgroup_member', 'css', 'ap_card',
'ap_queue', 'ap_matrix'. By default, only active devices are listed.
*--inactive* is used to list only inactive devices, and *--all* is used to
list both active and inactive devices. *--persistent* is used to list only
persistent devices, and *--transient* is used to list only transient devices.
Not providing *--persistent* or *--transient* will list all devices unless
filtered otherwise. *--transient* is mutually exclusive with *--persistent*
and *--inactive*. If *--tree* is used, the output is formatted in a tree
representing parents of each node. *--tree* is mutually exclusive with all
other options but *--all*.
nodedev-reattach

View File

@ -1,161 +1,119 @@
.. role:: since
==================
Libvirt NSS module
==================
.. contents::
When it comes to managing guests and executing commands inside them, logging
into guest operating system and doing the job is convenient. Users are used to
ssh in this case. Ideally:
Effectively managing guests often requires connecting to them via SSH, same as
you would for any remote machine. Ideally
``ssh user@virtualMachine``
::
would be nice. But depending on virtual network configuration it might not be
always possible. For instance, when using libvirt NATed network it's dnsmasq
(spawned by libvirt) who assigns IP addresses to domains. But by default, the
dnsmasq process is then not consulted when it comes to host name translation.
Users work around this problem by configuring their libvirt network to assign
static IP addresses and maintaining ``/etc/hosts`` file in sync. But this puts
needless burden onto users. This is where NSS module comes handy.
$ ssh user@mydomain
would work out of the box, but depending on the network configuration that
might not be the case. Setting up the libvirt NSS module is a one-time
operation that makes the process of connecting from the host to the guests
running on it much more convenient.
Note that this feature only works in certain scenarios. See the
`limitations`_ section for more information.
Installation
------------
Installing the module is really easy:
Installing the module on Fedora or RHEL is really easy:
::
# yum install libvirt-nss
# dnf install libvirt-nss
The package might have a different name on other distributions, but the process
of installing it will be similar.
Configuration
-------------
Enabling the module is really easy. Just add **libvirt** into
``/etc/nsswitch.conf`` file. For instance:
If you're running a new enough version of Fedora (>= 37) or RHEL (>= 10), then
you can use ``authselect`` to enable the module with a single command:
::
$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf:
passwd: compat
shadow: compat
group: compat
hosts: files libvirt dns
# ...
# authselect enable-feature with-libvirt
So, in this specific case, whenever ssh program is looking up the host user is
trying to connect to, **files** module is consulted first (which boils down to
looking up the host name in ``/etc/hosts`` file), if not found **libvirt**
module is consulted then. The DNS is the last effort then, if none of the
previous modules matched the host in question. Therefore users should consider
the order in which they want the modules to lookup given host name.
For other distributions, you will have to manually update the configuration in
``/etc/nsswitch.conf`` so that the ``hosts`` line looks similar to
Sources of information
::
hosts: files libvirt libvirt_guest dns
With this configuration, whenever SSH (or any other application)
tries to contact a guest, the ``files`` module will be consulted first (this
boils down to searching for a matching line in ``/etc/hosts``); if no IP
address could be found that way, the ``libvirt`` and ``libvirt_guest`` modules
(see `below <variants_>`__ for differences between the two) will be used
instead. Finally, if no previous attempt at resolving the hostname was
successful, a DNS query will be performed.
Variants
--------
There are two different variants of the module:
* ``libvirt`` (:since:`since 1.3.3`) resolves hostnames based on the
information that the guest OS itself has reported to the DHCP server when
asking for an IP address, so it won't work if the guest OS hasn't been fully
configured yet;
* ``libvirt_guest`` (:since:`since 3.0.0`) resolves hostnames by mapping them
directly to libvirt domain names, so it will work regardless of how the guest
OS is configured and will have more predictable results.
The recommended configuration seen above enables both of them and gives
priority to the former but it's also possible to enable only a single one, or
to alter the precedence by simply changing the order in which they are listed.
Implementation details
----------------------
As of ``v3.0.0`` release, libvirt offers two NSS modules implementing two
different methods of hostname translation. The first and older method is
implemented by ``libvirt`` plugin and basically looks up the hostname to IP
address translation in DHCP server records. Therefore this is dependent on
hostname provided by guests. Thing is, not all the guests out there provide one
in DHCP transactions, or not every sysadmin out there believes all the guests.
Hence libvirt implements second method in ``libvirt_guest`` module which does
libvirt guest name to IP address translation (regardless of hostname set in the
guest).
Whenever a Unix process needs to convert a hostname into an IP address, it will
call the `gethostbyname() <https://linux.die.net/man/3/gethostbyname>`__ libc
function or one of its variants.
To enable either of the modules put their name into the ``nsswitch.conf`` file.
For instance, to enable ``libvirt_guest`` module:
Since multiple sources for this information are possible (for example the
contents of ``/etc/hosts``, DNS, LDAP, etc.) a mechanism called
`NSS <https://en.wikipedia.org/wiki/Name_Service_Switch>`__ has been created to
make the name resolution process extensible. This allows each source to be
implemented as a separate plugin that can be enabled or disabled based on the
administrator's preferences.
In the case of libvirt, the lookup is performed by inspecting the DHCP leases
handed out by ``dnsmasq``, the software used to implement NATed networks. The
results will be the same that would be reported by
::
$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf:
hosts: files libvirt_guest dns
# ...
$ virsh domifaddr --source lease mydomain
Or users can enable both at the same time:
::
$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf:
hosts: files libvirt libvirt_guest dns
# ...
This configuration will mean that if hostname is not found by the ``libvirt``
module (e.g. because a guest did not sent hostname during DHCP transaction), the
``libvirt_guest`` module is consulted (and if the hostname matches libvirt guest
name it will be resolved).
How does it work?
-----------------
Whenever an Unix process wants to do a host name translation
`gethostbyname() <https://linux.die.net/man/3/gethostbyname>`__ or some variant
of it is called. This is a glibc function that takes a string containing the
host name, crunch it and produces a list of IP addresses assigned to that host.
Now, glibc developers made a really good decision when implementing the
internals of the function when they decided to make the function pluggable.
Since there can be several sources for the records (e.g. ``/etc/hosts`` file,
DNS, LDAP, etc.) it would not make much sense to create one big implementation
containing all possible cases. What they have done instead is this pluggable
mechanism. Small plugins implementing nothing but specific technology for lookup
process are provided and the function then calls those plugins. There is just
one configuration file that instructs the lookup function in which order should
the plugins be called and which plugins should be loaded. For more info reading
`wiki page <https://en.wikipedia.org/wiki/Name_Service_Switch>`__ is
recommended.
And this is point where libvirt comes in. Libvirt provides plugin for the NSS
ecosystem. For some time now libvirt keeps a list of assigned IP addresses for
libvirt networks. The NSS plugin does no more than search the list trying to
find matching record for given host name. When found, matching IP address is
returned to the caller. If not found, translation process continues with the
next plugin configured. At this point it is important to stress the order in
which plugins are called. Users should be aware that a hostname might match in
multiple plugins and right after first match, translation process is terminated
and no other plugin is consulted. Therefore, if there are two different records
for the same host name users should carefully chose the lookup order.
except that things will work transparently for any application that uses the
libc resolver, without it needing to link against libvirt or even be aware of
its existence.
Limitations
-----------
#. The ``libvirt`` NSS module matches only hostnames provided by guest. If the
libvirt name and one advertised by guest differs, the latter is matched.
However, as of ``v3.0.0`` there are two libvirt NSS modules translating both
hostnames provided by guest and libvirt guest names.
#. The module works only in that cases where IP addresses are assigned by
dnsmasq spawned by libvirt. Libvirt NATed networks are typical example.
*The following paragraph describes implementation limitation of the ``libvirt``
NSS module.* These limitation are result of libvirt's internal implementation.
While libvirt can report IP addresses regardless of their origin, a public API
must be used to obtain those. However, for the API a connection object is
required. Doing that for every name translation request would be too costly.
Fortunately, libvirt spawns dnsmasq for NATed networks. Not only that, it
provides small executable that on each IP address space change updates an
internal list of addresses thus keeping it in sync. The NSS module then merely
consults the list trying to find the match. Users can view the list themselves:
::
virsh net-dhcp-leases $network
where ``$network`` iterates through all running networks. So the module does
merely the same as
::
virsh domifaddr --source lease $domain
If there's no record for either of the aforementioned commands, it's very likely
that NSS module won't find anything and vice versa. As of ``v3.0.0`` libvirt
provides ``libvirt_guest`` NSS module that doesn't have this limitation.
However, the statement is still true for the ``libvirt`` NSS module.
Since the libvirt NSS module works by looking at ``dnsmasq``, it can only work
for guests that are connected to a NATed libvirt network. Guests that obtain
their IP addresses in any other way (usermode networking, assigned network
devices and so on) will not be able to have their hostnames resolved through
it.
Alternatives
------------
As of ``v10.3.0`` libvirt implements an `SSH proxy <ssh-proxy.html>`__ which
doesn't require any network interface to SSH into the guest as SSH flows
through a VSOCK device.
:since:`Since 10.3.0`, libvirt implements an `SSH proxy <ssh-proxy.html>`__.
This allows the use of SSH even for guests that have no network connectivity,
by communicating over VSOCK.

File diff suppressed because it is too large Load Diff

View File

@ -90,6 +90,8 @@ typedef enum {
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 19, /* s390 AP Queue (Since: 7.0.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX = 1 << 20, /* s390 AP Matrix (Since: 7.0.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD = 1 << 21, /* Device with VPD (Since: 7.9.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCWGROUP_DEV = 1 << 22, /* s390 CCWGROUP device (Since: 11.1.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCWGROUP_MEMBER = 1 << 23, /* s390 CCW device member of CCWGROUP device (Since: 11.1.0) */
VIR_CONNECT_LIST_NODE_DEVICES_PERSISTENT = 1 << 28, /* Persisted devices (Since: 10.1.0) */
VIR_CONNECT_LIST_NODE_DEVICES_TRANSIENT = 1 << 29, /* Transient devices (Since: 10.1.0) */

View File

@ -29,12 +29,14 @@
%define arches_zfs %{arches_x86} %{power64} %{arm}
%define arches_numactl %{arches_x86} %{power64} aarch64 s390x
%define arches_numad %{arches_x86} %{power64} aarch64
%define arches_ch x86_64 aarch64
# The hypervisor drivers that run in libvirtd
%define with_qemu 0%{!?_without_qemu:1}
%define with_lxc 0%{!?_without_lxc:1}
%define with_libxl 0%{!?_without_libxl:1}
%define with_vbox 0%{!?_without_vbox:1}
%define with_ch 0%{!?_without_ch:1}
%ifarch %{arches_qemu_kvm}
%define with_qemu_kvm %{with_qemu}
@ -42,6 +44,12 @@
%define with_qemu_kvm 0
%endif
%if 0%{?fedora} >= 42
%define with_account_add 0
%else
%define with_account_add 1
%endif
%define with_qemu_tcg %{with_qemu}
# RHEL disables TCG on all architectures
@ -123,6 +131,9 @@
%ifnarch %{arches_ceph}
%define with_storage_rbd 0
%endif
%ifnarch %{arches_ch}
%define with_ch 0
%endif
# RHEL doesn't ship many hypervisor drivers
%if 0%{?rhel}
@ -132,6 +143,7 @@
%define with_libxl 0
%define with_hyperv 0
%define with_lxc 0
%define with_ch 0
%endif
%define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
@ -317,6 +329,9 @@ Obsoletes: libvirt-daemon-uml <= 5.0.0
%if %{with_vbox}
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
%endif
%if %{with_ch}
Requires: libvirt-daemon-driver-ch = %{version}-%{release}
%endif
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
@ -331,7 +346,7 @@ Requires: libvirt-libs = %{version}-%{release}
BuildRequires: python3-docutils
BuildRequires: meson >= 0.56.0
BuildRequires: ninja-build
BuildRequires: git
BuildRequires: git-core
BuildRequires: perl-interpreter
BuildRequires: python3
BuildRequires: python3-pytest
@ -348,7 +363,7 @@ BuildRequires: gcc
%if %{with_libxl}
BuildRequires: xen-devel
%endif
BuildRequires: glib2-devel >= 2.58
BuildRequires: glib2-devel >= 2.66
BuildRequires: libxml2-devel
BuildRequires: readline-devel
BuildRequires: pkgconfig(bash-completion) >= 2.0
@ -526,8 +541,10 @@ Requires(posttrans): /usr/bin/systemctl
Requires(preun): /usr/bin/systemctl
# libvirtd depends on 'messagebus' service
Requires: dbus
%if %{with_account_add}
# For uid creation during pre
Requires(pre): shadow-utils
%endif
# Needed by /usr/libexec/libvirt-guests.sh script.
%if 0%{?fedora}
Requires: gettext-runtime
@ -554,6 +571,7 @@ resources
%package daemon-plugin-lockd
Summary: lockd client plugin for virtlockd
Requires: libvirt-libs = %{version}-%{release}
Requires: libvirt-daemon-common = %{version}-%{release}
Requires: libvirt-daemon-lock = %{version}-%{release}
%description daemon-plugin-lockd
@ -1026,6 +1044,20 @@ Server side daemon and driver required to manage the virtualization
capabilities of VirtualBox
%endif
%if %{with_ch}
%package daemon-driver-ch
Summary: Cloud-Hypervisor driver plugin for libvirtd daemon
Requires: libvirt-daemon-common = %{version}-%{release}
Requires: libvirt-daemon-log = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
%description daemon-driver-ch
The ch driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs by
Cloud-Hypervisor
%endif
%package client
Summary: Client side utilities of the libvirt library
Requires: libvirt-libs = %{version}-%{release}
@ -1071,6 +1103,10 @@ Wireshark dissector plugin for better analysis of libvirt RPC traffic.
%package login-shell
Summary: Login shell for connecting users to an LXC container
Requires: libvirt-libs = %{version}-%{release}
%if %{with_account_add}
# For uid creation during pre
Requires(pre): shadow-utils
%endif
%description login-shell
Provides the set-uid virt-login-shell binary that is used to
@ -1093,6 +1129,7 @@ Requires: sanlock >= 2.4
#for virt-sanlock-cleanup require augeas
Requires: augeas
Requires: libvirt-libs = %{version}-%{release}
Requires: libvirt-daemon-common = %{version}-%{release}
Obsoletes: libvirt-lock-sanlock < 9.1.0
Provides: libvirt-lock-sanlock = %{version}-%{release}
@ -1188,9 +1225,15 @@ exit 1
%endif
%if %{with_esx}
%define arg_esx -Ddriver_esx=enabled -Dcurl=enabled
%define arg_esx -Ddriver_esx=enabled
%else
%define arg_esx -Ddriver_esx=disabled -Dcurl=disabled
%define arg_esx -Ddriver_esx=disabled
%endif
%if %{with_esx} || %{with_ch}
%define arg_curl -Dcurl=enabled
%else
%define arg_curl -Dcurl=disabled
%endif
%if %{with_hyperv}
@ -1205,6 +1248,12 @@ exit 1
%define arg_vmware -Ddriver_vmware=disabled
%endif
%if %{with_ch}
%define arg_ch -Ddriver_ch=enabled
%else
%define arg_ch -Ddriver_ch=disabled
%endif
%if %{with_storage_rbd}
%define arg_storage_rbd -Dstorage_rbd=enabled
%else
@ -1335,11 +1384,12 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Ddriver_remote=enabled \
-Ddriver_test=enabled \
%{?arg_esx} \
%{?arg_curl} \
%{?arg_hyperv} \
%{?arg_vmware} \
%{?arg_ch} \
-Ddriver_vz=disabled \
-Ddriver_bhyve=disabled \
-Ddriver_ch=disabled \
%{?arg_remote_mode} \
-Ddriver_interface=enabled \
-Ddriver_network=enabled \
@ -1419,6 +1469,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
-Dblkid=disabled \
-Dcapng=disabled \
-Ddriver_bhyve=disabled \
-Ddriver_ch=disabled \
-Ddriver_hyperv=disabled \
-Ddriver_interface=disabled \
-Ddriver_libvirtd=disabled \
@ -1541,6 +1592,10 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
%endif
%if ! %{with_ch}
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_ch.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_ch.aug
%endif
# Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
@ -1751,10 +1806,12 @@ export VIR_TEST_DEBUG=1
%pre daemon-common
%libvirt_sysconfig_pre libvirt-guests
%libvirt_systemd_oneshot_pre libvirt-guests
%if %{with_account_add}
# 'libvirt' group is just to allow password-less polkit access to libvirt
# daemons. The uid number is irrelevant, so we use dynamic allocation.
getent group libvirt >/dev/null || groupadd -r libvirt
exit 0
%endif
%posttrans daemon-common
%libvirt_sysconfig_posttrans libvirt-guests
@ -1877,6 +1934,7 @@ exit 0
%libvirt_sysconfig_pre virtqemud
%libvirt_systemd_unix_pre virtqemud
%if %{with_account_add}
# We want soft static allocation of well-known ids, as disk images
# are commonly shared across NFS mounts by id rather than name.
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/
@ -1892,6 +1950,7 @@ if ! getent passwd 'qemu' >/dev/null; then
fi
fi
exit 0
%endif
%posttrans daemon-driver-qemu
%libvirt_sysconfig_posttrans virtqemud
@ -1940,6 +1999,19 @@ exit 0
%libvirt_systemd_unix_preun virtxend
%endif
%if %{with_ch}
%pre daemon-driver-ch
%libvirt_sysconfig_pre virtchd
%libvirt_systemd_unix_pre virtchd
%posttrans daemon-driver-ch
%libvirt_sysconfig_posttrans virtchd
%libvirt_systemd_unix_posttrans virtchd
%preun daemon-driver-ch
%libvirt_systemd_unix_preun virtchd
%endif
%pre daemon-config-network
%libvirt_systemd_config_pre libvirtd
%libvirt_systemd_config_pre virtnetworkd
@ -2005,8 +2077,10 @@ done
%if %{with_lxc}
%pre login-shell
%if %{with_account_add}
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif
%endif
%endif
@ -2027,7 +2101,9 @@ exit 0
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
%dir %{_datadir}/augeas/lenses
%{_datadir}/augeas/lenses/libvirtd.aug
%dir %{_datadir}/augeas/lenses/tests
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
%attr(0755, root, root) %{_sbindir}/libvirtd
%{_mandir}/man8/libvirtd.8*
@ -2048,9 +2124,11 @@ exit 0
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
%{_sysusersdir}/libvirt.conf
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
%attr(0755, root, root) %{_bindir}/virt-ssh-helper
@ -2078,7 +2156,6 @@ exit 0
%{_mandir}/man8/virtlockd.8*
%files daemon-plugin-lockd
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
%files daemon-log
@ -2217,7 +2294,6 @@ exit 0
%ghost %dir %{_rundir}/libvirt/storage/
%{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so
%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so
%{_libdir}/libvirt/storage-file/libvirt_storage_file_fs.so
%{_mandir}/man8/virtstoraged.8*
%files daemon-driver-storage-disk
@ -2275,10 +2351,10 @@ exit 0
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/
%ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/
%ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/dbus/
%ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/passt/
%ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/slirp/
%ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/passt/
%ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/slirp/
%ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/swtpm/
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/checkpoint/
@ -2393,7 +2469,6 @@ exit 0
%if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
%endif
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
@ -2403,6 +2478,19 @@ exit 0
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
%endif
%if %{with_ch}
%files daemon-driver-ch
%attr(0755, root, root) %{_sbindir}/virtchd
%config(noreplace) %{_sysconfdir}/libvirt/virtchd.conf
%{_datadir}/augeas/lenses/virtchd.aug
%{_datadir}/augeas/lenses/tests/test_virtchd.aug
%{_unitdir}/virtchd-admin.socket
%{_unitdir}/virtchd-ro.socket
%{_unitdir}/virtchd.service
%{_unitdir}/virtchd.socket
%{_libdir}/libvirt/connection-driver/libvirt_driver_ch.so
%endif
%files client
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
@ -2433,15 +2521,17 @@ exit 0
%{_libdir}/libvirt-lxc.so.*
%{_libdir}/libvirt-admin.so.*
%dir %{_datadir}/libvirt/
%{_datadir}/libvirt/test-screenshot.png
%dir %{_datadir}/libvirt/schemas/
%{_datadir}/libvirt/schemas/*.rng
%dir %{_datadir}/systemtap/tapset/
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_functions.stp
%if %{with_qemu}
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
%endif
%{_datadir}/libvirt/schemas/*.rng
%dir %{_datadir}/libvirt/cpu_map
%{_datadir}/libvirt/cpu_map/*.xml
%{_datadir}/libvirt/test-screenshot.png
%if %{with_wireshark}
%files wireshark
@ -2461,6 +2551,7 @@ exit 0
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
%{_libexecdir}/virt-login-shell-helper
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_sysusersdir}/libvirt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

View File

@ -1,6 +1,6 @@
project(
'libvirt', 'c',
version: '10.9.0',
version: '11.2.0',
license: 'LGPLv2+',
meson_version: '>= 0.56.0',
default_options: [
@ -15,6 +15,10 @@ if meson.version().version_compare('>=0.64.0')
fs = import('fs')
endif
i18n = import('i18n')
po_dir = meson.project_source_root() / 'po'
# figure out if we are building from git
git = run_command('test', '-e', '.git', check: false).returncode() == 0
@ -78,7 +82,7 @@ endif
runstatedir = get_option('runstatedir')
if runstatedir == ''
runstatedir = localstatedir / 'run'
runstatedir = '/run'
endif
initconfdir = get_option('initconfdir')
@ -114,6 +118,8 @@ localedir = prefix / get_option('localedir')
mandir = prefix / get_option('mandir')
sbindir = prefix / get_option('sbindir')
sharedstatedir = prefix / get_option('sharedstatedir')
polkitactionsdir = datadir / 'polkit-1' / 'actions'
polkitrulesdir = datadir / 'polkit-1' / 'rules.d'
docdir = get_option('docdir')
if docdir == ''
@ -128,6 +134,11 @@ if sshconfdir == ''
sshconfdir = sysconfdir / 'ssh' / 'ssh_config.d'
endif
connection_driver_install_dir = libdir / 'libvirt' / 'connection-driver'
storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend'
storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
lock_driver_install_dir = libdir / 'libvirt' / 'lock-driver'
# generate configmake.h header
@ -998,7 +1009,7 @@ else
endif
endif
glib_version = '2.58.0'
glib_version = '2.66.0'
glib_dep = dependency('glib-2.0', version: '>=' + glib_version)
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_version)
if host_machine.system() == 'windows'
@ -1576,8 +1587,15 @@ elif get_option('driver_lxc').enabled()
error('linux and remote_driver are required for LXC')
endif
if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' and (host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64')
use_ch = true
if not get_option('driver_ch').disabled()
if host_machine.system() == 'linux' and (host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64')
use_ch = true
else
use_ch = false
if get_option('driver_ch').enabled()
error('linux on x86_64 or aarch64 is required to build Cloud-Hypervisor driver')
endif
endif
if not conf.has('WITH_LIBVIRTD')
use_ch = false
@ -1787,11 +1805,11 @@ if conf.has('WITH_LIBVIRTD')
conf.set('WITH_STORAGE_DIR', 1)
endif
if not get_option('storage_disk').disabled() and devmapper_dep.found() and libparted_dep.found()
if not get_option('storage_disk').disabled() and libparted_dep.found()
use_storage = true
conf.set('WITH_STORAGE_DISK', 1)
elif get_option('storage_disk').enabled()
error('You must install libparted and libdevmapper to compile libvirt with disk storage driver')
error('You must install libparted to compile libvirt with disk storage driver')
endif
if not get_option('storage_fs').disabled()

View File

@ -1,6 +1,7 @@
src/access/viraccessapicheck.c
src/access/viraccessapichecklxc.c
src/access/viraccessapicheckqemu.c
src/access/org.libvirt.api.policy.in
src/admin/admin_client.h
src/admin/admin_server_dispatch_stubs.h
src/remote/remote_client_bodies.h
@ -21,6 +22,8 @@ src/bhyve/bhyve_process.c
src/ch/ch_conf.c
src/ch/ch_domain.c
src/ch/ch_driver.c
src/ch/ch_events.c
src/ch/ch_hostdev.c
src/ch/ch_interface.c
src/ch/ch_monitor.c
src/ch/ch_process.c
@ -93,6 +96,7 @@ src/hyperv/hyperv_util.c
src/hyperv/hyperv_wmi.c
src/hypervisor/domain_cgroup.c
src/hypervisor/domain_driver.c
src/hypervisor/domain_logcontext.c
src/hypervisor/domain_interface.c
src/hypervisor/virhostdev.c
src/interface/interface_backend_netcf.c
@ -179,7 +183,6 @@ src/qemu/qemu_hostdev.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_interface.c
src/qemu/qemu_interop_config.c
src/qemu/qemu_logcontext.c
src/qemu/qemu_migration.c
src/qemu/qemu_migration_cookie.c
src/qemu/qemu_migration_params.c
@ -189,6 +192,7 @@ src/qemu/qemu_monitor_text.c
src/qemu/qemu_namespace.c
src/qemu/qemu_nbdkit.c
src/qemu/qemu_passt.c
src/qemu/qemu_postparse.c
src/qemu/qemu_process.c
src/qemu/qemu_qapi.c
src/qemu/qemu_saveimage.c
@ -199,6 +203,7 @@ src/qemu/qemu_validate.c
src/qemu/qemu_vhost_user.c
src/qemu/qemu_vhost_user_gpu.c
src/qemu/qemu_virtiofs.c
src/remote/libvirtd.policy.in
src/remote/remote_daemon.c
src/remote/remote_daemon_config.c
src/remote/remote_daemon_dispatch.c
@ -291,6 +296,7 @@ src/util/virhostcpu.c
src/util/virhostmem.c
src/util/virhostuptime.c
src/util/viridentity.c
src/util/virinhibitor.c
src/util/virinitctl.c
src/util/viriscsi.c
src/util/virjson.c

1277
po/as.po

File diff suppressed because it is too large Load Diff

1196
po/bg.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1196
po/bs.po

File diff suppressed because it is too large Load Diff

1201
po/ca.po

File diff suppressed because it is too large Load Diff

1490
po/cs.po

File diff suppressed because it is too large Load Diff

1196
po/da.po

File diff suppressed because it is too large Load Diff

1282
po/de.po

File diff suppressed because it is too large Load Diff

1180
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8898
po/es.po

File diff suppressed because it is too large Load Diff

1291
po/fi.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More