]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 months agonetwork: support setting firewalld zone for bridge device of open networks
Laine Stump [Tue, 3 Sep 2024 01:38:50 +0000 (21:38 -0400)]
network: support setting firewalld zone for bridge device of open networks

The bit of code that sets the firewalld zone was previously a part of
the function networkAddFirewallRules(), which is not called for
networks with <forward mode='open'/>.

Setting the 'libvirt' zone for the bridge device of virtual networks
that also add firewall rules is usually necessary in order to get the
expected traffic through without modifying firewalld's default zone
(which would be a bad idea, because that would affect all the other
host interfaces set to the default zone), but in general we would
*not* want the bridge device for a mode='open' virtual network to be
automatically placed in the "libvirt" zone. However, a user might want
to *explicitly* set some other firewalld zone for mode='open'
networks, and libvirt's network config is a convenient place to do
that.

We enable this by moving the code that sets the firewalld zone into a
separate function that is called for all forward modes that use a
bridge device created/managed by libvirt (nat, route, isolated,
open). If no zone is specified, then the bridge device will be in
whatever zone interfaces are put in by default, but if the <bridge>
element has a "zone" attribute, then the new bridge device will be
placed in the specified zone.

NB: This function is only called when the network is started, and
*not* when the firewall rules of an active network are reloaded at
virtnetworkd restart time, because the firewalld zone of an interface
isn't something that gets inadvertantly changed as a part of some
other unrelated action. For example all iptables rules are cleared by a
firewalld restart, including those rules added by libvirt, but there
is no blanket action that changes the zone of all interfaces, so it's
useful for libvirt to reload its rules when restarting virtnetworkd,
but pointless to re-add the interface to its preferred zone.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/215
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agonetwork: belatedly update an error message
Laine Stump [Tue, 3 Sep 2024 00:51:06 +0000 (20:51 -0400)]
network: belatedly update an error message

The 'open' forward type probably hadn't yet been added when this
message was written.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agonetwork: permit <forward mode='open'/> when a network has no IP address
Laine Stump [Mon, 2 Sep 2024 20:13:08 +0000 (16:13 -0400)]
network: permit <forward mode='open'/> when a network has no IP address

The whole point of <forward mode='open'/> is to supress libvirt from
adding any firewall rules for a network, and someone might want to
create a network with no IP address (i.e. they don't want the guests
to have connectivity to the host via this interface) and no firewall
rules (they don't want any, or they want to add their own). So there's
no reason to fail when a network has <forward mode='open'/> and also
has no IP address.

Kind-of-Resolves: https://gitlab.com/libvirt/libvirt/-/issues/588
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agonetwork: Remove unused variable in networkDestroy
Martin Kletzander [Tue, 17 Sep 2024 08:43:18 +0000 (10:43 +0200)]
network: Remove unused variable in networkDestroy

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 months agonetwork: Clean up after disappeared transient inactive networks
Martin Kletzander [Tue, 3 Sep 2024 11:07:30 +0000 (13:07 +0200)]
network: Clean up after disappeared transient inactive networks

If a network disappeared the daemon should not only remove it from the
list of networks, but also do a proper cleanup.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Separate cleanup from networkRemoveInactive
Martin Kletzander [Tue, 3 Sep 2024 12:59:50 +0000 (14:59 +0200)]
network: Separate cleanup from networkRemoveInactive

The new function (networkCleanupInactive) can be called from an iterator
over the list of networks without the risk of deadlock.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Try to read dnsmasq PIDs for inactive networks too
Martin Kletzander [Tue, 3 Sep 2024 07:07:54 +0000 (09:07 +0200)]
network: Try to read dnsmasq PIDs for inactive networks too

Just in case one needs a clean up.

Resolves: https://issues.redhat.com/browse/RHEL-50968
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Clean up after inactive objects during start
Martin Kletzander [Tue, 3 Sep 2024 13:56:56 +0000 (15:56 +0200)]
network: Clean up after inactive objects during start

Once networkUpdateState() identifies a dead network it should clean up
after it as well.

Resolves: https://issues.redhat.com/browse/RHEL-50968
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Don't check if network is active in networkShutdownNetwork
Martin Kletzander [Mon, 2 Sep 2024 07:33:05 +0000 (09:33 +0200)]
network: Don't check if network is active in networkShutdownNetwork

It skips the cleanup from networkStartNetwork and the only other path
already checks if the network is active or not.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Move port deletion into the shutdown function
Martin Kletzander [Mon, 2 Sep 2024 07:30:29 +0000 (09:30 +0200)]
network: Move port deletion into the shutdown function

It will be more useful in there when calling from new places.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Do not call virNetworkObjUnsetDefTransient on start cleanup
Martin Kletzander [Mon, 2 Sep 2024 07:26:54 +0000 (09:26 +0200)]
network: Do not call virNetworkObjUnsetDefTransient on start cleanup

The function networkShutdownNetwork already does that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agonetwork: Do not update network ports for inactive networks
Martin Kletzander [Tue, 3 Sep 2024 08:34:55 +0000 (10:34 +0200)]
network: Do not update network ports for inactive networks

The semantic does not change since inside networkUpdatePort() (well,
networkNotifyPort, for which the former is a wrapper) exits for inactive
networks, but with an error we can easily avoid with this patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agotests: Fix typo in README.rst of qemucapabilitiesdata
Boris Fiuczynski [Mon, 16 Sep 2024 14:57:04 +0000 (16:57 +0200)]
tests: Fix typo in README.rst of qemucapabilitiesdata

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 months agoapparmor: Don't check for existence of templates upfront
Andrea Bolognani [Mon, 16 Sep 2024 14:39:11 +0000 (16:39 +0200)]
apparmor: Don't check for existence of templates upfront

Currently, if either template is missing AppArmor support is
completely disabled. This means that uninstalling the LXC
driver from a system results in QEMU domains being started
without AppArmor confinement, which obviously doesn't make any
sense.

The problematic scenario was impossible to hit in Debian until
very recently, because all AppArmor files were shipped as part
of the same package; now that the Debian package is much closer
to the Fedora one, and specifically ships the AppArmor files
together with the corresponding driver, it becomes trivial to
trigger it.

Drop the checks entirely. virt-aa-helper, which is responsible
for creating the per-domain profiles starting from the
driver-specific template, already fails if the latter is not
present, so they were always redundant.

https://bugs.debian.org/1081396

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 months agoresctrl: Do not rewrite default MB values for new allocations
Martin Kletzander [Mon, 16 Sep 2024 08:28:03 +0000 (10:28 +0200)]
resctrl: Do not rewrite default MB values for new allocations

The code did it "just in case" the allocation was not reset for new
subdirectories.  That might've happened in the past with CAT settings,
but checking it now it is properly reset to its maximum values for each
new CLOSID (Class of Service ID).

The advantage of this is that we do not rewrite the value with itself
which causes an issue with the current linux kernel and mba_MBps option
where the default is UINT_MAX (or (uint32_t) -1), but gets rounded up to
bandwidth granularity (10), overflows and small number (4) is set
instead.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoRevert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"
Michal Privoznik [Mon, 16 Sep 2024 08:29:40 +0000 (10:29 +0200)]
Revert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"

Unfortunately, devfs on FreeBSD (accessible via /dev/fd) exposes
only those FDs which can be represented as a file. To cite
manpage [1]:

  The files /dev/fd/0 through /dev/fd/# refer to file descriptors
  which can be accessed through the file system.

This means FDs representing pipes and/or unnamed sockets are not
visible by default. To expose all FDs a slightly different
filesystem must be mounted [2]:

  mount -t fdescfs none /dev/fd

Apparently, on my test machine fdescfs is mounted by default and
thus I haven't seen any problem. Only after aforementioned patch
was merged our CI started reporting problems. While we could try
to figure out whether correct FS is mounted, it's a needless
micro optimization. Just revert the code to the state it was
before I touched it.

1: https://man.freebsd.org/cgi/man.cgi?query=fd&sektion=4&manpath=freebsd-release-ports
2: https://man.freebsd.org/cgi/man.cgi?query=fdescfs&sektion=5&n=1

This reverts commit 308ec0fb2c77f4867179f00c628f05d1d784f370.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agovircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs
Michal Privoznik [Tue, 29 Aug 2023 06:49:27 +0000 (08:49 +0200)]
vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs

On BSD-like systems "/dev/fd" serves the same purpose as
"/proc/self/fd". And since procfs is usually not mounted, on such
systems we can use "/dev/fd" instead.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/518
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agovircommand: Make sysconf(_SC_OPEN_MAX) failure non-fatal
Michal Privoznik [Tue, 29 Aug 2023 07:22:09 +0000 (09:22 +0200)]
vircommand: Make sysconf(_SC_OPEN_MAX) failure non-fatal

The point of calling sysconf(_SC_OPEN_MAX) is to allocate big
enough bitmap so that subsequent call to
virCommandMassCloseGetFDsDir() can just set the bit instead of
expanding memory (this code runs in a forked off child and thus
using async-signal-unsafe functions like malloc() is a bit
tricky).

But on some systems the limit for opened FDs is virtually
non-existent (typically macOS Ventura started reporting EINVAL).

But with both glibc and musl using malloc() after fork() is safe.
And with sufficiently new glib too, as it's using malloc() with
newer releases instead of their own allocator.

Therefore, pick a sufficiently large value (glibc falls back to
256, [1], Darwin to 10240 [2] so 10240 should be good enough) to
fall back to and make the error non-fatal.

1: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/getdtsz.c;h=4c5a6208067d2f9eaaac6dba652702fb4af9b7e3;hb=HEAD
2  https://github.com/apple/darwin-xnu/blob/main/bsd/sys/syslimits.h#L104

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agovircommand: Isolate FD dir parsing into a separate function
Michal Privoznik [Tue, 29 Aug 2023 06:48:56 +0000 (08:48 +0200)]
vircommand: Isolate FD dir parsing into a separate function

So far, virCommandMassCloseGetFDsLinux() opens "/proc/self/fd",
iterates over it marking opened FDs in @fds bitmap. Well, we can
do the same on other systems (with altered path), like MacOS or
FreeBSD. Therefore, isolate dir iteration into a separate
function that accepts dir path as an argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agovircommand: Drop unused arguments from virCommandMassCloseGetFDs*()
Michal Privoznik [Mon, 28 Aug 2023 13:34:47 +0000 (15:34 +0200)]
vircommand: Drop unused arguments from virCommandMassCloseGetFDs*()

Both virCommandMassCloseGetFDsLinux() and
virCommandMassCloseGetFDsGeneric() take @cmd argument only to
mark it as unused. Drop it from both.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agotests: Add caps2xml and resctrl data from the wild
Martin Kletzander [Thu, 12 Sep 2024 12:02:57 +0000 (14:02 +0200)]
tests: Add caps2xml and resctrl data from the wild

Add tests for two new system dumps which show various configurations
that were fixed in the previous commits.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Use cache IDs instead of max_id/max_cache_id
Martin Kletzander [Wed, 11 Sep 2024 12:52:08 +0000 (14:52 +0200)]
resctrl: Use cache IDs instead of max_id/max_cache_id

It is not guaranteed for the cache IDs to be continuous, especially for
L3 caches.  Hence do not assume so and instead record the individual IDs
in a virBitmap.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Don't assume MBA availability in virResctrlAllocNewFromInfo
Martin Kletzander [Wed, 11 Sep 2024 13:06:04 +0000 (15:06 +0200)]
resctrl: Don't assume MBA availability in virResctrlAllocNewFromInfo

Weirdly, the existence of /sys/fs/resctrl/info/MB does not always mean
that MBA is available and used on the system.  Instead of assuming that
copy the values from the default (root) allocation.  This also makes it
nicer to use the proper values in case the system does not use
percentages or when the root allocation already limits the bandwidth.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agocapabilities: Also report L2 caches
Martin Kletzander [Thu, 12 Sep 2024 11:19:01 +0000 (13:19 +0200)]
capabilities: Also report L2 caches

Since some systems support control for L2 caches as well as L3 caches it
would be useful to report their configuration in capabilities.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Add virResctrlInfoPerTypeFree
Martin Kletzander [Thu, 12 Sep 2024 11:15:42 +0000 (13:15 +0200)]
resctrl: Add virResctrlInfoPerTypeFree

It will be easier to add more dynamic data later on.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Add virResctrlInfoMemBWFree
Martin Kletzander [Thu, 12 Sep 2024 11:14:02 +0000 (13:14 +0200)]
resctrl: Add virResctrlInfoMemBWFree

It will be easier to add more dynamic data later on

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Move virResctrlAllocCopyMemBW up in the file
Martin Kletzander [Wed, 11 Sep 2024 13:08:28 +0000 (15:08 +0200)]
resctrl: Move virResctrlAllocCopyMemBW up in the file

This way it can be used later in virResctrlAllocGetUnused().

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Relax the limit of maximum memory bandwidth allocation
Martin Kletzander [Tue, 10 Sep 2024 14:00:14 +0000 (16:00 +0200)]
resctrl: Relax the limit of maximum memory bandwidth allocation

The value 100 represented the percentage as it was originally done from
Intel in the Linux kernel and on their CPUs.  Since then the situation
changed and there is no error-prone way of figuring out the meaning of
the value in the current configuration, let alone its possible maximum.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agodocs: Document memory bandwidth allocation limits more clearly
Martin Kletzander [Tue, 10 Sep 2024 13:51:59 +0000 (15:51 +0200)]
docs: Document memory bandwidth allocation limits more clearly

The meaning of the values as well as their maximums are hard to predict
and accounting for all the possibilities (which by the way might change
during daemon's execution) is borderline hallucinatory.  There is
already a way we represent them, which is the same as the Linux kernel.
We do not interpret them at all, just blindly use them.  In order to
make this more apparent for the users change the documentation for the
<memorytune/> (not <memtune/>) element more boldly.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoresctrl: Account for memory bandwidth of 0 being valid
Martin Kletzander [Tue, 10 Sep 2024 13:22:13 +0000 (15:22 +0200)]
resctrl: Account for memory bandwidth of 0 being valid

In some scenarios the memory bandwidth in the schemata file might be 0
and so can the minimum allocation in other ones.  Remove checks which
were added for extra cautiousness.

Resolves: https://issues.redhat.com/browse/RHEL-54235
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agodocs: Clarify hypervisor support for nwfilter profiles
Jim Fehlig [Tue, 10 Sep 2024 21:40:13 +0000 (15:40 -0600)]
docs: Clarify hypervisor support for nwfilter profiles

Enhance the 'since' annotation of <filterref> documentation to note
it's only supported by the QEMU, LXC, and ch hypervisor drivers.

Suggested-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Laine Stump <laine@redhat.com>
7 months agodocumentation: Remove untrue statement in GetVersion() description
Stepan Zobal [Thu, 12 Sep 2024 13:26:27 +0000 (15:26 +0200)]
documentation: Remove untrue statement in GetVersion() description

The description of virConnectGetVersion() says the function might only
work with a privileged access to the hypervisor, not with a read-only
connection.  However that is not true since commit a2e2e4652f29 and can
be safely removed.

Signed-off-by: Stepan Zobal <szobal@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 11 Sep 2024 19:17:55 +0000 (19:17 +0000)]
Translated using Weblate (Swedish)

Currently translated at 86.4% (9094 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
7 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 9 Sep 2024 15:38:58 +0000 (15:38 +0000)]
Translated using Weblate (Swedish)

Currently translated at 86.3% (9086 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
7 months agovmx: use xmlBufferDetach() when applicable
Jakub Palacky [Thu, 12 Sep 2024 11:47:22 +0000 (13:47 +0200)]
vmx: use xmlBufferDetach() when applicable

xmlBuffer->content was deprecated in libxml2 v2.13.0-33-gb34dc1e4
xmlBufferDetach(xmlBuffer) should be used instead

Signed-off-by: Jakub Palacky <jpalacky@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoutil/virxml: use xmlCtxtGetLastError when applicable
Jakub Palacky [Thu, 12 Sep 2024 11:47:21 +0000 (13:47 +0200)]
util/virxml: use xmlCtxtGetLastError when applicable

xmlParserCtxt->lastError was deprecated in libxml2 v2.13.0-103-g1228b4e0
xmlCtxtGetLastError(xmlParserCtxt) should be used instead

Signed-off-by: Jakub Palacky <jpalacky@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
7 months agoutil/virutil: Use readpassphrase when libbsd is available
Jakub Palacky [Wed, 11 Sep 2024 12:36:40 +0000 (14:36 +0200)]
util/virutil: Use readpassphrase when libbsd is available

When libbsd is available, use the preferred readpassphrase() function isntead of getpass()
as the getpass() function has been marked as obsolete and shouldnt be used

Signed-off-by: Jakub Palacky <jpalacky@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovmx: Allow '*' to appear in VMX file keys
Richard W.M. Jones [Wed, 11 Sep 2024 16:03:16 +0000 (17:03 +0100)]
vmx: Allow '*' to appear in VMX file keys

When connecting to a VMware server (eg using vpx://) we download and
try to parse the VMware metadata '*.vmx' file of a guest.  In this
case a VMX file was found which contained this key:

  pciPassthru*.present = "False"

The '*' character was not previously allowed in keys so this failed to
parse with the error:

  VIR_ERR_CONF_SYNTAX: VIR_FROM_CONF: configuration file syntax error:
  memory conf:74: expecting an assignment

Resolves: https://issues.redhat.com/browse/RHEL-58446
Thanks: Daniel Berrange
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agoAllow apparmor parser to be executed in /usr/bin
Tom [Tue, 20 Aug 2024 23:30:59 +0000 (23:30 +0000)]
Allow apparmor parser to be executed in /usr/bin

This commit modifies the AppArmor profile for virt-aa-helper to
accommodate an observed behavior in certain Linux distributions,
such as ArchLinux.

In these distributions, /usr/sbin symlinks to /usr/bin. To ensure
that virt-aa-helper can execute apparmor_parser when it resides
in /usr/bin, the profile has been updated accordingly.

Signed-off-by: Tom <libvirt-patch@douile.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 months agoqemuxmlconfttest: Add test case for invalid disk target
Peter Krempa [Mon, 9 Sep 2024 14:46:10 +0000 (16:46 +0200)]
qemuxmlconfttest: Add test case for invalid disk target

Add a test case that the numeric overflow when parsing disk target is
detected.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirDiskNameParse: Fix integer overflow in disk name parsing
Peter Krempa [Mon, 9 Sep 2024 14:46:09 +0000 (16:46 +0200)]
virDiskNameParse: Fix integer overflow in disk name parsing

The conversion to index entails multiplication and accumulation by user
provided data which can easily overflow, use VIR_MULTIPLY_ADD_IS_OVERFLOW
to check if the string is valid.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/674
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirconf: Properly fix numeric overflow when parsing numbers in conf files
Peter Krempa [Mon, 9 Sep 2024 14:46:08 +0000 (16:46 +0200)]
virconf: Properly fix numeric overflow when parsing numbers in conf files

The previous fix didn't check the overflow in addition. Use the new
macro to check both multiplication and addition overflows.

Fixes: 8666523b7d0891c38a7c9c138c4cc318eddfefeb
Closes: https://gitlab.com/libvirt/libvirt/-/issues/671
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agointernal: Add helper macro for checking multiply and add overflows
Peter Krempa [Mon, 9 Sep 2024 14:46:07 +0000 (16:46 +0200)]
internal: Add helper macro for checking multiply and add overflows

The macro does the two checks together so that it's obvious what we're
checking as doing it in place is really unpleasant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirDomainFeaturesDefParse: Add comment warning about features being specified repeatedly
Peter Krempa [Mon, 9 Sep 2024 14:46:06 +0000 (16:46 +0200)]
virDomainFeaturesDefParse: Add comment warning about features being specified repeatedly

Few of the handlers didn't take that possibility into account. Warn
others.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirDomainFeaturesTCGDefParse: Don't leak 'tcg_features' when '<tcg>' feature is repeated
Peter Krempa [Mon, 9 Sep 2024 14:46:05 +0000 (16:46 +0200)]
virDomainFeaturesTCGDefParse: Don't leak 'tcg_features' when '<tcg>' feature is repeated

Similarly to other cases users may specify the feature flag multiple
times.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirDomainFeaturesHyperVDefParse: Don't overwrite hypervisor vendor_id
Peter Krempa [Mon, 9 Sep 2024 14:46:04 +0000 (16:46 +0200)]
virDomainFeaturesHyperVDefParse: Don't overwrite hypervisor vendor_id

In case when the user specifies the '<hyperv/>' feature multiple times
we could overwrite already parsed data. Clear it beforehand.

As before this isn't trying to address the case of features being
specified multiple times not making much sense.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/675
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirBitmapShrink: Do not attempt to clear bits beyond end of buffer
Peter Krempa [Mon, 9 Sep 2024 14:46:03 +0000 (16:46 +0200)]
virBitmapShrink: Do not attempt to clear bits beyond end of buffer

'virBitmapShrink' clears the bits beyond the end of the bitmap when
shrinking and then reallocates to match the new size. As it uses the
address of the first bit beyond the bitmap to do the clearing it can
overrun the allocated buffer if we're not actually going to shrink it
and the last bit's address is on the chunk boundary.

Fix it by returning in that corner case and add few more tests to be
sure.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/673
Fixes: d6e582da80d
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agovirDomainDefParseBootInitOptions: Don't leak 'name' on failure
Peter Krempa [Mon, 9 Sep 2024 14:46:02 +0000 (16:46 +0200)]
virDomainDefParseBootInitOptions: Don't leak 'name' on failure

One of the failure paths skips code which would assign the string from
the temporary variable to the parsed struct, thus leaking it on failure.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/672
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agocpu_map: Install SierraForest description file
Michal Privoznik [Mon, 9 Sep 2024 07:26:28 +0000 (09:26 +0200)]
cpu_map: Install SierraForest description file

In one of recent commits new CPU model was introduced. But
corresponding change in meson.build is missing which results in
the XML file not being installed.

Fixes: 3afbb1644c4f9d5237459bd544d0f511ff99eb80
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Fri, 6 Sep 2024 20:25:18 +0000 (20:25 +0000)]
Translated using Weblate (Swedish)

Currently translated at 85.9% (9045 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
7 months agoqemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor
Peter Krempa [Fri, 6 Sep 2024 12:42:25 +0000 (14:42 +0200)]
qemuBackupDiskDataCleanupOne: Don't skip rest of cleanup if we can't enter monitor

Recent fix to use the proper 'async' monitor function would cause
libvirt to leak some of the objects it's supposed to clean up in other
places besides qemu.

Don't skip the whole function on failure to enter the job but just the
monitor section.

Fixes: 9b22c25548aa658acdeac2269ddae32584df32d8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agovirconf: Fix numeric overflow when parsing numbers in conf files
Peter Krempa [Fri, 6 Sep 2024 12:29:18 +0000 (14:29 +0200)]
virconf: Fix numeric overflow when parsing numbers in conf files

The number is parsed manually without making sure it'll fit.

Fixes: 3bbac7cdb67
Closes: https://gitlab.com/libvirt/libvirt/-/issues/671
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoconf: Don't overwrite KVM feature config struct if the feature is present twice
Peter Krempa [Fri, 6 Sep 2024 12:02:31 +0000 (14:02 +0200)]
conf: Don't overwrite KVM feature config struct if the feature is present twice

Don't allocate the struct if it exists already. This sidesteps the
discussion about whether forbidding multiple feature definitions makes
sense.

Fixes: a8e0f9c682143c63897de5c379d3ac3791c51970
Closes: https://gitlab.com/libvirt/libvirt/-/issues/670
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agocpu_map: Add SierraForest CPU model
Tim Wiederhake [Mon, 26 Aug 2024 09:58:26 +0000 (11:58 +0200)]
cpu_map: Add SierraForest CPU model

This was added in qemu commit 6e82d3b6220777667968a04c87e1667f164ebe88.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agocpu_map: Add missing feature "avx-vnni-int16"
Tim Wiederhake [Mon, 26 Aug 2024 09:52:35 +0000 (11:52 +0200)]
cpu_map: Add missing feature "avx-vnni-int16"

Introduced in qemu commit 138c3377a9b27accec516b2c0da90dedef98a780.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 4 Sep 2024 19:57:12 +0000 (19:57 +0000)]
Translated using Weblate (Swedish)

Currently translated at 85.5% (9005 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
7 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Wed, 4 Sep 2024 22:16:20 +0000 (22:16 +0000)]
Translated using Weblate (English (United Kingdom))

Currently translated at 48.9% (5147 of 10521 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
7 months agoqemu: backup: Use 'async' monitor in 'qemuBackupDiskDataCleanupOne'
Peter Krempa [Thu, 5 Sep 2024 12:55:59 +0000 (14:55 +0200)]
qemu: backup: Use 'async' monitor in 'qemuBackupDiskDataCleanupOne'

'qemuBackupDiskDataCleanupOne()' is entering the monitor while we're in
the async backup job inside 'qemuBackupBegin()' which is semantically
wrong and per upstream report causes crashes if some monitoring commands
are run in parallel.

Use qemuDomainObjEnterMonitorAsync() instead.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/668
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agovirshtest: Add test case for script friendly options
Peter Krempa [Thu, 5 Sep 2024 12:33:30 +0000 (14:33 +0200)]
virshtest: Add test case for script friendly options

Add a bunch of tests verifying that script-friendly options of certain
commands are not changed incompatibly thus potentially breaking user
scripts.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agoNEWS: Mention breakage of scrip-friendly virsh output
Peter Krempa [Thu, 5 Sep 2024 12:26:14 +0000 (14:26 +0200)]
NEWS: Mention breakage of scrip-friendly virsh output

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agovirsh: cmdList: Revert to script-friendly output for 'virsh list --uuid'
Peter Krempa [Thu, 5 Sep 2024 12:17:38 +0000 (14:17 +0200)]
virsh: cmdList: Revert to script-friendly output for 'virsh list --uuid'

Commit 271940223c2914bf63cbec00930ce46d6eef30ba which strived to add
support to use '--uuid' in the table output of 'virsh list' went too far
and also allowed the default table view to be enabled when just '--uuid'
is specified.

This broke the script-friendly output which previously had this format:

 $ virsh list --uuid
 b6d03c07-86f8-4a57-8719-172a5d0359bb

to this script-unfriendly output:

 $ virsh list --uuid
  Id   Name   State     UUID
 -------------------------------------------------------------
  1    ha     running   b6d03c07-86f8-4a57-8719-172a5d0359bb

Using the human friendly output will still be possible by using:

 $ virsh list --table --uuid

Fixes: 271940223c2914bf63cbec00930ce46d6eef30ba
Closes: https://gitlab.com/libvirt/libvirt/-/issues/666
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agotests: qemucapabilitiesdata: Add caps for 'caps_9.1.0_riscv64' (captured on x86_64)
Peter Krempa [Wed, 4 Sep 2024 07:10:50 +0000 (09:10 +0200)]
tests: qemucapabilitiesdata: Add caps for 'caps_9.1.0_riscv64' (captured on x86_64)

Add a capability dump for 'riscv64' with 'qemu-9.1' release captured
on a x86_64 host as I don't have hardware.

The last dump for riscv64 was done with qemu-8.0 which didn't manifest
the newest features such as CPU type selection and ACPI support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agotests: qemucapabilities: Update 'caps_9.1.0_x86_64' for final release
Peter Krempa [Wed, 4 Sep 2024 07:06:31 +0000 (09:06 +0200)]
tests: qemucapabilities: Update 'caps_9.1.0_x86_64' for final release

QEMU-9.1 was released so update the capabilities to the final state.

Notable changes:

 - Machine types 'pc-q35-6.1' and 'pc-i440fx-6.1' were deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 months agoqemuProcessSetupRawIO: Refactor return value and remove useless #ifdef
Peter Krempa [Tue, 3 Sep 2024 08:03:04 +0000 (10:03 +0200)]
qemuProcessSetupRawIO: Refactor return value and remove useless #ifdef

The function can return directly rather than setting 'ret' as there's no
cleanup.

It also doesn't make sense to conditionally compile out the 'break'
statement when checking whether a disk has rawio enabled if
'CAP_SYS_RAWIO' is _not_ defined as the function will still behave the
same.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 months agospec: Demote 'nfs-utils' as a weak dependency of 'daemon-driver-storage-core'
Peter Krempa [Mon, 2 Sep 2024 12:28:52 +0000 (14:28 +0200)]
spec: Demote 'nfs-utils' as a weak dependency of 'daemon-driver-storage-core'

The 'nfs-utils' package provides 'showmount' used to detect NFS-based
storage pool sources. As the lookup of storage pool sources can fail
gracefully and does so e.g. if the gluster backend is not installed we
can do the same for NFS.

Apart from allowing a tighter footprint when installing libvirt, this
also allows installation of the storage driver core in cases when a
security policy prohibits use of NFS.

Resolves: https://issues.redhat.com/browse/RHEL-56611
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 months agostorage: fs: Remove build-time detection of 'showmount' program
Peter Krempa [Mon, 2 Sep 2024 12:25:29 +0000 (14:25 +0200)]
storage: fs: Remove build-time detection of 'showmount' program

With the new virCommand infrastructure which can find the program in
path automatically we no longer need the build-time detection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
8 months agospec: Fix dtrace BuildRequires on fedora 41+
Cole Robinson [Tue, 27 Aug 2024 18:15:45 +0000 (14:15 -0400)]
spec: Fix dtrace BuildRequires on fedora 41+

/usr/bin/dtrace has been split from `systemtap-sdt-devel` into
`systemtap-sdt-dtrace`

It's forward and backward compatible to require the dtrace binary
directly.

We still need the latter dep though, for sdt.h in generated
libvirt_probes.h

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
8 months agovirnetdevtap: Add better error message for a possible common user error
Martin Kletzander [Wed, 4 Sep 2024 08:18:41 +0000 (10:18 +0200)]
virnetdevtap: Add better error message for a possible common user error

When users pre-create a tap device to use with multiqueue interface that
has `managed="no"`, change the error so that it does not indicate we are
trying to create the device, and on top of that hint at the most
probable error cause.

Resolves: https://issues.redhat.com/browse/RHEL-55749
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agovirnetdevtap: Do (not) use NULLSTR consistently
Martin Kletzander [Wed, 4 Sep 2024 08:16:50 +0000 (10:16 +0200)]
virnetdevtap: Do (not) use NULLSTR consistently

The function generates *ifname from the get go and most functions do not
wrap the string in a NULLSTR as it is not necessary.  The few leftovers
are outliers that are changed to fit the theme better.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 2 Sep 2024 08:51:25 +0000 (08:51 +0000)]
Translated using Weblate (Swedish)

Currently translated at 85.3% (8978 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
8 months agoqemu: Use pvpanic by default on aarch64
Andrea Bolognani [Tue, 27 Aug 2024 14:19:53 +0000 (16:19 +0200)]
qemu: Use pvpanic by default on aarch64

pvpanic-pci is the only reasonable implementation of a panic
device for aarch64/virt guests. Right now we're asking users to
provide the model name manually, but we can be more helpful and
fill it in automatically instead.

With this change, the aarch64-panic-no-model test no longer
fails and so it's no longer useful to us. Instead, we can amend
the aarch64-virt-default-models test case to include panic
coverage, something that until now wasn't possible.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu: Sometimes the default panic model doesn't exist
Andrea Bolognani [Tue, 27 Aug 2024 14:44:31 +0000 (16:44 +0200)]
qemu: Sometimes the default panic model doesn't exist

Right now the fallback behavior is to use MODEL_ISA if we
haven't been able to find a better match, but that's not very
useful as we're still going to hit an error later, when
QEMU_CAPS_DEVICE_PANIC is not found at Validate time.

Instead of doing that, allow MODEL_DEFAULT to get all the
way to Validate and report an error upon encountering it.

The reported error changes slightly, but other than that the
set of configurations that are allowed and blocked remains
the same.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu: Refactor default panic model
Andrea Bolognani [Tue, 27 Aug 2024 13:03:31 +0000 (15:03 +0200)]
qemu: Refactor default panic model

Perform decisions based on the architecture and machine type
in a single place instead of duplicating them.

This technically adds new behavior for MODEL_ISA in
qemuDomainDefAddDefaultDevices(), but it doesn't make any
difference functionally since we don't set addPanicDevice
outside of ppc64(le) and s390(x). If we did, the lack of
handling for that value would be a latent bug.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agotests: Add coverage for panic on riscv64
Andrea Bolognani [Tue, 27 Aug 2024 14:13:22 +0000 (16:13 +0200)]
tests: Add coverage for panic on riscv64

It merely duplicates the existing aarch64 coverage right now,
but it will become actually useful with the upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu_driver: Fix indentation
Martin Kletzander [Mon, 2 Sep 2024 07:31:29 +0000 (09:31 +0200)]
qemu_driver: Fix indentation

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 months agoPost-release version bump to 10.8.0
Jiri Denemark [Mon, 2 Sep 2024 09:50:18 +0000 (11:50 +0200)]
Post-release version bump to 10.8.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 months agoRelease of libvirt-10.7.0
Jiri Denemark [Mon, 2 Sep 2024 09:47:19 +0000 (11:47 +0200)]
Release of libvirt-10.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 months agoNEWS: Mention fix for CVE-2024-8235
Peter Krempa [Thu, 29 Aug 2024 08:53:25 +0000 (10:53 +0200)]
NEWS: Mention fix for CVE-2024-8235

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
8 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Sat, 31 Aug 2024 21:09:17 +0000 (21:09 +0000)]
Translated using Weblate (English (United Kingdom))

Currently translated at 48.8% (5138 of 10521 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
8 months agoqemu: Fix a few comments
Kamil Szczęk [Thu, 29 Aug 2024 10:25:19 +0000 (10:25 +0000)]
qemu: Fix a few comments

Fixes: d292c5ba1775bd70488fc1646e986c1987844549
Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
8 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 28 Aug 2024 04:44:29 +0000 (04:44 +0000)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10521 of 10521 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
8 months agoTranslated using Weblate (Korean)
김인수 [Wed, 28 Aug 2024 16:47:05 +0000 (16:47 +0000)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10521 of 10521 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
8 months agoudevListInterfaces: Honour array length for zero-length NULL arrays (CVE-2024-8235)
Peter Krempa [Wed, 21 Aug 2024 13:18:31 +0000 (15:18 +0200)]
udevListInterfaces: Honour array length for zero-length NULL arrays (CVE-2024-8235)

The refactor of 'udevListInterfacesByStatus()' which attempted to make
it usable as backend for 'udevNumOfInterfacesByStatus()' neglected to
consider the corner case of 'g_new0(..., 0)' returning NULL if the user
actually requests 0 elements.

As the code was modified to report the full number of interfaces in the
system when the list of names is NULL, the RPC code would be asked to
serialize a NULL-list of interface names with declared lenth of 1+
causing a crash.

To fix this corner case we make callers pass '-1' as @names_len (it's
conveniently an 'int' due to RPC type usage) if they don't wish to fetch
the actual list and convert all decisions to be done on @names_len being
non-negative instead of @names being non-NULL.

CVE-2024-8235

Fixes: bc596f275129bc11b2c4bcf737d380c9e8aeb72d
Resolves: https://issues.redhat.com/browse/RHEL-55373
Reported-by: Yanqiu Zhang <yanqzhan@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
8 months agodocs: Document presence of PS/2 feature in domcaps
Andrea Bolognani [Wed, 28 Aug 2024 15:09:57 +0000 (17:09 +0200)]
docs: Document presence of PS/2 feature in domcaps

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu: Expose availability of PS/2 feature in domcaps
Andrea Bolognani [Wed, 28 Aug 2024 12:26:25 +0000 (14:26 +0200)]
qemu: Expose availability of PS/2 feature in domcaps

This advertises the feature only for the architectures and
machine types where it can actually be used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu: Change signature for virQEMUCapsSupportsI8042Toggle()
Andrea Bolognani [Wed, 28 Aug 2024 12:43:49 +0000 (14:43 +0200)]
qemu: Change signature for virQEMUCapsSupportsI8042Toggle()

We will soon need to use it in a context where we don't have
a virDomainDef handy.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoqemu: Export a few functions
Andrea Bolognani [Wed, 28 Aug 2024 12:40:51 +0000 (14:40 +0200)]
qemu: Export a few functions

We're going to need them in a minute.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoNEWS: Add an entry for network support in ch driver.
Praveen K Paladugu [Mon, 26 Aug 2024 19:30:40 +0000 (14:30 -0500)]
NEWS: Add an entry for network support in ch driver.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoch: Enable bridge network mode
Praveen K Paladugu [Mon, 26 Aug 2024 19:30:39 +0000 (14:30 -0500)]
ch: Enable bridge network mode

Tested with following interface config:

 <interface type='bridge'>
    <mac address='52:54:00:71:b9:b6'/>
    <source bridge='clhbr0'/>
    <model type='virtio'/>
 </interface>

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agoch: interface: correctly update nicindexes
Pavel Hrdina [Tue, 27 Aug 2024 17:51:35 +0000 (19:51 +0200)]
ch: interface: correctly update nicindexes

Originally nicindexes were updated only for VIR_DOMAIN_NET_TYPE_BRIDGE
and VIR_DOMAIN_NET_TYPE_DIRECT. The mentioned commit adds support for
NAT network mode and changes the code to update nicindexes for
VIR_DOMAIN_NET_TYPE_ETHERNET and VIR_DOMAIN_NET_TYPE_NETWORK as well.

It doesn't work as intended and after the change nicindexes are updated
only for VIR_DOMAIN_NET_TYPE_ETHERNET and VIR_DOMAIN_NET_TYPE_NETWORK.

Fixes: aa642090738eb276f7bd70dea97d3a4fd03d59e3
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agovirschematest: Replace g_lstat() with virFileIsLink()
Michal Privoznik [Tue, 27 Aug 2024 12:14:37 +0000 (14:14 +0200)]
virschematest: Replace g_lstat() with virFileIsLink()

Inside of virschematest.c there's testSchemaDir() which iterates
over dentries in given directory but skips some files: those
without ".xml" suffix, hidden files, symlinks, etc.

Now, symlinks are detected as g_lstat() + S_ISLNK() combo which
works, except it fails to compile on mingw where is no concept of
symlinks. Replace the combo with a call to virFileIsLink() which
at least allows us to compile cleanly on mingw.

Fixes: f997fcca71a16b102e6ee663a3fb86bed8de9d7d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
8 months agoUpdate translation files
Weblate [Tue, 27 Aug 2024 08:34:01 +0000 (10:34 +0200)]
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>
8 months agoconf: check for migration job during domain start
Sergey Dyasli [Wed, 31 Jul 2024 11:46:48 +0000 (11:46 +0000)]
conf: check for migration job during domain start

It's possible to hit the following situation during qemu p2p live
migration:

1. qemu has live migrated and exited (making virDomainObjIsActive()
   return false)

2. the live migration job is still in progress, waiting for a
   confirmation from the remote libvirt daemon. This may last for
   a while with a presence of networking issues (up to keepalive
   timeout).

Any attempt to start the domain again would fail with "domain is already
being started" message which is misleading in this situation as it
doesn't reflect what's really happening.

Add a check for the migration job and report a different error message
if the migration job is still running.

Signed-off-by: Sergey Dyasli <sergey.dyasli@nutanix.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
8 months agopo: Refresh potfile for v10.7.0
Jiri Denemark [Tue, 27 Aug 2024 08:32:53 +0000 (10:32 +0200)]
po: Refresh potfile for v10.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 months agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
jianqing yan [Mon, 26 Aug 2024 12:43:05 +0000 (12:43 +0000)]
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 95.8% (10072 of 10508 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
8 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Sun, 25 Aug 2024 14:43:04 +0000 (14:43 +0000)]
Translated using Weblate (English (United Kingdom))

Currently translated at 48.8% (5132 of 10508 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
8 months agohypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpa...
Peter Krempa [Tue, 27 Aug 2024 07:56:47 +0000 (09:56 +0200)]
hypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpair' on win32

Mingw build failed after commit af87ee7927d3245582d82d36da25b4dc3b34465e
as 'socketpair()' is not available on that platform.

Stub out the function to return failure.

Fixes: af87ee7927d3245582d82d36da25b4dc3b34465e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
8 months agoremoteDispatchConnectOpen: Fix check for 'BHYVE' connection type
aokblast [Tue, 12 Mar 2024 23:00:26 +0000 (07:00 +0800)]
remoteDispatchConnectOpen: Fix check for 'BHYVE' connection type

'bhyveConnectGetType' (which is called from 'virConnectGetType') returns
'BHYVE' as the type, but the code in 'remoteDispatchConnectOpen'
responsible for selecting the sub-driver URIs in modular deployment
checks for 'bhyve' and thus would not properly fill the URIs to the
sub-daemons.

Signed-off-by: aokblast <aokblast@FreeBSD.org>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
8 months agoch: Enable NAT Network mode support
Praveen K Paladugu [Thu, 1 Aug 2024 22:25:14 +0000 (17:25 -0500)]
ch: Enable NAT Network mode support

From: Praveen K Paladugu <prapal@linux.microsoft.com>

enable VIR_DOMAIN_NET_TYPE_NETWORK network support for ch guests.
Tested with following config:

  <interface type='network'>
      <source network="default" bridge='virbr0'/>
      <model type='virtio'/>
      <driver queues="1"/>
  </interface>

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 months agohypervisor: Move domain interface mgmt methods
Praveen K Paladugu [Thu, 1 Aug 2024 22:25:13 +0000 (17:25 -0500)]
hypervisor: Move domain interface mgmt methods

From: Praveen K Paladugu <prapal@linux.microsoft.com>

Move methods to connect domain interfaces to host bridges to hypervisor.
This is to allow reuse between qemu and ch drivers.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>