]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
5 months agoutils: Canonicalize paths before comparing them
Andrea Bolognani [Thu, 13 Feb 2025 08:54:05 +0000 (09:54 +0100)] 
utils: Canonicalize paths before comparing them

In virFileIsSharedFSOverride() we compare a path against a list
of overrides looking for a match.

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

Canonicalizing the path as well solves the issue.

Resolves: https://issues.redhat.com/browse/RHEL-79165
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agodocs: index: fix VMware capitalization
Ján Tomko [Mon, 17 Feb 2025 14:07:56 +0000 (15:07 +0100)] 
docs: index: fix VMware capitalization

Reported-by: Mark Phillips
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 months agonews: include info about supporting vhostuser+passt combination
Laine Stump [Sat, 15 Feb 2025 14:02:09 +0000 (09:02 -0500)] 
news: include info about supporting vhostuser+passt combination

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agodocs: document using passt backend with <interface type='vhostuser'>
Laine Stump [Sat, 15 Feb 2025 04:35:56 +0000 (23:35 -0500)] 
docs: document using passt backend with <interface type='vhostuser'>

Almost everything is already there (in the section for using passt
with type='user'), so we just need to point to that from the
type='vhostuser' section (and vice versa), and add a bit of glue.

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agodocs: improve type='user' docs to higlight differences between SLIRP and passt
Laine Stump [Sat, 15 Feb 2025 03:43:03 +0000 (22:43 -0500)] 
docs: improve type='user' docs to higlight differences between SLIRP and passt

This reorganizes the section about <interface type='user'> and
describes the differences in behavior between SLIRP and passt.

Resolves: https://issues.redhat.com/browse/RHEL-46601
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: fail validation if a domain def has vhostuser/passt but no shared mem
Laine Stump [Fri, 14 Feb 2025 18:10:19 +0000 (13:10 -0500)] 
qemu: fail validation if a domain def has vhostuser/passt but no shared mem

This can/should also be done for a traditional vhost-user interface
(ie not backend type='passt') but that will be a separate change.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: complete vhostuser + passt support
Laine Stump [Wed, 12 Feb 2025 21:16:44 +0000 (16:16 -0500)] 
qemu: complete vhostuser + passt support

<interface type='vhostuser'><backend type='passt'/> needs to run the
passt command just as is done for interface type='user', but then add
vhostuser bits to the qemu commandline/monitor command.

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

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

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

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

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

Resolves: https://issues.redhat.com/browse/RHEL-69455
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: make qemuPasstCreateSocketPath() public
Laine Stump [Wed, 12 Feb 2025 17:12:04 +0000 (12:12 -0500)] 
qemu: make qemuPasstCreateSocketPath() public

When passt is used with vhostuser, the vhostuser code that builds the
qemu commandline will need to have the same socket path that is given
to the passt command, so this patch makes it visible outside of
qemu_passt.c.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: use switch instead of if in qemuProcessPrepareDomainNetwork()
Laine Stump [Tue, 11 Feb 2025 21:30:11 +0000 (16:30 -0500)] 
qemu: use switch instead of if in qemuProcessPrepareDomainNetwork()

qemuProcessPrepareDomain()'s comments say that it should be the only
place to change the "live XML" of a domain (i.e. the public parts of
the virDomainDef object that is shown in the domain's status
XML), and that seems like a reasonable idea (although there aren't
many users of it to date).

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoconf/qemu: make <source> element *almost* optional for type=vhostuser
Laine Stump [Mon, 10 Feb 2025 03:52:54 +0000 (22:52 -0500)] 
conf/qemu: make <source> element *almost* optional for type=vhostuser

For some reason, when vhostuser interface support was added in 2014,
the parser required that the XML for the <interface> have a <source>
element with type, mode, and path, all 3 also required. This in spite
of the fact that 'unix' is the only possible valid setting for type,
and 95% of the time the mode is set to 'client' (as I understand from
comments in the code, normally a guest will use mode='client' to
connect to an existing socket that is precreated (by OVS?), and the
only use for mode='server' is for test setups where one guest is setup
with a listening vhostuser socket (i.e. 'server') and another guest
connects to that socket (i.e. 'client')). (or maybe one guest connects
to OVS in server mode, and all the others connect in client mode, not
sure - I don't claim to be an expert on vhost-user.)

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

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: do all vhostuser attribute validation in qemu driver
Laine Stump [Mon, 10 Feb 2025 00:01:32 +0000 (19:01 -0500)] 
qemu: do all vhostuser attribute validation in qemu driver

Since vhostuser is only used/supported by the QEMU driver, and all the
rest of the vhostuser-specific validation is done in QEMU's
validation, lets move the final check (to see if they've tried to
enable auto-reconnect when this interface is on the server side of the
vhostuser socket) to the QEMU validate.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: automatically set model type='virtio' for interface type='vhostuser'
Laine Stump [Sun, 9 Feb 2025 23:23:03 +0000 (18:23 -0500)] 
qemu: automatically set model type='virtio' for interface type='vhostuser'

Both vdpa and vhostuser require that the guest device be virtio, and
for interface type='vdpa', we already set <model type='virtio'/> if it
is unspecified in the input XML, so let's be just as courteous for
interface type='vhostuser'.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: validate that model is virtio for vhostuser and vdpa interfaces in the same...
Laine Stump [Sun, 9 Feb 2025 23:46:00 +0000 (18:46 -0500)] 
qemu: validate that model is virtio for vhostuser and vdpa interfaces in the same place

Both vhostuser and vdpa interface types must use the virtio model in
the guest (because part of the functionality is implemented in the
guest virtio driver). Due to ["because that's the way it happened"]
this has been validated for vhostuser in the hypervisor-agnostic
validate function, but for vdpa it has been done in the QEMU-specific
validate. Since these interface models are only supported by QEMU
anyway, validate for both of them in the QEMU validation function.

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: fix qemu validation to forbid guest-side IP address for type='vdpa'
Laine Stump [Tue, 4 Feb 2025 21:06:18 +0000 (16:06 -0500)] 
qemu: fix qemu validation to forbid guest-side IP address for type='vdpa'

Because all the checks for VIR_DOMAIN_NET_TYPE_VDPA were inside an
else-if clause that was immediately followed by another else-if clause
that forbid setting guestIP.ips or guestIP.routes, we've been allowing
users to set guestIP.* for vdpa interfaces (but then not doing
validation of the attributes that should have been done if we *did*
support setting IPs for vdpa (but we don't anyway, so :shrug:.)

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

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

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoconf: change virDomainHostdevInsert() to return void
Laine Stump [Tue, 11 Feb 2025 21:44:49 +0000 (16:44 -0500)] 
conf: change virDomainHostdevInsert() to return void

We haven't checked for memalloc failure in many years, and that was
the only reason this function would have ever failed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoNEWS: Document ccwgroup based qeth device support
Boris Fiuczynski [Thu, 13 Feb 2025 14:09:30 +0000 (15:09 +0100)] 
NEWS: Document ccwgroup based qeth device support

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoremote_daemon: Silence DBus errors
Michal Privoznik [Wed, 12 Feb 2025 11:25:42 +0000 (12:25 +0100)] 
remote_daemon: Silence DBus errors

When a daemon (like libvirtd, virtqemud, etc.) is started as an
unprivileged user (which is exactly how KubeVirt does it), then
it tries to register on both session and system DBus-es so that
it can shut itself down (e.g. when system is powering off or user
logs out). It's worth noting that this is just opportunistic and
if no DBus is available then no error is reported.

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

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

Resolves: https://issues.redhat.com/browse/RHEL-79088
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 months agovirgdbus: Introduce virGDBusHasSessionBus()
Michal Privoznik [Wed, 12 Feb 2025 13:17:34 +0000 (14:17 +0100)] 
virgdbus: Introduce virGDBusHasSessionBus()

This is just like virGDBusHasSystemBus() except it checks for the
session bus instead of the system one.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Thu, 13 Feb 2025 08:08:45 +0000 (09:08 +0100)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.7% (5257 of 10781 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
5 months agoqemu: add 'auto_start_delay' configuration parameter
Daniel P. Berrangé [Mon, 16 Dec 2024 19:49:33 +0000 (19:49 +0000)] 
qemu: add 'auto_start_delay' configuration parameter

This allows a user specified delay between autostart of each VM, giving
parity with the equivalent feature of libvirt-guests.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agohypervisor: add support for delay interval during autostart
Daniel P. Berrangé [Mon, 16 Dec 2024 19:45:23 +0000 (19:45 +0000)] 
hypervisor: add support for delay interval during autostart

This delay can reduce the CPU/IO load storm when autostarting many
guests.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agosrc: convert drivers over to use new autostart helper
Daniel P. Berrangé [Mon, 16 Dec 2024 19:26:13 +0000 (19:26 +0000)] 
src: convert drivers over to use new autostart helper

This eliminates some duplicated code patterns aross drivers.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agohypervisor: introduce helper for autostart
Daniel P. Berrangé [Mon, 16 Dec 2024 18:53:28 +0000 (18:53 +0000)] 
hypervisor: introduce helper for autostart

There's a common pattern for autostart of iterating over VMs, acquiring
a lock and ref count, then checking the autostart & is-active flags.
Wrap this all up into a helper method.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoremote: notify systemd when reloading config
Daniel P. Berrangé [Tue, 7 Jan 2025 15:29:20 +0000 (15:29 +0000)] 
remote: notify systemd when reloading config

Switch to the 'notify-reload' service type and send notifications to
systemd when reloading configuration.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoutil: add APIs for more systemd notifications
Daniel P. Berrangé [Mon, 6 Jan 2025 18:58:05 +0000 (18:58 +0000)] 
util: add APIs for more systemd notifications

We have a way to notify systemd when we're done starting the daemon.

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

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

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

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

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agobhyve: stop opening & passing connection to bhyveProcessStart
Daniel P. Berrangé [Mon, 3 Feb 2025 15:11:32 +0000 (15:11 +0000)] 
bhyve: stop opening & passing connection to bhyveProcessStart

A connection object is not required because autostarted domains are
never marked for autodestroy.

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

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agobhyve: add 'driver' to bhyveProcessStart method
Daniel P. Berrangé [Mon, 3 Feb 2025 15:09:29 +0000 (15:09 +0000)] 
bhyve: add 'driver' to bhyveProcessStart method

This allows for passinga  NULL connection object in cases where
domain autodestroy is not required.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemu: migration: Reactivate block nodes after migration if VM is left paused
Peter Krempa [Mon, 10 Feb 2025 18:49:10 +0000 (19:49 +0100)] 
qemu: migration: Reactivate block nodes after migration if VM is left paused

On incoming migration qemu doesn't activate the block graph nodes right
away. This is to properly facilitate locking of the images.

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

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

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

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

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

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

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

Resolves: https://issues.redhat.com/browse/RHEL-78398
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemu: monitor: Add monitor backend for 'blockdev-set-active'
Peter Krempa [Mon, 10 Feb 2025 16:51:31 +0000 (17:51 +0100)] 
qemu: monitor: Add monitor backend for 'blockdev-set-active'

The command will be used to re-activate block nodes after migration when
we're leaving the VM paused so that blockjobs can be used.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemu: capabilies: Introduce QEMU_CAPS_BLOCKDEV_SET_ACTIVE
Peter Krempa [Mon, 10 Feb 2025 16:57:01 +0000 (17:57 +0100)] 
qemu: capabilies: Introduce QEMU_CAPS_BLOCKDEV_SET_ACTIVE

The flag signals presence of the 'blockdev-set-active' QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1636-gffaf7f0376'
Peter Krempa [Fri, 7 Feb 2025 16:48:36 +0000 (17:48 +0100)] 
qemucapabilitiestest: Update 'caps_10.0.0_x86_64' to 'v9.2.0-1636-gffaf7f0376'

Notable changes:
    - 'blockdev-set-active' QMP command and the corresponding 'active'
      flag for instantiating blockdev backends added

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemu-replies-tool: Dump also query string for optional members
Peter Krempa [Mon, 10 Feb 2025 17:29:14 +0000 (18:29 +0100)] 
qemu-replies-tool: Dump also query string for optional members

The query language allows querying whether a member is optional by using
the '*' "operator" but the dumper script didn't output those query
strings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemu: snapshot: Limit scope of checkpoint-snapshot interlock
Peter Krempa [Mon, 3 Feb 2025 14:45:49 +0000 (15:45 +0100)] 
qemu: snapshot: Limit scope of checkpoint-snapshot interlock

'qemuDomainSupportsCheckpointsBlockjobs()' should really be used only
with active VMs based on the scope of interlocking it does.

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

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

See: https://gitlab.com/libvirt/libvirt/-/issues/739
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoqemu: fix qemuDomainSaveImageDefineXML
Pavel Hrdina [Wed, 12 Feb 2025 10:12:03 +0000 (11:12 +0100)] 
qemu: fix qemuDomainSaveImageDefineXML

The commit in question made an incorrect change that resulted in getting
O_RDONLY FD instead of O_RDWR preventing any writes to happen with the
following error:

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

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

Fixes: 517248e2394476a3105ff5866b0b718fc6583073
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 months agoci: refresh with 'lcitool manifest'
Daniel P. Berrangé [Tue, 11 Feb 2025 17:15:45 +0000 (17:15 +0000)] 
ci: refresh with 'lcitool manifest'

This replaces Fedora 39 with Fedora 41, updates the FreeBSD
Cirrus CI image names, and tweaks some package names

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agonode_device: Do not lock the driver state needlessly
Martin Kletzander [Fri, 7 Feb 2025 14:43:52 +0000 (15:43 +0100)] 
node_device: Do not lock the driver state needlessly

When processing the PCI devices we can only read the configs for each of
them if running as privileged.  That information is saved in the driver
state as a boolean introduced in commit 643c74abff01.  However since
that version it is only written to once during nodeStateInitialize() and
only read from that point (apart from some commits around v3.9.0 release
when it was not even set, but that was fixed before v3.10.0).  And it is
only read once, just to store that boolean in a temporary variable which
is also used in only one condition.

Rewrite this without locking and save few lines of code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 months agoTranslated using Weblate (English (United Kingdom))
Andi Chandler [Tue, 11 Feb 2025 12:00:55 +0000 (13:00 +0100)] 
Translated using Weblate (English (United Kingdom))

Currently translated at 48.6% (5241 of 10781 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
5 months agoTranslated using Weblate (Romanian)
Remus-Gabriel Chelu [Tue, 11 Feb 2025 12:00:54 +0000 (13:00 +0100)] 
Translated using Weblate (Romanian)

Currently translated at 20.1% (2175 of 10781 strings)

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

Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
5 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Tue, 11 Feb 2025 12:00:54 +0000 (13:00 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 52.8% (5700 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5679 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5676 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5674 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.6% (5671 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 52.2% (5634 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
5 months agonode_device_udev: add error reporting to udevProcessCCWGroup
Boris Fiuczynski [Thu, 6 Feb 2025 16:27:52 +0000 (17:27 +0100)] 
node_device_udev: add error reporting to udevProcessCCWGroup

Add reporting an internal error when the string to type conversion of
devtype fails as this indicates a serious problem since devtype was used
to get into this method during the udev event handling.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: domain: Initialize FD passthrough for a virStorageSource before using it
Peter Krempa [Thu, 6 Feb 2025 15:20:45 +0000 (16:20 +0100)] 
qemu: domain: Initialize FD passthrough for a virStorageSource before using it

The call to 'qemuBlockStorageSourceNeedsFormatLayer()' bases the
decision also on the state of the passed FD, so we must initialize the
passthrough data via 'qemuDomainPrepareStorageSourceFDs()' before the
aforementioned call.

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

Resolves: https://issues.redhat.com/browse/RHEL-37519
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemuxmlconftest: Add testing of FDs with 'writable' flag in 'disk-source-fd'
Peter Krempa [Thu, 6 Feb 2025 14:55:37 +0000 (15:55 +0100)] 
qemuxmlconftest: Add testing of FDs with 'writable' flag in 'disk-source-fd'

Add few examples of fd groups with the 'writable' flag set, when passing
a single FD. Notably as a top level image of a readonly disk (even when
that doesn't make much sense) and also as a base image of a chain.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoqemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks
Peter Krempa [Thu, 6 Feb 2025 14:50:35 +0000 (15:50 +0100)] 
qemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks

Pass also the 'writable' state to the fake passed FDs so that we can
test it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Thu, 6 Feb 2025 12:58:21 +0000 (13:58 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 51.9% (5600 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.5% (5557 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.2% (5522 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
5 months agodocs: Reword virDomainGetEmulatorPinInfo description
Martin Kletzander [Mon, 13 Jan 2025 14:27:10 +0000 (15:27 +0100)] 
docs: Reword virDomainGetEmulatorPinInfo description

This API only queries the XML settings and not the running threads
themselves.  In order to avoid confusion, change the wording slightly.

Resolves: https://issues.redhat.com/browse/RHEL-72052
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agotests: qemuxmlconfdata: Update launch-security-sev-snp.xml
Michal Privoznik [Mon, 27 Jan 2025 09:46:17 +0000 (10:46 +0100)] 
tests: qemuxmlconfdata: Update launch-security-sev-snp.xml

Recently, I was part of a discussion where it was suspected that
libvirt does not pick up correct FW for SEV-SNP guests. Update
our test to demonstrate it does.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agonodedev: udev: Hook up virFileWaitForExist to address uevent race of pci device
Guoyi Tu [Thu, 19 Dec 2024 15:07:35 +0000 (23:07 +0800)] 
nodedev: udev: Hook up virFileWaitForExist to address uevent race of pci device

Similarly to commit 1af45804 we should be safer by waiting for the whole
sysfs tree is created for the device.

Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agoqemu: Attach persistent reservations manager if block-copy target requires it
Peter Krempa [Tue, 4 Feb 2025 17:06:00 +0000 (18:06 +0100)] 
qemu: Attach persistent reservations manager if block-copy target requires it

Users can choose to copy a disk into a destination where they want to
use persistent reservations. Start the daemon if the configuration
requires it.

Resolves: https://issues.redhat.com/browse/RHEL-7342
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: blockjob: Remove persistent reservations manager when dropping disk images
Peter Krempa [Tue, 4 Feb 2025 16:59:06 +0000 (17:59 +0100)] 
qemu: blockjob: Remove persistent reservations manager when dropping disk images

Check if the persistent reservations manager daemon is still needed
after a disk (sub)-chain was dropped after a blockjob.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: hotplug: Export persistent reservations manager helper functions
Peter Krempa [Tue, 4 Feb 2025 16:51:57 +0000 (17:51 +0100)] 
qemu: hotplug: Export persistent reservations manager helper functions

Export qemuHotplugAttachManagedPR/qemuHotplugRemoveManagedPR for reuse
in blockjob code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agovirDomainDefHasManagedPR: Consider also disk's 'mirror' chain
Peter Krempa [Tue, 4 Feb 2025 16:55:14 +0000 (17:55 +0100)] 
virDomainDefHasManagedPR: Consider also disk's 'mirror' chain

Consider also the destination of a block-copy job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu_hotplug.h: Reformat according to new coding style
Peter Krempa [Tue, 4 Feb 2025 16:45:37 +0000 (17:45 +0100)] 
qemu_hotplug.h: Reformat according to new coding style

Fix the mixed style by unifying the formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64
Peter Krempa [Tue, 4 Feb 2025 16:12:00 +0000 (17:12 +0100)] 
qemucapabilitiestest: Add data for the qemu-10.0 dev cycle on x86_64

Add data based on 'v9.2.0-1537-gd922088eb4'

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemucapabilitiestest: Final update for qemu-9.2 release on x86_64
Peter Krempa [Thu, 28 Nov 2024 08:52:32 +0000 (09:52 +0100)] 
qemucapabilitiestest: Final update for qemu-9.2 release on x86_64

Update the data after the release.

Notable changes:
 - the 6.2 machine types became deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agoqemu: snapshot: Ensure that NVRAM image exists when taking inactive internal snapshot
Peter Krempa [Mon, 3 Feb 2025 16:52:50 +0000 (17:52 +0100)] 
qemu: snapshot: Ensure that NVRAM image exists when taking inactive internal snapshot

Attempting to take an internal snapshot of a freshly defined VM with
qcow2 backed NVRAM results in failure as the NVRAM image doesn't get
populated until the VM is started for the first time.

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

Resolves: https://issues.redhat.com/browse/RHEL-73315
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 months agoqemu: process: Export qemuPrepareNVRAM for use in snapshot code
Peter Krempa [Mon, 3 Feb 2025 16:48:05 +0000 (17:48 +0100)] 
qemu: process: Export qemuPrepareNVRAM for use in snapshot code

Export qemuPrepareNVRAM so that it doesn't require the VM object. The
snapshot code needs in the corner case of creating a snapshot of a
freshly defined VM ensure that the nvram image exists in order to
snapshot it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 months agoqemuSnapshotForEachQcow2: Don't initialize 'nrollback'
Peter Krempa [Mon, 3 Feb 2025 17:23:29 +0000 (18:23 +0100)] 
qemuSnapshotForEachQcow2: Don't initialize 'nrollback'

The variable holds the amount of disks to roll back the snapshot for.
The value must be set before the code jumps to the 'rollback:' label so
the best situation is to not initialize it and let the compiler catch
errors rather than initialize the unsigned variable to -1 and let it
crash.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 months agonode_device_udev: Fix build failure in ccw device code
Peter Krempa [Wed, 5 Feb 2025 18:27:36 +0000 (19:27 +0100)] 
node_device_udev: Fix build failure in ccw device code

clang complains:

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

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

Fixes: 985cb9c32a6
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 months agonodedev: add qeth layer2 and layer3 device types
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:43 +0000 (18:11 +0100)] 
nodedev: add qeth layer2 and layer3 device types

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: add ccwgroup capability support to ccw devices
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:42 +0000 (18:11 +0100)] 
nodedev: add ccwgroup capability support to ccw devices

Add the group membership information to a CCW device. Allow to filter
CCW devices based on a group membership.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: add ccwgroup node device support
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:41 +0000 (18:11 +0100)] 
nodedev: add ccwgroup node device support

Add ccwgroup node device type supporting qeth generic driver.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: refactor udevCCWGetState
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:40 +0000 (18:11 +0100)] 
nodedev: refactor udevCCWGetState

Refactor method to be only ccw state type depended to allow reuse in a
later patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: refactor CCW state format for use in ccwgroup
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:39 +0000 (18:11 +0100)] 
nodedev: refactor CCW state format for use in ccwgroup

Refactor to allow reuse in ccwgroup.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: remove virNodeDeviceCapCCWDefFormat
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:38 +0000 (18:11 +0100)] 
nodedev: remove virNodeDeviceCapCCWDefFormat

Directly use virCCWDeviceAddressFormat.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: refactor CCW device address
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:37 +0000 (18:11 +0100)] 
nodedev: refactor CCW device address

Replace cssid, ssid and devno elements with virCCWDeviceAddress.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agonodedev: refactor CCW device address format
Boris Fiuczynski [Tue, 4 Feb 2025 17:11:36 +0000 (18:11 +0100)] 
nodedev: refactor CCW device address format

Refactor for reuse in the following patch.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 months agodocs: fix 'virsh domstats --vcpu' measure units and descriptions
Fabricio Duarte [Mon, 16 Dec 2024 22:02:44 +0000 (19:02 -0300)] 
docs: fix 'virsh domstats --vcpu' measure units and descriptions

The fields are in nanoseconds, not microseconds. Also fixes the
description of `vcpu.<num>.wait`, as it does not actually represent the
time waiting on I/O.

Signed-off-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agoTranslated using Weblate (Chinese (Traditional) (zh_TW))
Daniel P. Berrangé [Mon, 3 Feb 2025 14:39:59 +0000 (15:39 +0100)] 
Translated using Weblate (Chinese (Traditional) (zh_TW))

Currently translated at 2.4% (265 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 93.3% (10067 of 10781 strings)

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

Signed-off-by: "Daniel P. Berrange" <berrange@redhat.com>
5 months agoTranslated using Weblate (Spanish)
Nicolás Gal [Mon, 3 Feb 2025 14:39:58 +0000 (15:39 +0100)] 
Translated using Weblate (Spanish)

Currently translated at 51.0% (5507 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.7% (5472 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.6% (5458 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
Translated using Weblate (Spanish)

Currently translated at 50.4% (5437 of 10781 strings)

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

Signed-off-by: Nicolás Gal <nialegal@yandex.com>
5 months agoNEWS: Mention preserving I/O error messages for qemu VMs
Peter Krempa [Tue, 28 Jan 2025 16:22:19 +0000 (17:22 +0100)] 
NEWS: Mention preserving I/O error messages for qemu VMs

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoinclude: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
Peter Krempa [Fri, 24 Jan 2025 15:26:54 +0000 (16:26 +0100)] 
include: libvirt-domain: Add 'message' @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

In case when the hypervisor does report the reason for the I/O error as
an unstable string to display to users we can add a @reason possibility
for the I/O error event noting that the error is available.

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

The resulting event looks like:

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

Users then can look at the virDomainGetMessages() API:

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

Or in the VM log file:

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoinclude: libvirt-domain: Reword documentation for @reason of VIR_DOMAIN_EVENT_ID_IO_E...
Peter Krempa [Mon, 27 Jan 2025 14:50:34 +0000 (15:50 +0100)] 
include: libvirt-domain: Reword documentation for @reason of VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

Emphasise that it's an enumeration and convert the possibilities to a
list of values with explanation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agovirDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS
Peter Krempa [Mon, 27 Jan 2025 18:13:43 +0000 (19:13 +0100)] 
virDomainGetMessages: Introduce VIR_DOMAIN_MESSAGE_IOERRORS

Report any stored I/O error messages reported by the hypervisor when
reporting messages of a domain. As the I/O error may be already stale we
report also the timestamp when it was recorded.

Example message:

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agovirDomainObjGetMessages: Refactor using GPtrArray
Peter Krempa [Mon, 27 Jan 2025 16:38:51 +0000 (17:38 +0100)] 
virDomainObjGetMessages: Refactor using GPtrArray

Simplify the function especially by rewriting it using GPtrArray to
construct the string list, especially for the upcoming case when the
number of added elements will not be known beforehand and when
hypervisor specific data will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agolibxlDomainGetMessages: Add existing flags to 'virCheckFlags'
Peter Krempa [Tue, 28 Jan 2025 13:06:16 +0000 (14:06 +0100)] 
libxlDomainGetMessages: Add existing flags to 'virCheckFlags'

The two VIR_DOMAIN_MESSAGE_* flags were not listed in the virCheckFlags
check in 'libxl' but were present in 'test' and 'qemu' driver impls.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuProcessHandleIOError: Log IO errors in the VM log file
Peter Krempa [Fri, 24 Jan 2025 16:01:34 +0000 (17:01 +0100)] 
qemuProcessHandleIOError: Log IO errors in the VM log file

Add a log entry to the VM log file for every time we receive an IO error
event from qemu. The log entry is as follows:

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuProcessHandleIOError: Populate I/O error reason to virStorageSource
Peter Krempa [Mon, 27 Jan 2025 18:17:16 +0000 (19:17 +0100)] 
qemuProcessHandleIOError: Populate I/O error reason to virStorageSource

Record the last I/O error reason and timestamp which happened with the
corresponding virStorageSource struct.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agovirStorageSource: Add fields for storing last I/O error message
Peter Krempa [Mon, 27 Jan 2025 15:20:43 +0000 (16:20 +0100)] 
virStorageSource: Add fields for storing last I/O error message

Hypervisors may report a I/O error message (unstable; for human use)
to libvirt. In order to store it with the appropriate virStorageSource
so that it can be later queried we need to add fields to
virStorageSource to store the timestamp and message.

The message is deliberately not copied via virStorageSourceCopy.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuMonitorJSONHandleIOError: Propagate new 'qom-path' field
Peter Krempa [Tue, 28 Jan 2025 09:39:52 +0000 (10:39 +0100)] 
qemuMonitorJSONHandleIOError: Propagate new 'qom-path' field

QEMU commit v9.1.0-1065-ge67b7aef7c added 'qom-path' as an optional
field for the BLOCK_IO_ERROR event. Extract and propagate it as an
alternative to lookup via 'node-name' and 'device' (alias).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuProcessHandleIOError: Prefer lookup by node name
Peter Krempa [Fri, 24 Jan 2025 16:17:51 +0000 (17:17 +0100)] 
qemuProcessHandleIOError: Prefer lookup by node name

When qemu reports a node name for an I/O error we should prefer the
lookup by node name instead as it gives us the path to the specific
image which caused the error instead of the top level image path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuMonitorJSONHandleIOError: Do not munge 'reason' field of IO error event
Peter Krempa [Mon, 27 Jan 2025 12:53:36 +0000 (13:53 +0100)] 
qemuMonitorJSONHandleIOError: Do not munge 'reason' field of IO error event

Leave the interpretation of the event to 'qemuProcessHandleIOError()'
which will create it's own variant of the messages for the user-facing
libvirt events. qemuMonitorJSONHandleIOError() will pass through the raw
data it got from qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemuProcessHandleIOError: Rename local variables
Peter Krempa [Mon, 27 Jan 2025 12:07:24 +0000 (13:07 +0100)] 
qemuProcessHandleIOError: Rename local variables

Prefix the helper variables used to supply data to the event by
'event'. Declare them with the default value of an empty string rather
than doing it later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemu: Rename 'diskAlias' to 'device' in qemu IO error event handling
Peter Krempa [Mon, 27 Jan 2025 12:42:36 +0000 (13:42 +0100)] 
qemu: Rename 'diskAlias' to 'device' in qemu IO error event handling

The field is named 'device' in the event so unify our naming.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoqemu: Handle quirks of 'device' field of BLOCK_IO_ERROR event in monitor code
Peter Krempa [Mon, 27 Jan 2025 12:03:58 +0000 (13:03 +0100)] 
qemu: Handle quirks of 'device' field of BLOCK_IO_ERROR event in monitor code

BLOCK_IO_ERROR's 'device' field is an empty string in case when it isn't
applicable as it was originally mandatory in the qemu API docs.

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

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoNEWS: Document virtio-mem-ccw
Michal Privoznik [Fri, 24 Jan 2025 11:16:41 +0000 (12:16 +0100)] 
NEWS: Document virtio-mem-ccw

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml
Michal Privoznik [Tue, 28 Jan 2025 07:54:36 +0000 (08:54 +0100)] 
qemuxmlconftest: Introduce memory-hotplug-virtio-mem-ccw-s390x.xml

This is similar to emuxmlconfdata/memory-hotplug-virtio-mem-pci-s390x.xml
except the explicit placement of virtio-mem onto a PCI bus is removed.
This results in virtio-mem being placed onto CCW "bus" this demonstrating
previous commits working as expected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemu: Allow virtio-mem on CCW
Michal Privoznik [Wed, 15 Jan 2025 12:00:36 +0000 (13:00 +0100)] 
qemu: Allow virtio-mem on CCW

After previous commits, we can allow virtio-mem to live on CCW
channel.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemu: Validate virtio-mem-ccw
Michal Privoznik [Wed, 15 Jan 2025 14:48:41 +0000 (15:48 +0100)] 
qemu: Validate virtio-mem-ccw

There are basically two differences between virtio-mem-ccw and
virtio-mem-pci. s390 doesn't allow mixing different page sizes
and there's no NUMA support in QEMU.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW
Michal Privoznik [Wed, 15 Jan 2025 09:46:16 +0000 (10:46 +0100)] 
qemu_caps: Introduce QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW

This capability tracks whether QEMU supports virtio-mem-ccw
device. Introduced in QEMU commit v9.2.0-492-gaa910c20ec only
upcoming release of QEMU supports the device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml
Michal Privoznik [Wed, 15 Jan 2025 09:45:31 +0000 (10:45 +0100)] 
qemuxmlconftest: Introduce memory-hotplug-virtio-mem-pci-s390x.xml

As of v9.2.0-1413-gd77ae821e8 QEMU supports virtio-mem-pci on
s390 too. Let's add a test case for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and...
Michal Privoznik [Mon, 13 Jan 2025 14:48:03 +0000 (15:48 +0100)] 
qemu_command: Use qemuBuildVirtioDevProps() to build cmd line for virtio-mem and virtio-pmem

Both, virtio-mem and virtio-pmem devices follow traditional QEMU
naming convention: their suffix determines what bus they live on.
For instance, virtio-mem-pci, virtio-mem-ccw, virtio-pmem-pci.
We already have a function that constructs device name following
this convention: qemuBuildVirtioDevGetConfigDev().

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

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agoqemu: Do NOT autoadd NUMA node for s390
Michal Privoznik [Mon, 20 Jan 2025 16:10:24 +0000 (17:10 +0100)] 
qemu: Do NOT autoadd NUMA node for s390

In some cases, we might automatically add a NUMA node. But this
doesn't work for s390 really, because in its commit
v2.12.0-rc0~41^2~6 QEMU forbade specifying NUMA nodes for s390.
Suppress automatic adding of NUMA node on our side.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
5 months agolibvirt.spec.in: fix indentation
Pavel Hrdina [Mon, 3 Feb 2025 17:35:13 +0000 (18:35 +0100)] 
libvirt.spec.in: fix indentation

Fixes: cf32953f5b6ec30386f71b40cf458467752a6dca
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
5 months agorpm: disable account creation for Fedora >= 42
Daniel P. Berrangé [Wed, 29 Jan 2025 15:52:02 +0000 (15:52 +0000)] 
rpm: disable account creation for Fedora >= 42

In Fedora >= 42, support for user/group account creation based on
sysusers files has been enabled in RPM. Manually running useradd/
groupadd is thus obsolete.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agotools: add sysusers file to create 'virtlogin' group
Daniel P. Berrangé [Wed, 29 Jan 2025 15:37:46 +0000 (15:37 +0000)] 
tools: add sysusers file to create 'virtlogin' group

We previously added a sysusers file, but missed the 'virtlogin' group.
This group is used to make the virt-login-shell binary setgid, so we
shoudl be registering that too. It must be done in a separate sysusers
file, however, since it is packaged separately from the daemons.

Fixes: a2c3e390f7bedf36f4ddc544d09fe3b8772c5c6f
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 months agoNEWS: Document VBOX-6.1 removal
Michal Privoznik [Tue, 28 Jan 2025 12:18:02 +0000 (13:18 +0100)] 
NEWS: Document VBOX-6.1 removal

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agovbox: Drop code supporting old VBox version
Michal Privoznik [Fri, 27 Sep 2024 07:04:17 +0000 (09:04 +0200)] 
vbox: Drop code supporting old VBox version

Now that only supported version of VirtualBox is 7.0.x the code
that supports older versions can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agovbox: Drop support for VirtualBox-6.1.x
Michal Privoznik [Fri, 27 Sep 2024 06:49:22 +0000 (08:49 +0200)] 
vbox: Drop support for VirtualBox-6.1.x

According to VirtualBox download page [1] the support for version
6.1.x was terminated a year ago. Drop support for it.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agovbox: Report an error when VBox CAPI initialization fails
Michal Privoznik [Sat, 5 Oct 2024 21:50:25 +0000 (23:50 +0200)] 
vbox: Report an error when VBox CAPI initialization fails

If initialization of VBOX fails inside of _pfnInitialize an
negative value is returned to signal an error condition to a
caller but no error message is printed out. Reporting an error
may shed more light into why VBOX failed to initialize.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 months agovbox: Use g_autofree in tryLoadOne()
Michal Privoznik [Thu, 26 Sep 2024 08:53:01 +0000 (10:53 +0200)] 
vbox: Use g_autofree in tryLoadOne()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>