]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 months agonetwork: Suppress reporting an error when D-Bus is unavailable in networkStateInitial...
Michal Privoznik [Thu, 10 Apr 2025 08:42:55 +0000 (10:42 +0200)] 
network: Suppress reporting an error when D-Bus is unavailable in networkStateInitialize()

When the network driver initializes itself, it tries to subscribe
to signals from Firewalld sent over system D-Bus. Well, the code
is written in best effort mode, i.e. lack of D-Bus is not
considered an error. Problem is, virGDBusGetSystemBus() which is
used to obtain system D-Bus prints out an error in case of
lacking system D-Bus. This pollutes the logs (which may mislead
users) and goes against the best-effort nature of aforementioned
code. Check for the system D-Bus presence via
virGDBusHasSystemBus() first.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 months agovirinhibitor: Suppress reporting an error when D-Bus is unavailable in virInhibitorAc...
Michal Privoznik [Thu, 10 Apr 2025 08:20:02 +0000 (10:20 +0200)] 
virinhibitor: Suppress reporting an error when D-Bus is unavailable in virInhibitorAcquire()

At the beginning of virInhibitorAcquire() the system D-Bus
connection is obtained by calling virGDBusGetSystemBus(). If
there's no D-Bus available then an debug message is printed out
and function returns early. Problem is, in case of no D-Bus an
error message was reported by virGDBusGetSystemBus() and thus
logs were polluted which may mislead users.

Just check whether D-Bus is available first (by calling
virGDBusHasSystemBus()). If it is then virGDBusGetSystemBus()
should return a valid connection. Nevertheless, respect previous
logic and don't propagate error to the caller, just return 0.

Resolves: https://issues.redhat.com/browse/RHEL-79088
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoNEWS: Mention fix for 'qemu-rdp' error being logged
Peter Krempa [Tue, 8 Apr 2025 14:50:37 +0000 (16:50 +0200)] 
NEWS: Mention fix for 'qemu-rdp' error being logged

Add the news entry stating that it's safe to ignore the error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 months agoqemu: rdp: Fix 'qemuRdpAvailable()'
Peter Krempa [Mon, 7 Apr 2025 16:16:15 +0000 (18:16 +0200)] 
qemu: rdp: Fix 'qemuRdpAvailable()'

qemuRdpAvailable() is called from the capability filing code, thus:
- it must not report spurious errors
- it should not call any extra processes

We can solve the above by just checking existance of 'qemu-rdp' in the
path as:
- at the time of adding of qemuRdpAvailable() there was only one 'qemu-rdp' release
- it supported all the features
- the check can't change as we'd drop the capability

Add comments and gut the check to only check existance of the file.

Fixes: f5e5a9bec9ec3e6c762f5000e3b8a0ba6a3a8c8d
Closes: https://gitlab.com/libvirt/libvirt/-/issues/763
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
4 months agoesx: Accept empty "path" URI component same way as "/"
Peter Krempa [Tue, 8 Apr 2025 14:25:37 +0000 (16:25 +0200)] 
esx: Accept empty "path" URI component same way as "/"

When connecting to "esx://" URI there's code which prints a warning that
the path is not "empty". The check validates that "uri->path" is "/".

In case when the user uses URI such as:

 esx://hostname

the warning is printed as well. Since there is no effective difference
betweeen the two allow empty strings as well.

Resolves: https://issues.redhat.com/browse/RHEL-86459
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agomanpages: virsh: Use disclaimer from 'virNodeGetInfo()' for 'virsh nodeinfo'
Peter Krempa [Mon, 7 Apr 2025 12:58:41 +0000 (14:58 +0200)] 
manpages: virsh: Use disclaimer from 'virNodeGetInfo()' for 'virsh nodeinfo'

Adapt the disclarimer about the data not being accurate in many cases
from the API docs to the virsh command using the aforementioned API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agovirNodeGetInfo: Improve description of the case when fake data is reported
Peter Krempa [Mon, 7 Apr 2025 12:33:01 +0000 (14:33 +0200)] 
virNodeGetInfo: Improve description of the case when fake data is reported

virNodeGetInfo due to the rigid desing of the filled struct can't
faithfully represent all topologies. Improve the description when that
happens and outline the fallback topology.

The function docs already state that users ought to use
virConnectGetCapabilities() instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agolibvirt-host: Clarify/fix description of the CPU frequency field
Peter Krempa [Mon, 7 Apr 2025 11:35:37 +0000 (13:35 +0200)] 
libvirt-host: Clarify/fix description of the CPU frequency field

The 'virNodeInfo' field for CPU frequency is named 'mhz'. The docs were
mentioning 'mHZ', which is neither the field name nor proper spelling of
the unit.

Reword the paragraph to mention "CPU frequency" instead and explicitly
name the field in virNodeInfo struct.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agovirHostCPUGetInfoPopulateLinux: Remove 'cleanup'
Peter Krempa [Mon, 7 Apr 2025 11:55:43 +0000 (13:55 +0200)] 
virHostCPUGetInfoPopulateLinux: Remove 'cleanup'

As the cleanup section is empty; the code can now return directly on
errors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agovirHostCPUGetInfoPopulateLinux: Use automatic memory freeing
Peter Krempa [Mon, 7 Apr 2025 11:49:21 +0000 (13:49 +0200)] 
virHostCPUGetInfoPopulateLinux: Use automatic memory freeing

Use 'g_autfree' for the two temporary strings.

'sysfs_cpudir' was used in two places, one of which is in a loop. Add
another helper variable for it and declare the other one in the loop.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoqemu: capabilities: Retire QEMU_CAPS_NBD_BITMAP
Peter Krempa [Tue, 8 Apr 2025 11:56:38 +0000 (13:56 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_NBD_BITMAP

The capability wasn't used since it's inception. It now refers to a
deprecated QMP command. Drop it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: capabilities: Retire QEMU_CAPS_BLOCK_EXPORT_ADD
Peter Krempa [Tue, 8 Apr 2025 11:54:24 +0000 (13:54 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_BLOCK_EXPORT_ADD

The 'block-export-add' command was added in qemu-5.2 so we now use it
unconditionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: monitor: Drop wrappers for 'nbd-server-add'
Peter Krempa [Tue, 8 Apr 2025 11:53:25 +0000 (13:53 +0200)] 
qemu: monitor: Drop wrappers for 'nbd-server-add'

The code is no longer used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: block: Always assume support for 'block-export-add'
Peter Krempa [Tue, 8 Apr 2025 11:50:53 +0000 (13:50 +0200)] 
qemu: block: Always assume support for 'block-export-add'

'block-export-add' QMP command which replaces 'nbd-server-add' was
introduced in qemu-5.2. We can thus drop the old code now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agodocs: drvqemu: Fix required minimum qemu version to 6.2.0
Peter Krempa [Tue, 8 Apr 2025 10:17:26 +0000 (12:17 +0200)] 
docs: drvqemu: Fix required minimum qemu version to 6.2.0

Commit 8824af826d3 (and also commit 073bf167843 before it) which bumped
minimu, qemu version forgot to update the qemu driver documentation page

Fixes: 8824af826d3
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoNEWS: mention vol-create bug fix
Kirill Shchetiniuk via Devel [Wed, 9 Apr 2025 08:43:16 +0000 (10:43 +0200)] 
NEWS: mention vol-create bug fix

Signed-off-by: Kirill Shchetiniuk <kshcheti@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agostorage: virStorageVolDefParse and storageVolCreateXML flags fix
Kirill Shchetiniuk via Devel [Wed, 9 Apr 2025 08:43:15 +0000 (10:43 +0200)] 
storage: virStorageVolDefParse and storageVolCreateXML flags fix

When the new storage was created using virsh with --validate option
following errors occurred:

 # virsh vol-create default --file vol-def.xml --validate
error: Failed to create vol from vol-def.xml
error: unsupported flags (0x4) in function virStorageVolDefParseXML

and after virStorageVolDefParse fix:

 # virsh vol-create default --file vol-def.xml --validate
error: Failed to create vol from vol-def.xml
error: unsupported flags (0x4) in function storageBackendCreateQemuImg

Clear the VIR_VOL_XML_PARSE_VALIDATE flag before
virStorageVolDefParseXML() and the VIR_STORAGE_VOL_CREATE_VALIDATE before
backend->buildVol() (traces down to storageBackendCreateQemuImg) calls,
as the XML schema validation is already complete within previous steps
and there is no validation later.

Signed-off-by: Kirill Shchetiniuk <kshcheti@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agodocs: Render API and XML sections one per line in HTML
Peter Krempa [Wed, 2 Apr 2025 14:23:15 +0000 (16:23 +0200)] 
docs: Render API and XML sections one per line in HTML

Finding the correct link to a XML description or API reference section
in a big blob of links concatenated in a paragraph is unpleasand and
especially for 'capabilities' and 'domain capabilities' following each
other.

Turn the API and XML reference sections into a list in RST and add CSS
to fromat it a bit more compact.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agodocs: Re-order XML schema after API documentation on 'docs' page
Peter Krempa [Wed, 2 Apr 2025 11:59:26 +0000 (13:59 +0200)] 
docs: Re-order XML schema after API documentation on 'docs' page

Swap the order of links to XML schema docs and to the other language
docs. The XML schema is usually accessed more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoNEWS: Document ARM CPU map bug fix
Jiri Denemark [Fri, 4 Apr 2025 12:26:45 +0000 (14:26 +0200)] 
NEWS: Document ARM CPU map bug fix

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agocpu_map: Install Ampere-1 ARM CPU models
Jiri Denemark [Fri, 4 Apr 2025 12:22:01 +0000 (14:22 +0200)] 
cpu_map: Install Ampere-1 ARM CPU models

Fixes: 282f38ad3d3960b24aa97d75cae95c8c3d08a218
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/762
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agotests: Add a basic CPU test for aarch64
Jiri Denemark [Fri, 4 Apr 2025 09:10:20 +0000 (11:10 +0200)] 
tests: Add a basic CPU test for aarch64

The purpose of this test is to enforce loading and parsing of ARM CPU
map so that possible issues are found earlier.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agomeson: Drop workaround for -Wframe-larger-than and clang
Michal Privoznik [Fri, 4 Apr 2025 07:20:01 +0000 (09:20 +0200)] 
meson: Drop workaround for -Wframe-larger-than and clang

After previous cleanups, all functions have their stack smaller
than 2048 bytes and thus the workaround is no longer needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agovbox: Move parts of vboxSnapshotRedefine() into a separate function
Michal Privoznik [Fri, 4 Apr 2025 12:35:43 +0000 (14:35 +0200)] 
vbox: Move parts of vboxSnapshotRedefine() into a separate function

There's too much happening inside of vboxSnapshotRedefine(). Not
only it makes the function hard to read, but it also increases
stack size of the function. Move one part into a separate
function: vboxSnapshotCreateFakeDiffStorage()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agovbox: Move parts of vboxSnapshotRedefine() into a separate function
Michal Privoznik [Fri, 4 Apr 2025 12:25:46 +0000 (14:25 +0200)] 
vbox: Move parts of vboxSnapshotRedefine() into a separate function

There's too much happening inside of vboxSnapshotRedefine(). Not
only it makes the function hard to read, but it also increases
stack size of the function. Move one part into a separate
function: vboxSnapshotAddRWDisks()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agovbox: Move parts of vboxSnapshotRedefine() into a separate function
Michal Privoznik [Fri, 4 Apr 2025 12:15:30 +0000 (14:15 +0200)] 
vbox: Move parts of vboxSnapshotRedefine() into a separate function

There's too much happening inside of vboxSnapshotRedefine(). Not
only it makes the function hard to read, but it also increases
stack size of the function. Move one part into a separate
function: vboxSnapshotAddDisksToMediaRegistry()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agovbox: Move parts of vboxSnapshotRedefine() into a separate function
Michal Privoznik [Fri, 4 Apr 2025 12:08:42 +0000 (14:08 +0200)] 
vbox: Move parts of vboxSnapshotRedefine() into a separate function

There's too much happening inside of vboxSnapshotRedefine(). Not
only it makes the function hard to read, but it also increases
stack size of the function. Move one part into a separate
function: vboxSnapshotReplaceRWDisks()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agodoRemoteOpen: Drop needless typecast of @transport
Michal Privoznik [Fri, 4 Apr 2025 09:46:36 +0000 (11:46 +0200)] 
doRemoteOpen: Drop needless typecast of @transport

The @transport variable is already pass into the function with
proper type. There's no need to typecast it to its very same type
inside the function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agodoRemoteOpen: Move RPC talk to a separate function
Michal Privoznik [Fri, 4 Apr 2025 07:21:45 +0000 (09:21 +0200)] 
doRemoteOpen: Move RPC talk to a separate function

When opening a connection, the client does some RPC talk
(most notably REMOTE_PROC_CONNECT_OPEN, and in some cases
REMOTE_PROC_CONNECT_GET_URI even).

Now, calling RPC means that local variables must be created.
Having them in doRemoteOpen() increases its stack size which goes
against our effort in bringing the size down (see one of previous
commits).

Move that part of the code into a separate function.

This brings the stack size of doRemoteOpen() even further: from
1320 bytes to 1272.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agoremote_driver: Move URI arg extraction into a separate function
Michal Privoznik [Fri, 4 Apr 2025 10:05:18 +0000 (12:05 +0200)] 
remote_driver: Move URI arg extraction into a separate function

There's a problem with glib: what we might consider functions are
in fact macros and to make things worse - they do declare local
variables. For instance here's the declaration of
g_clear_pointer() macro:

#define g_clear_pointer(pp, destroy)                     \
  G_STMT_START                                           \
  {                                                      \
    G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
    glib_typeof ((pp)) _pp = (pp);                       \
    glib_typeof (*(pp)) _ptr = *_pp;                     \
    *_pp = NULL;                                         \
    if (_ptr)                                            \
      (destroy) (_ptr);                                  \
  }                                                      \
  G_STMT_END                                             \

Now, as of v6.2.0-rc1~267 our VIR_FREE() macro is in fact a
redeclaration of g_clear_pointer(). Thus, calling VIR_FREE()
increases stack size!

Ideally, this wouldn't be a problem, because those variables
(_pp, _ptr) live in their own block. And clever compiler can just
reuse space created for one block.

But then there's clang where we are hitting this exact problem in
functions like doRemoteOpen() where either g_clear_pointer() is
called directly, or there are macros like EXTRACT_URI_ARG_STR()
which hide the call away.

That's why despite our previous efforts decreasing stack size we
still needed v9.8.0-rc1~208.

Well, moving URI argument extraction (those calls to
EXTRACT_URI_ARG_* macros) into a separate function helps us
decrease stack size from 2296 bytes to 1320.

Even after this there are still more possibilities for
improvements, but those will be addressed in future commits.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 months agoch: Fix printf format strings wrt size_t argument
Michal Privoznik [Thu, 3 Apr 2025 10:02:14 +0000 (12:02 +0200)] 
ch: Fix printf format strings wrt size_t argument

In a few places, when a size_t typed argument is passed to a
printf-like function the corresponding specifier is %ld instead
of %zu. Fix those places.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoch: Drop pid from monitor
Michal Privoznik [Wed, 2 Apr 2025 15:45:56 +0000 (17:45 +0200)] 
ch: Drop pid from monitor

The domain object already has a member that allows storing
hypervisor's PID (vm->pid). There's no need to duplicate it in
_virCHMonitor struct. Switch CH code to use the former.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoch: Use CH_DOMAIN_PRIVATE() more
Michal Privoznik [Wed, 2 Apr 2025 15:45:23 +0000 (17:45 +0200)] 
ch: Use CH_DOMAIN_PRIVATE() more

There are two instances where vm->privateData is typecasted only
so that it can be dereferenced further. Well, that's exactly what
CH_DOMAIN_PRIVATE() macro is for. Use that instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoAdd NEWS item for <hyperv/> flags with Xen
Will [Tue, 25 Mar 2025 06:24:07 +0000 (23:24 -0700)] 
Add NEWS item for <hyperv/> flags with Xen

Signed-off-by: Will <tcosprojects@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agolibxl_conf: Implement hyperv domain flags for Xen
Will [Tue, 25 Mar 2025 06:24:06 +0000 (23:24 -0700)] 
libxl_conf: Implement hyperv domain flags for Xen

Adds support for configuring <hyperv/> flags for domains
running under Xen.

The following flags, making use of QEMU's existing flags, are now
configurable for Xen: vapic, synic, stimer, frequencies, tlbflush and
ipi.

Tests have been added validating translation to libxl's viridian flags

Updated docs section on <hyperv/> flags to note support and to specify
which flags work with Xen.

Signed-off-by: Will <tcosprojects@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agotools: virsh: metadata: do not report error on missing metadata
Ján Tomko [Thu, 20 Feb 2025 22:23:34 +0000 (23:23 +0100)] 
tools: virsh: metadata: do not report error on missing metadata

Similarly to `desc` and `net-desc`, return an empty string if
there is no metadata to be returned.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Thu, 3 Apr 2025 11:20:43 +0000 (11:20 +0000)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10917 of 10917 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
4 months agodocs: add table showing guest IP/DNS/gateway settings when using SLIRP
Laine Stump [Mon, 24 Mar 2025 23:28:33 +0000 (19:28 -0400)] 
docs: add table showing guest IP/DNS/gateway settings when using SLIRP

When using the default SLIRP backend for <interface type='user'>, the
<ip address='blah' prefix='blur'/> setting doesn't behave as might be
expected (i.e. it doesn't set the guest interface IP/prefix to exactly
the provided values). This *should* have created questions when users
originally encountered it, but instead it has become more apparent as
people are contemplating switching from using the SLIRP backend to
using passt instead (with passt, the <ip> settings do behave "as
expected").

In order to make this difference in behavior less mysterious, Yalan
Zhang kindly took the time to test and document the effect of various
representative <ip> settings on guest interface config when SLIRP is
used (see https://issues.redhat.com/browse/RHEL-46601); this patch
adds that same table to libvirt's documentation.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoch: virCHProcessEvent() vm shutdown event handler fix
Kirill Shchetiniuk via Devel [Tue, 25 Mar 2025 14:11:59 +0000 (15:11 +0100)] 
ch: virCHProcessEvent() vm shutdown event handler fix

When the domain shutdown was executed from virsh, only the VM
process (a child of the CH monitor) was terminated. Since we assume
only one VM per monitor, the monitor process should also be
terminated.

Modified the VM shutdown event handler to match the VMM shutdown
behavior, ensuring the VM monitor stops along with the VM. Also
updated the virCHEventStopProcess job type, as it only destroys the
domain rather than modifying anything.

Signed-off-by: Kirill Shchetiniuk <kshcheti@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoch: virCHProcessEvent() update domain info after reboot
Kirill Shchetiniuk via Devel [Tue, 25 Mar 2025 14:11:58 +0000 (15:11 +0100)] 
ch: virCHProcessEvent() update domain info after reboot

When the domain was rebooted, some of its properties were changed but
not updated in the transient domain definition. This led to the
inability to connect to the serial console as its path had changed
during the reboot but was not updated in the domain definition.

Added VIR_CH_EVENT_VM_REBOOTED event handling to update the
information in transient domain definition after domain's reboot is
completed to maintain it in consistent state.

Signed-off-by: Kirill Shchetiniuk <kshcheti@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoch: virCHMonitorNew() run new CH monitor daemonized
Kirill Shchetiniuk via Devel [Tue, 25 Mar 2025 14:11:57 +0000 (15:11 +0100)] 
ch: virCHMonitorNew() run new CH monitor daemonized

When the new CH monitor was started, it ran as a non-daemonized
process and was a child of the CH driver process. This led to a
situation where if the CH driver died, the monitor process were
killed too, terminating the running VM under the monitor. This
led to termination of all VM started under the libvirt.

Make new monitor running daemonized to avoid VMs shutdown when
driver dies. Also added a pidfile its preparetion to be able
to aquire daemon's PID.

Signed-off-by: Kirill Shchetiniuk <kshcheti@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoqemu: capabilities: Retire QEMU_CAPS_SNAPSHOT_INTERNAL_QMP
Peter Krempa [Wed, 2 Apr 2025 07:59:48 +0000 (09:59 +0200)] 
qemu: capabilities: Retire QEMU_CAPS_SNAPSHOT_INTERNAL_QMP

The code now always assumes support for the QMP internal snapshot
commands so the capability is no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: monitor: Remove HMP monitor code
Peter Krempa [Tue, 1 Apr 2025 19:32:53 +0000 (21:32 +0200)] 
qemu: monitor: Remove HMP monitor code

Now that we've replaced the final two HMP commands used by libvirt we
can fully drop the 'text' monitor support.

The only thing we keep is the HMP passtrhough with
'virsh qemu-monitor-command'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: Always revert internal snapshots via QMP rather than '-loadvm'
Peter Krempa [Tue, 1 Apr 2025 19:03:14 +0000 (21:03 +0200)] 
qemu: Always revert internal snapshots via QMP rather than '-loadvm'

As all supported qemu versions now support the QMP internal snapshot
commands (QEMU_CAPS_SNAPSHOT_INTERNAL_QMP is always present) we can
remove the code for loading snapshots during startup via '-loadvm'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: snapshot: Always assume support for QEMU_CAPS_SNAPSHOT_INTERNAL_QMP
Peter Krempa [Tue, 1 Apr 2025 19:03:06 +0000 (21:03 +0200)] 
qemu: snapshot: Always assume support for QEMU_CAPS_SNAPSHOT_INTERNAL_QMP

The 'snapshot-save' QMP command was introduced in 'qemu-6.0' and libvirt
now requires at least 'qemu-6.2'. Thus we can assume that the QMP
command can be used always.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemuSnapshotCreateActiveInternal: Fix error logic
Peter Krempa [Wed, 2 Apr 2025 07:39:03 +0000 (09:39 +0200)] 
qemuSnapshotCreateActiveInternal: Fix error logic

The 'ret' variable is set to 0 before a call which can theoretically
fail. Not in practice really as the failure scenarion includes only
object initialization.

Since the code already has another variable for checking monitor returns
use that one properly so that the code makes sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: domain: Don't check return value of 'virCPUDefCopy'
Peter Krempa [Wed, 2 Apr 2025 07:45:19 +0000 (09:45 +0200)] 
qemu: domain: Don't check return value of 'virCPUDefCopy'

As 'virCPUDefCopy' can't fail any more (without aborting) remove the
last two return value checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: monitor: Improve field annotations in QEMU_CHECK_MONITOR
Peter Krempa [Tue, 25 Mar 2025 16:53:54 +0000 (17:53 +0100)] 
qemu: monitor: Improve field annotations in QEMU_CHECK_MONITOR

The macro checking monitor object state also logs information such as
the monitor object pointer and the number of the monitor FD.

Name the field 'monfd' instead of 'fd' as it's confusing when debugging
FD pasing via monitor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agotests: domainbackupxml2xml: Add test case for pull-mode backup with NBD transport...
Peter Krempa [Tue, 25 Mar 2025 16:54:01 +0000 (17:54 +0100)] 
tests: domainbackupxml2xml: Add test case for pull-mode backup with NBD transport='fd'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agobackup: Add support for passing server socket file descriptor to backup NBD server
Peter Krempa [Tue, 25 Mar 2025 16:46:45 +0000 (17:46 +0100)] 
backup: Add support for passing server socket file descriptor to backup NBD server

In deployments where libvirt is containerized together with the VM it
may be hard for the management application to access listening sockets
inside the container from the outside.

This patch implements "transport='fd'" for the NBD server definition for
backups which allows to use the existing "virDomainFDAssociate()" to
pass FD to a pre-opened server socket to qemu instead of trying to
create it by qemu.

Add schema, enable the parser, add formatter and implement the actual
passing for the qemu backup code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Spellchecked-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: monitor: Support FD passing of sockets to 'qemuMonitorJSONNBDServerStart'
Peter Krempa [Tue, 25 Mar 2025 16:32:23 +0000 (17:32 +0100)] 
qemu: monitor: Support FD passing of sockets to 'qemuMonitorJSONNBDServerStart'

Upcoming patches will extend the FD passing infrastructure to the backup
job so that users can pass an opened socket instead of qemu opening it
themself to bypass difficulities caused by containerizing libvirt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agovirStorageNetHostDefClear: Move into virStorageNetHostDefFree
Peter Krempa [Tue, 25 Mar 2025 16:27:19 +0000 (17:27 +0100)] 
virStorageNetHostDefClear: Move into virStorageNetHostDefFree

There are no other callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoconf: Introduce VIR_STORAGE_NET_HOST_TRANS_FD
Peter Krempa [Tue, 25 Mar 2025 16:17:11 +0000 (17:17 +0100)] 
conf: Introduce VIR_STORAGE_NET_HOST_TRANS_FD

Prepare the parser code and anything using 'virStorageNetHostTransport'
to support passing a FD instead of opening the connection by qemu
itself.

For now this just prepares the parser and data structures, but the code
is dormant.

Only code paths which will actually support FD passing will then enable
it in the future.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Spellchecked-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agovirDomainStorageNetworkParseHost: Refactor cleanup
Peter Krempa [Tue, 25 Mar 2025 14:18:40 +0000 (15:18 +0100)] 
virDomainStorageNetworkParseHost: Refactor cleanup

Use a 'switch' statement instead of a bunch of if statements to do
validation and selection what to parse.

Remove the pre-clearing of the struct as we always allocate cleared
memory for it and we can reorder assignments to avoid the need for
cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agovirDomainStorageNetworkParseHost: Remove unpopulated 'transport' variable
Peter Krempa [Tue, 25 Mar 2025 13:51:25 +0000 (14:51 +0100)] 
virDomainStorageNetworkParseHost: Remove unpopulated 'transport' variable

Since the refactor to use proper enum type for the network transport the
'transport' variable is no longer filled. Remove it and fix the error
message which references it without using NULLSTR.

Fixes: 452695926dc
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agovirDomainDiskDefValidateSourceChainOne: Fix validation of 'data-file' nesting
Peter Krempa [Fri, 28 Mar 2025 07:26:17 +0000 (08:26 +0100)] 
virDomainDiskDefValidateSourceChainOne: Fix validation of 'data-file' nesting

As the 'dataStore' is internally represented as a virStorageSource
object it has provisions for nesting which is not supported.

When I've reviewed and modified the commit adding data file parsing
support I've added code that was supposed to reject any 'backingStore'
and 'dataStore' structures nested in a source of a 'dataStore'.

Unfortunately the check was broken as one of the terms checked the
presence of parent's 'backingStore' instead of the nesting.

Fix it and add tests.

Fixes: b3171cf8da3
Resolves: https://issues.redhat.com/browse/RHEL-85320
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoesxConnectListAllDomains: Don't propagate failure to lookup a single domain
Peter Krempa [Tue, 25 Mar 2025 06:23:01 +0000 (07:23 +0100)] 
esxConnectListAllDomains: Don't propagate failure to lookup a single domain

In esxConnectListAllDomains if the lookup of the VM name and UUID fails
for a single VM (possible e.g. with broken storage) the whole API would
return failure even when there are working VMs.

Rework the lookup so that if a subset fails we ignore the failure on
those. We report an error only if lookup of all of the objects failed.
Failure is reported from the last one.

Resolves: https://issues.redhat.com/browse/RHEL-80606
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agonews: document dropping apparmor < 3.0.0
Daniel P. Berrangé [Tue, 1 Apr 2025 11:35:40 +0000 (12:35 +0100)] 
news: document dropping apparmor < 3.0.0

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agomeson: drop remaining checks for apparmor version
Daniel P. Berrangé [Mon, 31 Mar 2025 10:43:33 +0000 (11:43 +0100)] 
meson: drop remaining checks for apparmor version

Now that we mandate version 3, any remaining conditional checks
in meson/source code can be removed.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agoRevert "apparmor: Allow version-specific bits in profiles"
Daniel P. Berrangé [Mon, 31 Mar 2025 10:42:43 +0000 (11:42 +0100)] 
Revert "apparmor: Allow version-specific bits in profiles"

This reverts commit 19eb8abc9a4d15190852d644b773a2348f11c9da.

There is no longer any need to dynamically generate version specific
rules. This revert can be reverted, if the need ever arises again
in the future.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agoRevert "apparmor: Allow version-specific bits in abstractions too"
Daniel P. Berrangé [Mon, 31 Mar 2025 10:53:40 +0000 (11:53 +0100)] 
Revert "apparmor: Allow version-specific bits in abstractions too"

This reverts commit 63a312fa2d3be0e34a8989deddd39792fc9badf6.

There is no longer any need to dynamically generate version specific
rules. This revert can be reverted, if the need ever arises again
in the future.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agoapparmor: assume at least apparmor >= 3
Daniel P. Berrangé [Mon, 31 Mar 2025 10:41:10 +0000 (11:41 +0100)] 
apparmor: assume at least apparmor >= 3

By assuming version 3, we can drop all the conditional version
substitutions from the profiles.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agomeson: mandate apparmor >= 3.0.0
Daniel P. Berrangé [Mon, 31 Mar 2025 10:43:33 +0000 (11:43 +0100)] 
meson: mandate apparmor >= 3.0.0

We can now assume at least version three:

 * Debian 12: 3.0.8
 * openSUSE Leap 15.5: 3.0.4
 * openSUSE Leap 15.6: 3.1.7
 * Ubuntu 22.04: 3.0.4
 * Ubuntu 24.04: 4.0.0

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 months agoPost-release version bump to 11.3.0
Jiri Denemark [Tue, 1 Apr 2025 10:03:39 +0000 (12:03 +0200)] 
Post-release version bump to 11.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoRelease of libvirt-11.2.0 v11.2.0
Jiri Denemark [Tue, 1 Apr 2025 09:59:33 +0000 (11:59 +0200)] 
Release of libvirt-11.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoTranslated using Weblate (Korean)
김인수 [Sun, 30 Mar 2025 07:26:43 +0000 (07:26 +0000)] 
Translated using Weblate (Korean)

Currently translated at 98.6% (10775 of 10917 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
4 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Sun, 30 Mar 2025 07:26:42 +0000 (07:26 +0000)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.2% (5270 of 10917 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
4 months agoNEWS: qemu: support block disk along with throttle filters
Harikumar Rajkumar [Tue, 25 Mar 2025 10:57:25 +0000 (16:27 +0530)] 
NEWS: qemu: support block disk along with throttle filters

Signed-off-by: Harikumar Rajkumar <harirajkumar230@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 months agoNEWS: Document features/improvements/bug fixes I've participated in
Michal Privoznik [Fri, 28 Mar 2025 07:36:07 +0000 (08:36 +0100)] 
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>
4 months agoNEWS: Mention bump to qemu-6.2, vhost-user shmem check and stats params discoverabilty v11.2.0-rc2
Peter Krempa [Wed, 26 Mar 2025 09:12:06 +0000 (10:12 +0100)] 
NEWS: Mention bump to qemu-6.2, vhost-user shmem check and stats params discoverabilty

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 months agodoc: remove wrong comment
Philipp Schuster [Wed, 26 Mar 2025 12:51:41 +0000 (13:51 +0100)] 
doc: remove wrong comment

This comment is wrong as later qemuMigrationSrcRun() is called which
checks if TLS should be used and activated. QEMU has built-in support
for TLS, which this refers to.

The comment originates from a time when tunneled support was the only
way to get encryption.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
4 months agolib: virDomain{Save,Restore}Params: Ensure absolute path
Jim Fehlig [Mon, 29 Jul 2024 22:34:48 +0000 (16:34 -0600)] 
lib: virDomain{Save,Restore}Params: Ensure absolute path

When invoking virDomainSaveParams with a relative path, the image is
saved to the daemon's CWD. Similarly, when providing virDomainRestoreParams
with a relative path, it attempts to restore from the daemon's CWD. In most
configurations, the daemon's CWD is set to '/'. Ensure a relative path is
converted to absolute before invoking the driver domain{Save,Restore}Params
functions.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 months agoUpdate translation files
Weblate [Tue, 25 Mar 2025 11:29:11 +0000 (11:29 +0000)] 
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>
4 months agoqemu_driver: Fix virDomainSaveImageDefineXML
Pavel Hrdina [Mon, 24 Mar 2025 19:11:58 +0000 (20:11 +0100)] 
qemu_driver: Fix virDomainSaveImageDefineXML

Commit 28a06215280b99708ed8dc2d183f62ba7b34ccf8 added support to restore
sparse images but changed the boolean that controls if we open the file
as read-only or read-write. Editing XML in the save image resulted in
following error message:

    failed to write header to domain save file '/data/images/fedora40.save': Bad file descriptor

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agopo: Refresh potfile for v11.2.0 v11.2.0-rc1
Jiri Denemark [Tue, 25 Mar 2025 11:23:31 +0000 (12:23 +0100)] 
po: Refresh potfile for v11.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoqemu: Emit NIC_MAC_CHANGE event
Michal Privoznik [Tue, 27 Jun 2023 11:32:55 +0000 (13:32 +0200)] 
qemu: Emit NIC_MAC_CHANGE event

So far, we only process NIC_RX_FILTER_CHANGED event when the
corresponding device has 'trustGuestRxFilters' enabled. And the
event is emitted only for virtio model. IOW, this is fairly
limited situation and other scenarios don't emit any event (e.g.
change of MAC address on a PCI passthrough device).

Resolves: https://issues.redhat.com/browse/RHEL-7035
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 months agoIntroduce NIC_MAC_CHANGE event
Michal Privoznik [Tue, 27 Jun 2023 08:13:51 +0000 (10:13 +0200)] 
Introduce NIC_MAC_CHANGE event

The aim off this event is to notify management application that
guest changed MAC address on one of its vNICs so the app can
update its internal records, e.g. for finding match between
guest/host view of vNICs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 months agoqemu: Reflect MAC address change in live domain XML
Michal Privoznik [Tue, 27 Jun 2023 15:13:33 +0000 (17:13 +0200)] 
qemu: Reflect MAC address change in live domain XML

If a guest changes MAC address on its vNIC, then QEMU emits
NIC_RX_FILTER_CHANGED event (the event is emitted in other cases
too, but that's not important right now). Now, domain XML allows
users to chose whether to trust these events or not:

  <interface trustGuestRxFilters='yes|no'/>

For the 'no' case no action is performed and the event is
ignored. But for the 'yes' case, some host side features of
corresponding vNIC (well tap/macvtap device) are tweaked to
reflect changed MAC address. But what is missing is reflecting
this new MAC address in domain XML.

Basically, what happens is: the host sees traffic with new MAC
address, all tools inside the guest see the new MAC address
(including 'virsh domifaddr --source agent') which makes it
harder to match device in the guest with the one in the domain
XML.

Therefore, report this new MAC address as another attribute of
the <mac/> element:

  <mac address="52:54:00:a4:6f:91" currentAddress="00:11:22:33:44:55"/>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 months agoNEWS: Mention virsh hypervisor-cpu-models command
Boris Fiuczynski [Tue, 25 Mar 2025 10:29:57 +0000 (11:29 +0100)] 
NEWS: Mention virsh hypervisor-cpu-models command

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Mon, 24 Mar 2025 16:13:03 +0000 (16:13 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 52.6% (5708 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>
4 months agoNEWS: Mention guest agent error code improvements
Peter Krempa [Thu, 20 Mar 2025 15:38:41 +0000 (16:38 +0100)] 
NEWS: Mention guest agent error code improvements

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemuAgentCheckError: Rewort error if neither return nor error is found
Peter Krempa [Thu, 20 Mar 2025 15:17:54 +0000 (16:17 +0100)] 
qemuAgentCheckError: Rewort error if neither return nor error is found

Disambiguate the case from other types of error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemuAgentCheckError: Use 'VIR_ERR_AGENT_COMMAND_FAILED'
Peter Krempa [Thu, 20 Mar 2025 15:17:23 +0000 (16:17 +0100)] 
qemuAgentCheckError: Use 'VIR_ERR_AGENT_COMMAND_FAILED'

In the two cases when we know that the command returned failure switch
to the new error code so that management applications can
programatically detect failure of the guest agent command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agolib: error: Introduce 'VIR_ERR_AGENT_COMMAND_FAILED'
Peter Krempa [Thu, 20 Mar 2025 15:10:18 +0000 (16:10 +0100)] 
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_FAILED'

Add a special error code for when the guest agent returned a failure
message.

Allow management applications to deterministically detect failure of the
guest agent command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agodocs: Point to VIR_ERR_AGENT_COMMAND_TIMEOUT when setting timeout
Peter Krempa [Thu, 20 Mar 2025 14:44:35 +0000 (15:44 +0100)] 
docs: Point to VIR_ERR_AGENT_COMMAND_TIMEOUT when setting timeout

In addition to the error constant appearing add docs hinting that this
new error code can be produced on timeouts.

The most relevant place is to do it when setting the timeout.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemuAgentCommandFull: Use VIR_ERR_AGENT_COMMAND_TIMEOUT when agent disappears
Peter Krempa [Thu, 20 Mar 2025 15:07:32 +0000 (16:07 +0100)] 
qemuAgentCommandFull: Use VIR_ERR_AGENT_COMMAND_TIMEOUT when agent disappears

When the agent disappears after geting a proper command we ought to
report the same error code as if we timed out as it's uncertain whether
the guest agent did anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoqemu: agent: Differentiate timeouts when syncing from command timeout
Peter Krempa [Thu, 20 Mar 2025 14:17:11 +0000 (15:17 +0100)] 
qemu: agent: Differentiate timeouts when syncing from command timeout

As the guest agent code uses timeouts it is possible that we stop
waiting before the guest agent replies. If this happens while syncing
everything is okay because we didn't send any state-changing command.

In case when the timeout happens after a real command was transmitted
it's unknown if the guest-agent processed it or not.

Use the new special error code VIR_ERR_AGENT_COMMAND_TIMEOUT for cases
when we sent non-sync commands, so that the management applications or
users have possibility to react to this situation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agolib: error: Introduce 'VIR_ERR_AGENT_COMMAND_TIMEOUT'
Peter Krempa [Thu, 20 Mar 2025 14:27:13 +0000 (15:27 +0100)] 
lib: error: Introduce 'VIR_ERR_AGENT_COMMAND_TIMEOUT'

Introduce a new special error code for guest agent commands.

The error code will be specifically reported only when an actual command
(not a sync) was issued to the guest agent and the timeout time was
reached.

This will allow users and management applications to differentiate
between the cases when the sync timed out and thus there's no risk in
the agent actually having executed the command and when the actual
command was sent.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 months agoNEWS: fix one more typo
Ján Tomko [Fri, 21 Mar 2025 15:27:58 +0000 (16:27 +0100)] 
NEWS: fix one more typo

s/ an / a /

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Jiri Denemark <jdenemar@redhat.com>
4 months agoNEWS: hotplug virtio-mem device
Boris Fiuczynski [Fri, 21 Mar 2025 07:18:31 +0000 (08:18 +0100)] 
NEWS: hotplug virtio-mem device

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 months agoTranslated using Weblate (Chinese (Traditional) (zh_TW))
hsu zangmen [Thu, 20 Mar 2025 05:28:24 +0000 (05:28 +0000)] 
Translated using Weblate (Chinese (Traditional) (zh_TW))

Currently translated at 2.4% (264 of 10838 strings)

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

Signed-off-by: hsu zangmen <chzang55@gmail.com>
4 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Thu, 20 Mar 2025 05:28:23 +0000 (05:28 +0000)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.5% (5262 of 10838 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
4 months agoTranslated using Weblate (Russian)
Sergey A [Thu, 20 Mar 2025 05:28:23 +0000 (05:28 +0000)] 
Translated using Weblate (Russian)

Currently translated at 83.8% (9086 of 10838 strings)

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

Signed-off-by: "Sergey A." <Ser82-png@yandex.ru>
4 months agoNEWS: Mention support for mapped-ram
Jim Fehlig via Devel [Thu, 20 Mar 2025 23:25:43 +0000 (17:25 -0600)] 
NEWS: Mention support for mapped-ram

Add a 'New features' entry for mapped-ram itself, and another
for the parallel save/restore feature built on top.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 months agoqemu: Fix build on 32-bit platforms
Jim Fehlig via Devel [Thu, 20 Mar 2025 22:17:00 +0000 (16:17 -0600)] 
qemu: Fix build on 32-bit platforms

Commits c2518f7bc7 and 28a0621528 introduced build failures on 32-bit
platforms by using incorrect format specifiers with g_strdup_printf.

In one case, an 'unsigned long' format specifier is used with a
'long long int' variable. Fix by changing the format specifier to
'uintmax_t', and casting the variable likewise.

In a second case, an 'unsigned long' format specifier is used with a
'size_t' variable, which is 'unsigned int' on 32-bit systems. Fix by
changing the format specifier to use the 'z' modifier.

Fixes: c2518f7bc7dd4f8ab8655a12ec3a000e1eb5b232
Fixes: 28a06215280b99708ed8dc2d183f62ba7b34ccf8
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 months agovirsh: add --image-format option to the save command
Pavel Hrdina [Thu, 20 Mar 2025 22:34:44 +0000 (23:34 +0100)] 
virsh: add --image-format option to the save command

Option --parallel-channels would require changing configuration file to
be used so introduce this option as well to make it convenient for
users.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agotools: use virDomainSaveParams only when necessary
Pavel Hrdina [Thu, 20 Mar 2025 22:32:17 +0000 (23:32 +0100)] 
tools: use virDomainSaveParams only when necessary

We should use the newest API only when user sets parallel-channels.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agotools: use virDomainRestoreParams only when necessary
Pavel Hrdina [Thu, 20 Mar 2025 22:43:59 +0000 (23:43 +0100)] 
tools: use virDomainRestoreParams only when necessary

We should use the newest API only when user sets parallel-channels.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agoqemu: remove VIR_DOMAIN_SAVE_PARALLEL flag
Pavel Hrdina [Thu, 20 Mar 2025 22:42:05 +0000 (23:42 +0100)] 
qemu: remove VIR_DOMAIN_SAVE_PARALLEL flag

There is no need to use extra flag in addition to the new
"parallel.channels" param.

Using the flag without param would result in using uninitialized
variable. Fixing it would result in error that parallel channels cannot
be less then 1 or setting 1 as default.

Using the param without the flag is ignored.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 months agotools: remote --parallel from virsh save command
Pavel Hrdina [Thu, 20 Mar 2025 22:17:11 +0000 (23:17 +0100)] 
tools: remote --parallel from virsh save command

There is no need to have --parallel and --parallel-channels especially
when --parallel on its own is the same as not used at all. In both cases
libvirt will default to single channel.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>