]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
5 months agoRelease of libvirt-11.3.0 v11.3.0
Jiri Denemark [Fri, 2 May 2025 07:25:45 +0000 (09:25 +0200)] 
Release of libvirt-11.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoTranslated using Weblate (Romanian)
Remus-Gabriel Chelu [Thu, 1 May 2025 09:25:07 +0000 (09:25 +0000)] 
Translated using Weblate (Romanian)

Currently translated at 35.4% (3875 of 10918 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
5 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 1 May 2025 09:25:07 +0000 (09:25 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 53.4% (5834 of 10918 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
5 months agoTranslated using Weblate (Romanian) v11.3.0-rc2
Remus-Gabriel Chelu [Tue, 29 Apr 2025 09:08:35 +0000 (09:08 +0000)] 
Translated using Weblate (Romanian)

Currently translated at 33.2% (3630 of 10918 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
5 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 29 Apr 2025 09:08:35 +0000 (09:08 +0000)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10918 of 10918 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
5 months agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
QiangWei Zhang [Tue, 29 Apr 2025 09:08:34 +0000 (09:08 +0000)] 
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 92.1% (10066 of 10918 strings)

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

Signed-off-by: QiangWei Zhang <zhang.qiangwei@zte.com.cn>
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 92.1% (10065 of 10918 strings)

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

Signed-off-by: QiangWei Zhang <zhang.qiangwei@zte.com.cn>
5 months agoUpdate translation files
Weblate [Tue, 29 Apr 2025 09:08:33 +0000 (09:08 +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>
5 months agoscripts: Fix reading list of files in mock-noinline.py
Michal Privoznik [Mon, 28 Apr 2025 11:37:43 +0000 (13:37 +0200)] 
scripts: Fix reading list of files in mock-noinline.py

The mock-noinline.py script is fed list of files through its
stdin, each file on its own line. Unfortunately, the way the
script is written does nothing as the trailing newline character
prevents any .endswith() match. Strip each line of white spaces.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 months agoutil: Add missing G_NO_INLINE annotation
Michal Privoznik [Mon, 28 Apr 2025 11:36:45 +0000 (13:36 +0200)] 
util: Add missing G_NO_INLINE annotation

There are two functions that are mocked, but are missing required
G_NO_INLINE attribute: virFirewallDIsRegistered() and
virHostCPUGetPhysAddrSize(). Add it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 months agopo: Refresh potfile for v11.3.0 v11.3.0-rc1
Jiri Denemark [Mon, 28 Apr 2025 08:44:55 +0000 (10:44 +0200)] 
po: Refresh potfile for v11.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoTranslated using Weblate (Finnish)
Ricky Tigg [Tue, 15 Apr 2025 09:30:37 +0000 (09:30 +0000)] 
Translated using Weblate (Finnish)

Currently translated at 21.8% (2381 of 10917 strings)

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

Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
5 months agoTranslated using Weblate (Georgian)
Weblate [Tue, 15 Apr 2025 09:30:37 +0000 (09:30 +0000)] 
Translated using Weblate (Georgian)

Currently translated at 4.2% (464 of 10917 strings)

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

Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
5 months agoTranslated using Weblate (Korean)
김인수 [Tue, 15 Apr 2025 09:30:36 +0000 (09:30 +0000)] 
Translated using Weblate (Korean)

Currently translated at 100.0% (10917 of 10917 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.5% (10873 of 10917 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.3% (10850 of 10917 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.7% (10785 of 10917 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.7% (10781 of 10917 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
5 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Tue, 15 Apr 2025 09:30:36 +0000 (09:30 +0000)] 
Translated using Weblate (Spanish)

Currently translated at 53.2% (5808 of 10917 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.9% (5780 of 10917 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.7% (5759 of 10917 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
5 months agoremote: expand some debug messages for socket detection
Daniel P. Berrangé [Thu, 17 Apr 2025 17:05:44 +0000 (18:05 +0100)] 
remote: expand some debug messages for socket detection

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agokbase: update docs to account for changed error message
Daniel P. Berrangé [Thu, 17 Apr 2025 17:09:03 +0000 (18:09 +0100)] 
kbase: update docs to account for changed error message

The updated doc refers to both the old and new error message, as users
with old deployed versions will still be pointed to the current online
docs URL.

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoremote: improve error message when no URI is set
Daniel P. Berrangé [Thu, 17 Apr 2025 17:06:02 +0000 (18:06 +0100)] 
remote: improve error message when no URI is set

When no URI is set we try to guess what daemon to connect to by looking
for any listening sockets. If there are no listening sockets, however,
we don't even know what daemon the user expected to connect to. The
error message in this case is not especially clear

This tweaks the error message to try to make the problem easier to
understand.

Resolves: https://issues.redhat.com/browse/RHEL-87177
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemucapabilitiestest: Final update for qemu-10.0 release on x86_64 of the 'amdsev...
Peter Krempa [Tue, 22 Apr 2025 19:14:07 +0000 (21:14 +0200)] 
qemucapabilitiestest: Final update for qemu-10.0 release on x86_64 of the 'amdsev' variant

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemucapabilitiestest: Final update for qemu-10.0 release on x86_64
Peter Krempa [Thu, 20 Mar 2025 16:28:44 +0000 (17:28 +0100)] 
qemucapabilitiestest: Final update for qemu-10.0 release on x86_64

Update the data after the release.

Notable changes:
 - the 7.0 machine types became deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agorpm: Enable KVM for riscv64 on RHEL 10+
Andrea Bolognani [Fri, 14 Mar 2025 09:44:36 +0000 (10:44 +0100)] 
rpm: Enable KVM for riscv64 on RHEL 10+

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemu_rdp: Fix a typo existance -> existence
Martin Kletzander [Wed, 16 Apr 2025 08:04:34 +0000 (10:04 +0200)] 
qemu_rdp: Fix a typo existance -> existence

Fixes: bd473480b443aa2561236dfd903535aa778d99a8
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agopython: Do not explicitly state variables are global when only read
Martin Kletzander [Wed, 16 Apr 2025 07:59:44 +0000 (09:59 +0200)] 
python: Do not explicitly state variables are global when only read

If a variable is not modified in a scope there is no need for the use of
global in such scope.  Without this patch build fails with:

F824 `global ...` is unused: name is never assigned in scope

It is a bit difficult to find more information on that message and error
code, I found it here:

    https://docs.astral.sh/ruff/rules/global-variable-not-assigned/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agonwfilter: Fix erroneous pointer passing to g_clear_pointer
Martin Kletzander [Wed, 16 Apr 2025 07:38:53 +0000 (09:38 +0200)] 
nwfilter: Fix erroneous pointer passing to g_clear_pointer

Commit 5de27c32a18f wanted to fix a possible double free, but by mistake
did not pass a reference to the variable.  This made virtnwfilterd
coredump in our daily CI build.

Fixes: 5de27c32a18f1da4969a679a2385d45cf0279699
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agovirbitmap: Change return type of virBitmapToData to void
Alexander Kuznetsov [Wed, 26 Mar 2025 11:58:02 +0000 (14:58 +0300)] 
virbitmap: Change return type of virBitmapToData to void

This function return value is invariant since e59b8f9, so change
its type and remove all dependent checks.

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

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agodocs: formatdomain: Metion virtio model for currentAddress
Han Han [Mon, 14 Apr 2025 06:04:34 +0000 (14:04 +0800)] 
docs: formatdomain: Metion virtio model for currentAddress

As commit 50981052a5 mentioned, the currentAddress in live domain
XML, requires virtio model as well.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agobhyve: use const virDomainDef pointer in bhyveBuildNetArgStr()
Roman Bogorodskiy [Sun, 13 Apr 2025 05:13:51 +0000 (07:13 +0200)] 
bhyve: use const virDomainDef pointer in bhyveBuildNetArgStr()

As virDomainNet* functions were converted to use const virDomainDef
pointers, update bhyveBuildNetArgStr() as well, like it was before it was
changed in e1e40b5035.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoconf: use const virDomainDef pointers
Roman Bogorodskiy [Thu, 10 Apr 2025 14:12:43 +0000 (16:12 +0200)] 
conf: use const virDomainDef pointers

Some virDomainNet* functions use virDomainDef pointers even though they
don't modify the domain config, so switch to const pointers there.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agonss: Fix memory leak in findLease()
Alexander Kuznetsov [Tue, 15 Apr 2025 11:48:38 +0000 (14:48 +0300)] 
nss: Fix memory leak in findLease()

path is allocated by asprintf() and must be freed later if realloc() fails.

Restructure the code to allocate path only after realloc() succeeds,
avoiding the need for an extra free().

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

Reported-by: Dmitry Fedin <d.fedin@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonwfilter: Avoid possible double free in virNWFilterInstReset()
Alexander Kuznetsov [Mon, 14 Apr 2025 13:51:34 +0000 (16:51 +0300)] 
nwfilter: Avoid possible double free in virNWFilterInstReset()

virNWFilterInstReset() may be called multiple times, leading to a double g_free()
Replace plain g_free() with g_clear_pointer() to prevent this

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

Reported-by: Dmitry Fedin <d.fedin@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agovirsh: prevent potential NULL dereference
Alexander Kuznetsov [Mon, 14 Apr 2025 13:32:10 +0000 (16:32 +0300)] 
virsh: prevent potential NULL dereference

virXPathString() can return NULL so we need to use STRNEQ_NULLABLE here

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

Reported-by: Dmitry Fedin <d.fedin@fobos-nt.ru>
Signed-off-by: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agobhyve: capabilities: advertise RNG device support
Roman Bogorodskiy [Mon, 14 Apr 2025 16:34:40 +0000 (18:34 +0200)] 
bhyve: capabilities: advertise RNG device support

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agodocs: drvbhyve: document virtio-rnd support
Roman Bogorodskiy [Fri, 11 Apr 2025 18:47:03 +0000 (20:47 +0200)] 
docs: drvbhyve: document virtio-rnd support

 - Document the virtio random number generator device support
 - While here, remove mention of the specific FreeBSD version such as
   10-STABLE, and just refer to the latest supported release.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoNEWS: bhyve: document new features
Roman Bogorodskiy [Fri, 11 Apr 2025 18:43:58 +0000 (20:43 +0200)] 
NEWS: bhyve: document new features

Document the virtio random number generator device support
and <interface type='network'> support.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agovsh: Turn _vshControl::progname into a const string
Michal Privoznik [Fri, 11 Apr 2025 14:40:41 +0000 (16:40 +0200)] 
vsh: Turn _vshControl::progname into a const string

The aim of the progname member of the _vshControl struct is to
point to argv[0] which is then used in vshOutputLogFile() to
create a prefix for a log message. But the member is never
modified (nor it should be) and thus can be a const char *.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agovsh: Free commands in vshDeinit()
Michal Privoznik [Fri, 11 Apr 2025 14:34:50 +0000 (16:34 +0200)] 
vsh: Free commands in vshDeinit()

Whether virsh/virt-admin is running in interactive or
non-interactive mode, vshControl::cmd contains the batch of last
executed commands as a linked list. Just look into
vshCommandParse(). Free the linked list in vshDeinit() to avoid
memleak.

  3,312 bytes in 3 blocks are still reachable in loss record 572 of 577
     at 0x484CEF3: calloc (vg_replace_malloc.c:1675)
     by 0x506AB29: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.8200.5)
     by 0x1B74B8: vshCmdNew (vsh.c:1466)
     by 0x1B7A80: vshCommandParse (vsh.c:1615)
     by 0x1B8458: vshCommandStringParse (vsh.c:1874)
     by 0x1419C1: virshParseArgv (virsh.c:773)
     by 0x141D11: main (virsh.c:879)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoNEWS: Mention fix of crash on disk hotplug failure
Peter Krempa [Fri, 11 Apr 2025 11:57:03 +0000 (13:57 +0200)] 
NEWS: Mention fix of crash on disk hotplug failure

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemuDomainAttachDiskGeneric: Report errors from 'qemuBuildThrottleFiltersAttachPrepar...
Peter Krempa [Fri, 11 Apr 2025 11:42:37 +0000 (13:42 +0200)] 
qemuDomainAttachDiskGeneric: Report errors from 'qemuBuildThrottleFiltersAttachPrepareBlockdev'

'qemuBuildThrottleFiltersAttachPrepareBlockdev' can fail when
constructing JSON props, but otherwise always retruns a pointer even if
there's nothing to do.

The code in 'qemuDomainAttachDiskGeneric' didn't handle this properly as
it considered NULL as "nothing to do". Return the failure instead and
check if tere's something to do by looking at 'nfilterdata'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: block: Don't crash if qemuBlockThrottleFiltersDetach gets NULL @data
Peter Krempa [Fri, 11 Apr 2025 11:39:06 +0000 (13:39 +0200)] 
qemu: block: Don't crash if qemuBlockThrottleFiltersDetach gets NULL @data

'qemuBlockThrottleFiltersDetach' crashes if @data is NULL. That can
happen in 'qemuDomainAttachDiskGeneric' as it's used as a rollback path
in cases when we didn't yet initialize the filter struct.

Fix it by tolerating NULL @data.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/765
Fixes: 9a6560f066d1e65502d901f32ff2e91ffed3b209
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: make passt+vhostuser reconnect behave identically to passt+user
Laine Stump [Fri, 4 Apr 2025 23:44:52 +0000 (19:44 -0400)] 
qemu: make passt+vhostuser reconnect behave identically to passt+user

When "original passt" support was added, we decided that we always
wanted to reconnect (i.e. restart the passt process) if it was somehow
terminated. Generic vhost-user, on the other hand, only turns on
reconnect if specified by the user in the config. But there is no
reason to require the user to specify this if the other end of the
vhost-user socket is a passt process - we know what has happened and
what we want to do; no reason to do the *wrong* thing by default, and
force the user to make an arbitrary decision about what to add to the
config in order to make it do the *right* thing; instead we just
hardcode it to always do the right thing.

(NB: when the backend is passt, <interface type='vhostuser'> has
always ignored the reconnect setting in <source> when parsing and
formatting, just as it has always ignored the socket path (since that
also is not user configurable for the passt backend)

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

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: put vhost-user code that's special for passt in a helper function
Laine Stump [Fri, 4 Apr 2025 23:38:28 +0000 (19:38 -0400)] 
qemu: put vhost-user code that's special for passt in a helper function

Rather than duplicating these two lines of chr device object setup for
hotplug and domain start, put them in a helper function that's called
from both places. That way when we need to setup *more* stuff specific
to passt+vhostuser, we can just add it in that one place.

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: respond to NETDEV_VHOST_USER_DISCONNECTED event
Laine Stump [Fri, 4 Apr 2025 21:16:43 +0000 (17:16 -0400)] 
qemu: respond to NETDEV_VHOST_USER_DISCONNECTED event

This response to this event is identical to NETDEV_STREAM_DISCONNECTED
(start a new passt process to replace the one that just disappeared -
see commitf62ce81b8a5), except that the new passt process will have
"--vhost-user" appended to the commandline. Fortunately that
difference is already handled based on the virDomainNetDef contents,
so we can, in fact, respond to the new event in exactly the same
manner.

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: make processNetDevStreamDisconnectedEvent() reusable
Laine Stump [Fri, 4 Apr 2025 20:57:21 +0000 (16:57 -0400)] 
qemu: make processNetDevStreamDisconnectedEvent() reusable

We will be adding a new event whose response will be *exactly* the
same as the response to NETDEV_STREAM_DISCONNECTED. Rather than doing
a copy-paste of the complete function that does the processing, turn
that function into something more generic that takes the name of the
event as an arg (the event name is only used in log messages).

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent()
Laine Stump [Fri, 4 Apr 2025 20:48:23 +0000 (16:48 -0400)] 
qemu: remove nonsensical sanity check in processNetdevStreamDisconnectedEvent()

By definition QEMU will never send a NETDEV_STREAM_DISCONNECTED event
if it doesn't support the reconnect option for a stream netdev. And
even if, by some comedy of errors, it did send
NETDEV_STREAM_DISCONNECTED in that case, our response to the event
doesn't request anything at all of QEMU (much less something that
would fail if QEMU didn't understand NETDEV_STREAM_DISCONNECTED) - it
just starts a new passt process to replace the one that has been
terminated, so we don't need to check the QEMU capabilities for
QEMU_CAPS_NETDEV_STREAM_RECONNECT.

Signed-off-by: Laine Stump <laine@redhat.com>
Tested-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemuDomainBlockCopyCommon: Don't revoke access to file twice on failure
Peter Krempa [Thu, 10 Apr 2025 14:18:29 +0000 (16:18 +0200)] 
qemuDomainBlockCopyCommon: Don't revoke access to file twice on failure

If the copy job fails to start up when calling the 'blockdev-mirror'
command the code would call qemuDomainStorageSourceChainAccessRevoke()
twice; once right after the monitor call and the second time in the
'endjob' section.

Remove the one directly after the monitor call and let the common
cleanup handle it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemuDomainBlockCopyCommon: Reorder setup of 'mirror' data
Peter Krempa [Thu, 10 Apr 2025 13:26:14 +0000 (15:26 +0200)] 
qemuDomainBlockCopyCommon: Reorder setup of 'mirror' data

While exploring an idea that modified the setup of the mirror I've
noticed that the code setting up the 'discard' field in the block copy
job happens after setup of the storage source, while normally e.g. in
qemuDomainPrepareStorageSource() it happens before.

Reorder it despite not having an effect currently.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: domain: Unexport 'qemuDomainPrepareStorageSourceBlockdevNodename'
Peter Krempa [Wed, 9 Apr 2025 11:40:14 +0000 (13:40 +0200)] 
qemu: domain: Unexport 'qemuDomainPrepareStorageSourceBlockdevNodename'

The function is referenced only from within qemu_domain.c

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoch: fix double space in error message
Ján Tomko [Thu, 10 Apr 2025 14:42:43 +0000 (16:42 +0200)] 
ch: fix double space in error message

Make it match the errors in bhyve and QEMU drivers, where it was copied
from.

Fixes: 9d6e2d127e673642b0fb135b6d58539a8e332e08
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 months agobhyve: support interface type 'network'
Roman Bogorodskiy [Tue, 1 Apr 2025 17:32:34 +0000 (19:32 +0200)] 
bhyve: support interface type 'network'

Add support for interface type 'network'. While bridge remains the only
supported options for networks in bhyve, supporting interface type
'network' allows easier configuration and makes domain XMLs more
compatible with the other drivers.

While here, update the error message for the unsupported interface type
to print the requested network type string instead of an integer to make
it more user-friendly.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agobhyve: extend RNG device validation
Roman Bogorodskiy [Sun, 6 Apr 2025 14:29:55 +0000 (16:29 +0200)] 
bhyve: extend RNG device validation

Add a bunch of device def validation to catch unsupported RNG device
configurations early.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agobhyve: argv2xml: support virtio-rnd devices
Roman Bogorodskiy [Sun, 6 Apr 2025 13:34:18 +0000 (15:34 +0200)] 
bhyve: argv2xml: support virtio-rnd devices

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agobhyve: support random number generator device
Roman Bogorodskiy [Sun, 6 Apr 2025 09:59:18 +0000 (11:59 +0200)] 
bhyve: support random number generator device

Bhyve supports the Virtio RNG interface. It's always using the
/dev/random device and doesn't have any configuration options.

Thus, in XML it's represented as:

  <rng model='virtio'>
    <backend model='random'/>
  </rng>

So extend the bhyve driver to support that and add a set of tests for
this feature.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: Properly propagate migration state to TPM cleanup code
Jiri Denemark [Wed, 9 Apr 2025 13:35:20 +0000 (15:35 +0200)] 
qemu: Properly propagate migration state to TPM cleanup code

When migrating a domain with TPM state on a shared disk, we need to skip
TPM cleanup on both ends. So far the code only handled successful
migration and skipped the cleanup on the source host. But if the
migration failed for some reason, the cleanup would be incorrectly
called on the destination host removing the TPM files even though the
domain was still running on the source host.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: Rename outgoingMigration parameter in various TPM functions
Jiri Denemark [Tue, 11 Mar 2025 09:05:28 +0000 (10:05 +0100)] 
qemu: Rename outgoingMigration parameter in various TPM functions

The parameter is used to skip TPM state cleanup on outgoing migration
with shared storage. But we also need to skip the cleanup after a failed
incoming migration. Let's call the parameter "migration" to reflect its
usage on both sides of migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>