]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
16 months agoTranslated using Weblate (Georgian)
Weblate [Mon, 1 Jan 2024 11:37:06 +0000 (12:37 +0100)]
Translated using Weblate (Georgian)

Currently translated at 4.4% (461 of 10414 strings)

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

Co-authored-by: Weblate <noreply-mt-weblate@weblate.org>
Signed-off-by: Weblate <noreply-mt-weblate@weblate.org>
16 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 1 Jan 2024 11:37:06 +0000 (12:37 +0100)]
Translated using Weblate (Swedish)

Currently translated at 59.6% (6211 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 59.2% (6170 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 58.8% (6129 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 58.4% (6088 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 58.0% (6047 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 57.6% (6006 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 57.4% (5985 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
16 months agoqemu: Replace the deprecated short-formed option "unix"
Han Han [Thu, 21 Dec 2023 08:33:38 +0000 (16:33 +0800)]
qemu: Replace the deprecated short-formed option "unix"

Change to the boolean option "unix=on"

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoTranslated using Weblate (Korean)
김인수 [Tue, 19 Dec 2023 15:58:18 +0000 (16:58 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10414 of 10414 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
16 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Tue, 19 Dec 2023 15:58:17 +0000 (16:58 +0100)]
Translated using Weblate (Swedish)

Currently translated at 58.0% (6047 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 57.6% (6006 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 57.4% (5985 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
16 months agoconf: fix integer overflow in virDomainControllerDefParseXML
Egor Makrushin [Wed, 20 Dec 2023 12:38:08 +0000 (15:38 +0300)]
conf: fix integer overflow in virDomainControllerDefParseXML

Multiplication results in integer overflow.
Thus, replace it with ULLONG_MAX and change
def->opts.pciopts.pcihole64size type to ULL.
Update variable usage according to new type.

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

Signed-off-by: Egor Makrushin <emakrushin@astralinux.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoremote: DeserializeDomainDiskErrors: remove dead code
Ján Tomko [Tue, 19 Dec 2023 15:46:53 +0000 (16:46 +0100)]
remote: DeserializeDomainDiskErrors: remove dead code

As of commit b2d079c113a which converted this function to use g_strdup,
the error label is only reached when i = 0, rendering it useless.

Remove it.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/572
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoapparmor: Add capabilities for PCI passthrough to virtxend profile
Jim Fehlig [Mon, 18 Dec 2023 23:48:13 +0000 (16:48 -0700)]
apparmor: Add capabilities for PCI passthrough to virtxend profile

When splitting out the apparmor modular daemon profiles from the
libvirtd profile, the net_admin and sys_admin capabilities were
dropped from the virtxend profile. It was not known at the time
that these capabilities were needed for PCI passthrough. Without
the capabilities, the following messages are emitted from the audit
subsystem

audit: type=1400 audit(1702939277.946:63): apparmor="DENIED" \
operation="capable" class="cap" profile="virtxend" pid=3611 \
comm="rpc-virtxend" capability=21  capname="sys_admin"
audit: type=1400 audit(1702940304.818:63): apparmor="DENIED" \
operation="capable" class="cap" profile="virtxend" pid=3731 \
comm="rpc-virtxend" capability=12  capname="net_admin"

It appears sys_admin is needed to simply read from the PCI dev's
sysfs config file. The net_admin capability is needed when setting
the MAC address of an SR-IOV virtual function.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuDomainBlockPeek: Fix format checking logic
Peter Krempa [Sat, 16 Dec 2023 08:20:41 +0000 (09:20 +0100)]
qemuDomainBlockPeek: Fix format checking logic

Recent refactor which changed the format check to use
qemuBlockStorageSourceIsRaw accidentaly inverted the condition.

Caught by the CI test suite.

Fixes: b600b69f8291226095e0fdb2eb7503baa79063fc
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
16 months agodocs: virtiofs: add section about ID remapping
Ján Tomko [Mon, 11 Sep 2023 13:38:10 +0000 (15:38 +0200)]
docs: virtiofs: add section about ID remapping

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: virtiofs: auto-fill idmap for unprivileged use
Ján Tomko [Wed, 13 Dec 2023 13:05:32 +0000 (14:05 +0100)]
qemu: virtiofs: auto-fill idmap for unprivileged use

If the user did not specify any uid mapping, map its own
user ID to ID 0 inside the container and the rest of the IDs
to the first found user's authorized range in /etc/sub[ug]id

https://issues.redhat.com/browse/RHEL-7386
https://gitlab.com/libvirt/libvirt/-/issues/535

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoutil: add virGetSubUIDs
Ján Tomko [Wed, 13 Dec 2023 11:51:43 +0000 (12:51 +0100)]
util: add virGetSubUIDs

A function for parsing /etc/sub[ug]id

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: allow running virtiofsd in session mode
Ján Tomko [Fri, 1 Sep 2023 14:28:08 +0000 (16:28 +0200)]
qemu: allow running virtiofsd in session mode

https://gitlab.com/libvirt/libvirt/-/issues/535

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: virtiofs: do not force UID 0
Ján Tomko [Thu, 7 Sep 2023 14:22:43 +0000 (16:22 +0200)]
qemu: virtiofs: do not force UID 0

Remove the explicit setting of uid 0 when running virtiofsd.

It is not required for privileged mode, where virtiofsd will be run
as root anyway. And for unprivileged mode, virtiofsd no longer requires
to be run as root.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: format uid/gid map for virtiofs
Ján Tomko [Wed, 16 Aug 2023 13:40:03 +0000 (15:40 +0200)]
qemu: format uid/gid map for virtiofs

Pass the ID map to virtiofsd, which will run the suid `newuidmap`
binary for us.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoconf: add idmap element to filesystem
Ján Tomko [Wed, 16 Aug 2023 12:44:01 +0000 (14:44 +0200)]
conf: add idmap element to filesystem

Allow the user to manually tweak the ID mapping that will allow
virtiofsd to run unprivileged.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoconf: move idmap parsing earlier
Ján Tomko [Wed, 16 Aug 2023 12:52:40 +0000 (14:52 +0200)]
conf: move idmap parsing earlier

It will be reused for <filesystem> as well.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoconf: move idmap definition earlier
Ján Tomko [Wed, 16 Aug 2023 12:47:12 +0000 (14:47 +0200)]
conf: move idmap definition earlier

It will be reused for <filesystem> as well.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuDomainBlockResize: Properly resize disks with storage slice
Peter Krempa [Mon, 11 Dec 2023 14:37:51 +0000 (15:37 +0100)]
qemuDomainBlockResize: Properly resize disks with storage slice

Until now resizing a disk with a storage slice would break in one of the
following ways:

1) for a non-raw format, the virtual size would change, but the slice
would still remain in place
2) for raw disks qemu would refuse to change the size

The only reasonable scenario we want to support is a 'raw' image with 0
offset (inside a block device), where we can just drop the slice.

Anything else comes from a non-standard storage setup that we don't want
to touch.

To facilitate the resize, we first remove the 'size' parameter in qemu
thus dropping the slice and then instructing qemu to resize the disk.

Resolves: https://issues.redhat.com/browse/RHEL-18782
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirStorageSourceSliceFree: Export function
Peter Krempa [Mon, 11 Dec 2023 16:06:32 +0000 (17:06 +0100)]
virStorageSourceSliceFree: Export function

The function will be used in the code for resizing block devices with a
slice.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: block: Format storage slice properties optionally
Peter Krempa [Mon, 11 Dec 2023 16:13:39 +0000 (17:13 +0100)]
qemu: block: Format storage slice properties optionally

Prepare the blockdev props formatter to skip formatting the slice props
in case they are not applicable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: block: Make 'slice' layer effective for 'raw' storage source
Peter Krempa [Mon, 23 Oct 2023 13:46:26 +0000 (15:46 +0200)]
qemu: block: Make 'slice' layer effective for 'raw' storage source

Rather than pulling the configuration of the storage slice into the
'format' layer make the 'slice' layer effective for raw disks with a
storage slice. This was made possible by the recent refactors which made
the 'format' layer optional if not needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuDomainBlockResize: Implement VIR_DOMAIN_BLOCK_RESIZE_CAPACITY
Peter Krempa [Wed, 13 Dec 2023 14:44:36 +0000 (15:44 +0100)]
qemuDomainBlockResize: Implement VIR_DOMAIN_BLOCK_RESIZE_CAPACITY

Resizing of block-backed storage requires the user to pass the exact
capacity of the device. Implement code which will query it instead so
the user doesn't need to do that.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/449
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirDomainBlockResize: Introduce VIR_DOMAIN_BLOCK_RESIZE_CAPACITY
Peter Krempa [Wed, 13 Dec 2023 09:07:52 +0000 (10:07 +0100)]
virDomainBlockResize: Introduce VIR_DOMAIN_BLOCK_RESIZE_CAPACITY

Allow users to easily resize 'raw' images on block devices to the full
capacity of the block device. Obviously this won't work on file-backed
storage (filling the remaining capacity is most likely wrong) or for
formats with metadata due to the overhead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovsh: Introduce simple version of VSH_ALTERNATIVE_OPTIONS_EXPR
Peter Krempa [Wed, 13 Dec 2023 13:23:45 +0000 (14:23 +0100)]
vsh: Introduce simple version of VSH_ALTERNATIVE_OPTIONS_EXPR

VSH_ALTERNATIVE_OPTIONS takes just the name of the options instead of
requiring also the getter functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuDomainBlockResize: Agregate all checks at the beginning
Peter Krempa [Wed, 13 Dec 2023 15:55:59 +0000 (16:55 +0100)]
qemuDomainBlockResize: Agregate all checks at the beginning

Move the check for readonly and empty disks to the top where all other
checks will be done.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: Use qemuBlockStorageSourceIsLUKS/qemuBlockStorageSourceIsRaw
Peter Krempa [Tue, 12 Dec 2023 16:16:25 +0000 (17:16 +0100)]
qemu: Use qemuBlockStorageSourceIsLUKS/qemuBlockStorageSourceIsRaw

Refactor code checking whether image is raw. This fixes multiple places
where a LUKS encrypted disk could be mistreated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: block: Introduce helpers for properly testing for 'raw' and 'luks' images
Peter Krempa [Tue, 12 Dec 2023 16:11:45 +0000 (17:11 +0100)]
qemu: block: Introduce helpers for properly testing for 'raw' and 'luks' images

Unfortunately a LUKS image to be decrypted by qemu has
VIR_STORAGE_FILE_RAW as format, but has encryption properties populated.

Many places in the code don't check it properly and also don't check
properly whether the image is indeed LUKS to be decrypted by qemu.

Introduce helpers which will simplify this task.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Spellchecked-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: migration: Automatically fix non-shared-storage migration to bigger block devices
Peter Krempa [Wed, 6 Dec 2023 14:57:16 +0000 (15:57 +0100)]
qemu: migration: Automatically fix non-shared-storage migration to bigger block devices

QEMU's blockdev-mirror job doesn't allow copy into a destination which
isn't exactly the same size as source. This is a problem for
non-shared-storage migration when migrating into a raw block device, as
there it's very hard to ensure that the destination size will match the
source size.

Rather than failing the migration, we can add a storage slice in such
case automatically and thus make the migration pass.

To do this we need to probe the size of the block device on the
destination and if it differs form the size detected on the source we'll
install the 'slice'.

An additional handling is required when persisting the VM as we want to
propagate the slice even there to ensure that the device sizes won't
change.

Resolves: https://issues.redhat.com/browse/RHEL-4607
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: Move and export qemuDomainStorageUpdatePhysical and dependencies
Peter Krempa [Wed, 6 Dec 2023 14:42:29 +0000 (15:42 +0100)]
qemu: Move and export qemuDomainStorageUpdatePhysical and dependencies

Move qemuDomainStorageUpdatePhysical, qemuDomainStorageOpenStat,
qemuDomainStorageCloseStat to qemu_domain.c and export them. They'll be
reused in the migration code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: migration: Rename qemuMigrationDstPrecreateStorage to qemuMigrationDstPrepareSt...
Peter Krempa [Wed, 6 Dec 2023 13:58:48 +0000 (14:58 +0100)]
qemu: migration: Rename qemuMigrationDstPrecreateStorage to qemuMigrationDstPrepareStorage

The function will be used to setup storage for non-shared-storage
migration, not just precreate images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuDomainStorageOpenStat: Remove unused 'driver' argument and untangle callers
Peter Krempa [Wed, 6 Dec 2023 14:29:03 +0000 (15:29 +0100)]
qemuDomainStorageOpenStat: Remove unused 'driver' argument and untangle callers

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemu: migration: Improve handling of VIR_MIGRATE_PARAM_DEST_XML with VIR_MIGRATE_PERS...
Peter Krempa [Thu, 7 Dec 2023 14:22:58 +0000 (15:22 +0100)]
qemu: migration: Improve handling of VIR_MIGRATE_PARAM_DEST_XML with VIR_MIGRATE_PERSIST_DEST

When a user provides a migration XML via the VIR_MIGRATE_PARAM_DEST_XML
it's expected that they want to change ABI-compatible aspects of the XML
such as the disk paths or similar.

If the user requests persisting of the VM but does not provide an
explicit persistent XML libvirt would take the persistent XML from the
source of the migration as the persistent config. This usually involves
the old paths to images.

Doing this would result into failure to start the VM.

It makes more sense to take the XML used for migration and use that as
the base for persisting the config.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuMigrationDstPrecreateStorage: Fix and clarify logic
Peter Krempa [Wed, 6 Dec 2023 13:47:01 +0000 (14:47 +0100)]
qemuMigrationDstPrecreateStorage: Fix and clarify logic

While it's intended that qemuMigrationDstPrecreateDisk is called with
any kind of the disk, the logic in qemuMigrationDstPrecreateStorage
which checks the existence of the image wouldn't properly handle e.g.
network backed disks, where it would attempt to use virFileExists() on
the disk's 'src->path'.

Fix the logic by first skipping disks not meant for migration, then do
the existence check only when 'disk->src' is local storage.

Since qemuMigrationDstPrecreateDisk has a debug statement there's no
need to have an extra one right before calling into it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuMigrationDstPrecreateStorage: Refactor cleanup
Peter Krempa [Wed, 6 Dec 2023 13:32:09 +0000 (14:32 +0100)]
qemuMigrationDstPrecreateStorage: Refactor cleanup

Use automatic pointer freeing for 'conn' and remove the 'cleanup' label.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoqemuMigrationDstPrecreateStorage: Improve error messages
Peter Krempa [Wed, 6 Dec 2023 13:30:24 +0000 (14:30 +0100)]
qemuMigrationDstPrecreateStorage: Improve error messages

Change the error messages so that they can be used to identify the
problematic disk or image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 11 Dec 2023 11:44:02 +0000 (12:44 +0100)]
Translated using Weblate (Swedish)

Currently translated at 57.1% (5954 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
16 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Sun, 10 Dec 2023 10:44:00 +0000 (11:44 +0100)]
Translated using Weblate (Swedish)

Currently translated at 56.9% (5933 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 56.7% (5912 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
16 months agoremote: Fix cached hypervisor type
Jim Fehlig [Fri, 8 Dec 2023 01:38:22 +0000 (18:38 -0700)]
remote: Fix cached hypervisor type

Commit 501825011c switched the remote driver to using g_auto, but missed
one case of needing to steal a pointer holding the hypervisor type.
Without it, memory is freed and the output of 'virsh version' has random
output

Compiled against library: libvirt 10.0.0
Using library: libvirt 10.0.0
Using API: ��%�U 10.0.0
Running hypervisor: ��U 8.1.3

Ths change also fixes random SIGABRT from perl processes running
libvirt-tck tests.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 7 Dec 2023 21:43:57 +0000 (22:43 +0100)]
Translated using Weblate (Swedish)

Currently translated at 56.3% (5871 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
16 months agovirNodeDeviceCapStorageDefFormatBlocksize: Report sector size and count together
Peter Krempa [Thu, 7 Dec 2023 12:01:34 +0000 (13:01 +0100)]
virNodeDeviceCapStorageDefFormatBlocksize: Report sector size and count together

Report both block count and size together when either one of them is
present equivalently to what the schema type 'blockData' in
'schemas/nodedev.rng' defines.

Resolves: https://issues.redhat.com/browse/RHEL-18165
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirNodeDeviceCapStorageDefFormat: Extract formatting of block size data
Peter Krempa [Thu, 7 Dec 2023 11:56:14 +0000 (12:56 +0100)]
virNodeDeviceCapStorageDefFormat: Extract formatting of block size data

Unfortunately the XML is designed in a weird way, where based on whether
media in the device is removable the sizing is either part of a
subelement or placed directly on top level. The logic itself is
identical so it can be extracted into a function to simplify the
formatter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirNodeDeviceCapStorageDefFormat: Don't check argument for virBufferEscapeString
Peter Krempa [Thu, 7 Dec 2023 11:48:15 +0000 (12:48 +0100)]
virNodeDeviceCapStorageDefFormat: Don't check argument for virBufferEscapeString

virBufferEscapeString is specifically designed for formatting XMLs and
thus skips the whole formatting if the singular string argument is NULL.

Remove redundant conditions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirsh: migrate: Fix logic bug in interlock of --copy-storage-synchronous-writes flag
Peter Krempa [Wed, 6 Dec 2023 07:36:13 +0000 (08:36 +0100)]
virsh: migrate: Fix logic bug in interlock of --copy-storage-synchronous-writes flag

As the error message states we want to check that one of
'--copy-storage-all' or '--copy-storage-inc' is used, but the condition
mentioned VIR_MIGRATE_NON_SHARED_DISK twice.

Fixes: 1c2bd205edd
Resolves: https://issues.redhat.com/browse/RHEL-17596
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
16 months agovirsh: migrate: Interlock '--copy-storage-all' and '--copy-storage-inc'
Peter Krempa [Tue, 5 Dec 2023 16:19:19 +0000 (17:19 +0100)]
virsh: migrate: Interlock '--copy-storage-all' and '--copy-storage-inc'

The API treats them as mutually exclusive and interlocks them at the
library handler. Provide better error in virsh.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: migration: Validate migration XML
Peter Krempa [Tue, 5 Dec 2023 15:17:57 +0000 (16:17 +0100)]
qemu: migration: Validate migration XML

There's no point in skiping the validation step:
- on the source, the VM is parsed for ABI stability checking, thus the
  equivalent config was validated when the VM was started

- on the destination, the XML will be validated inside qemuProcessInit
  very soon after it is parsed

This fixes problems such as if the user uses a relative path in the disk
source or omits the source, as the disk migration code reasonably
expects that all checks were performed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agosecurity_util: fix log in virSecurityMoveRememberedLabel
Anastasia Belova [Wed, 6 Dec 2023 18:45:00 +0000 (21:45 +0300)]
security_util: fix log in virSecurityMoveRememberedLabel

Fix incorrect log message for timestamp value.
Probably this line was copied from the check for attr.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 7cfb7aab57 ("security_util: Remove stale XATTRs")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
16 months agonetwork: convert virFileLinkPointsTo to return bool
Anastasia Belova [Thu, 7 Dec 2023 09:09:38 +0000 (12:09 +0300)]
network: convert virFileLinkPointsTo to return bool

Convert prototype of virFileLinkPointsTo to return bool.
Remove dead checks in virDomainObjListLoadConfig and
virNetworkLoadConfig.

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

Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
16 months agotest: remove redundant cpuTestGuestCPUID test
Jonathon Jongsma [Thu, 2 Nov 2023 18:59:40 +0000 (13:59 -0500)]
test: remove redundant cpuTestGuestCPUID test

DO_TEST_CPUID(arch, host, json) is a multipart test. It consists of the
following tests:
 - cpuTestHostCPUID()
 - cpuTestGuestCPUID(with JSON_* flag)
 - cpuTestCPUIDSignature()
 - DO_TEST_JSON():
   - if json==JSON_MODELS:
     - cpuTestGuestCPUID(without JSON_* flag)
   - cpuTestJSONCPUID()
   - cputestJSONSignature()

Notice that for tests with json==JSON_MODELS, cpuTestGuestCPUID() is
actually called twice but with different arguments. The first one passes
JSON_MODELS to the test function, while the second one passes 0.

The main difference in behavior when calling cpuTestGuestCPUID() with or
without the flag is that in the first case, it parses the captured qemu
output from $ARCH-cpuid-$CPU.json. It extracts the cpu model list from
that JSON, and uses that to filter out possible cpu models to match.
In other words, it tries to match the cpu to a model that was supported
by the qemu version that was used to generate this JSON file. When it
finds a match, it generates a cpu definition and compares the xml form
of that definition with the file $ARCH-cpuid-$CPU-guest.xml.

When called without the JSON_MODELS flag, it simply attempts to match it
against the full libvirt cpu map and doesn't attempt to filter out any
matches based on the JSON qemu cpu model list. After it finds a match,
it generates an xml definition for the cpu and compares it to the same
file listed above. So if these two invocations disagree on the cpu match
(e.g. because libvirt has added a cpu model to its cpu map that matches
better than one that was supported by the version of qemu that generated
the JSON file) the test will fail.

This duplicate call to cpuTestGuestCPUID() was originally added in
commit 49c945a6f5c885394507f88086cc2f9461df7c27. The original
justification for that commit was to fix test failures when the Qemu
driver was disabled. But since DO_TEST_JSON() is #defined empty when
qemu is disabled, this particular invocation would not even be executed
in this scenario, so it doesn't seem relevant.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agorpc: don't try to spawn non-existant daemon
Daniel P. Berrangé [Wed, 25 Jan 2023 14:23:48 +0000 (14:23 +0000)]
rpc: don't try to spawn non-existant daemon

If libvirt is built in client only mode, the libvirtd/virtqemud/etc
daemons won't exist. If the client is told to connect to a local
hypervisor, it'll see the socket doesn't exist, try to spawn the
daemon and then re-try connecting to the socket for a few seconds.
Ultimately this will fail because the daemon doesn't exist and the
user gets an error message

  error: Failed to connect socket to '/run/user/1000/libvirt/virtqemud-sock': No such file or directory

technically this is accurate, but it doesn't help identify the root
cause. With this change it will now report

  error: binary 'virtqemud' does not exist in $PATH: No such file or directory

and will skip all the socket connect retries

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
17 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 6 Dec 2023 11:44:05 +0000 (12:44 +0100)]
Translated using Weblate (Swedish)

Currently translated at 56.1% (5850 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
17 months agoqemuDomainChangeNet: Reflect trustGuestRxFilters change
Michal Privoznik [Tue, 5 Dec 2023 13:32:48 +0000 (14:32 +0100)]
qemuDomainChangeNet: Reflect trustGuestRxFilters change

On device-update, when user requests change of
trustGuestRxFilters we currently do nothing. Nor error out, nor
act on the request. While we can just throw an error,
implementing this is pretty trivial.

Resolves: https://issues.redhat.com/browse/RHEL-735
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemuMonitorJSONQueryRxFilter: Allow @filter to be NULL
Michal Privoznik [Tue, 5 Dec 2023 13:39:58 +0000 (14:39 +0100)]
qemuMonitorJSONQueryRxFilter: Allow @filter to be NULL

Sometimes it may be handy to just issue the query-rx-filter
monitor command without actually parsing the output. Adapt
qemuMonitorJSONQueryRxFilter() to this behavior.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemu: Relax check for memory device coldplug
Michal Privoznik [Thu, 30 Nov 2023 12:26:14 +0000 (13:26 +0100)]
qemu: Relax check for memory device coldplug

When cold plugging a memory device we check whether there's
enough free memory slots to accommodate new module. Well, this
checks makes sense only for those memory devices that are plugged
into DIMM slots (DIMM and NVDIMM models). Other memory device
models, like VIRTIO_MEM, VIRTIO_PMEM or SGX_EPC are attached into
PCI bus, or no bus at all.

Resolves: https://issues.redhat.com/browse/RHEL-15480
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
17 months agoqemu: Move memory device coldplug into a separate function
Michal Privoznik [Mon, 4 Dec 2023 08:33:36 +0000 (09:33 +0100)]
qemu: Move memory device coldplug into a separate function

The code that handles coldplug of a memory device is pretty
trivial and such could continue to live in the huge switch()
where other devices are handled. But the code is about to get
more complicated. To help with code readability, move it into a
separate function.

And while at it, make the function accept a double pointer to the
memory device definition to make the ownership transfer obvious
(the device is part of the domain on successful run).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
17 months agovir-qemu-sev-validate: Use string() method in xpath
Han Han [Mon, 4 Dec 2023 10:07:20 +0000 (18:07 +0800)]
vir-qemu-sev-validate: Use string() method in xpath

For the xpath "/domain/cpu/@mode", it will return a list type not a
string. Use string() method in the xpath for the string result.

Fixes: 6b95437c17
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agoci: Stop passing --nodeps to rpmbuild
Andrea Bolognani [Tue, 28 Nov 2023 18:25:46 +0000 (19:25 +0100)]
ci: Stop passing --nodeps to rpmbuild

All BuildRequires should now be part of the build environment,
so it's no longer needed.

This ensures that, if we forget to add some BuildRequires to the
build environment in the future, the mistake will be quickly
detected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agoci: Refresh generated files
Andrea Bolognani [Thu, 30 Nov 2023 18:31:57 +0000 (19:31 +0100)]
ci: Refresh generated files

Add black, drop scrub.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agorpm: Drop BuildDepends on passt
Andrea Bolognani [Tue, 28 Nov 2023 18:25:28 +0000 (19:25 +0100)]
rpm: Drop BuildDepends on passt

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agorpm: Drop BuildDepends on scrub
Andrea Bolognani [Thu, 30 Nov 2023 17:23:46 +0000 (18:23 +0100)]
rpm: Drop BuildDepends on scrub

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agorpm: Add Requires on scrub
Andrea Bolognani [Thu, 30 Nov 2023 17:22:54 +0000 (18:22 +0100)]
rpm: Add Requires on scrub

We currently have a BuildDepends on it, which doesn't help
ensuring that the tool is available at runtime, when the storage
driver might need to spawn it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agomeson: Stop looking for passt at build time
Andrea Bolognani [Tue, 28 Nov 2023 18:24:39 +0000 (19:24 +0100)]
meson: Stop looking for passt at build time

We only use it at runtime, not during the build process.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agomeson: Stop looking for scrub at build time
Andrea Bolognani [Thu, 30 Nov 2023 17:21:43 +0000 (18:21 +0100)]
meson: Stop looking for scrub at build time

We only use it at runtime, not during the build process.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agomeson: Stop looking for udevadm at build time
Andrea Bolognani [Thu, 30 Nov 2023 17:06:31 +0000 (18:06 +0100)]
meson: Stop looking for udevadm at build time

We only use it at runtime, not during the build process.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agorpm: Drop MinGW BuildRequires on libgcrypt/libgpg-error
Andrea Bolognani [Wed, 29 Nov 2023 16:33:35 +0000 (17:33 +0100)]
rpm: Drop MinGW BuildRequires on libgcrypt/libgpg-error

They've been there since the start, but we don't seem to be using
them for anything. The native part doesn't have BuildRequires on
the native equivalents.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agodocs: Mention use of DuckDuckGo
Andrea Bolognani [Mon, 4 Dec 2023 11:06:17 +0000 (12:06 +0100)]
docs: Mention use of DuckDuckGo

The fact that we use an external search provider instead of a
built-in search functionality might come as a surprise to users,
and some of them might not be comfortable with the arrangement.

Mention it in the search interface to avoid surprises.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
17 months agodocs: Use DuckDuckGo for website/wiki search
Andrea Bolognani [Mon, 4 Dec 2023 11:09:32 +0000 (12:09 +0100)]
docs: Use DuckDuckGo for website/wiki search

Ideally we'd just perform the search ourselves, but as long as
we have to rely on an external provider, at least make it a
somewhat privacy-conscious one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
17 months agogitpublish: Tweak prefix
Andrea Bolognani [Fri, 1 Dec 2023 16:12:48 +0000 (17:12 +0100)]
gitpublish: Tweak prefix

Having the name of the project as part of the prefix was useful
back when we used the mailing list for all subprojects, but
these days the only patches that are sent to the list are for
the main library so it no longer makes sense to include this.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
17 months agovircpi: Decrease scope of VIR_PCI_DEVICE_ADDRESS_FMT macro
Michal Privoznik [Tue, 28 Nov 2023 15:31:00 +0000 (16:31 +0100)]
vircpi: Decrease scope of VIR_PCI_DEVICE_ADDRESS_FMT macro

The VIR_PCI_DEVICE_ADDRESS_FMT macro is used only in virpci.c and
nowhere else. It's not necessary to expose it in the header file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemu_command: Don't open code virPCIDeviceAddressAsString()
Michal Privoznik [Tue, 28 Nov 2023 15:06:30 +0000 (16:06 +0100)]
qemu_command: Don't open code virPCIDeviceAddressAsString()

When building a hostdev props, its PCI address is formatted via
g_strdup_printf(VIR_PCI_DEVICE_ADDRESS_FMT, ...); Well, we have a
function that does exactly that: virPCIDeviceAddressAsString().
Use the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agovirpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro
Michal Privoznik [Tue, 28 Nov 2023 15:02:00 +0000 (16:02 +0100)]
virpci: Decrease scope of VIR_PF_PHYS_PORT_NAME_REGEX macro

The VIR_PF_PHYS_PORT_NAME_REGEX macro is used only in
virPCIGetNetName() and nowhere else. It's not necessary to expose
it in the header file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 4 Dec 2023 08:10:22 +0000 (09:10 +0100)]
Translated using Weblate (Swedish)

Currently translated at 55.7% (5808 of 10417 strings)

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

Translated using Weblate (Swedish)

Currently translated at 55.5% (5787 of 10417 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
17 months agotest_driver: Remove unused variable in testDomainAttachDeviceLiveAndConfig()
Michal Privoznik [Mon, 4 Dec 2023 08:50:17 +0000 (09:50 +0100)]
test_driver: Remove unused variable in testDomainAttachDeviceLiveAndConfig()

The hotplug functionality added earlier really supports only live
addition of devices, no coldplug yet rendering @devConf in
testDomainAttachDeviceLiveAndConfig() an unused variable. Remove
it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
17 months agotest_driver: Support for hotplug/hotunplug of PCI devices
Thanos Makatos [Thu, 9 Nov 2023 11:14:39 +0000 (11:14 +0000)]
test_driver: Support for hotplug/hotunplug of PCI devices

Add a basic support for hotplug and hotunplug of PCI
<hostdev/>-s.

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agoNEWS: Fix indentation
Andrea Bolognani [Fri, 1 Dec 2023 15:58:35 +0000 (16:58 +0100)]
NEWS: Fix indentation

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
17 months agoNEWS: Fix vertical spacing
Andrea Bolognani [Fri, 1 Dec 2023 15:57:35 +0000 (16:57 +0100)]
NEWS: Fix vertical spacing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
17 months agoPost-release version bump to 10.0.0
Jiri Denemark [Fri, 1 Dec 2023 15:24:28 +0000 (16:24 +0100)]
Post-release version bump to 10.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
17 months agoRelease of libvirt-9.10.0
Jiri Denemark [Fri, 1 Dec 2023 15:11:26 +0000 (16:11 +0100)]
Release of libvirt-9.10.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
17 months agorpcgen: Skip generator tests on macOS
Andrea Bolognani [Thu, 30 Nov 2023 18:34:55 +0000 (19:34 +0100)]
rpcgen: Skip generator tests on macOS

The generator can produce different code on Linux and macOS:
specifically, on the former we want to use xdr_uint64_t while
the latter needs xdr_u_int64_t instead.

This is clearly a problem for tests that involve comparing the
output produced against some expected output that's stored in
the git repository.

In the long run, we need to find a better way to handle this,
but since 9.10.0 is going to be released very soon and we don't
want it to have a broken test suite on macOS, simply skip the
generator tests on that platform for now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
17 months agoscripts/rpcgen: fix 64 unsigned int test on macOS
Daniel P. Berrangé [Thu, 30 Nov 2023 14:07:55 +0000 (14:07 +0000)]
scripts/rpcgen: fix 64 unsigned int test on macOS

macOS XDR library is an oddball using xdr_u_int64_t instead of
xdr_uint64_t which everyone else has.

The code generator already does the right thing, but the test
program previously generated with the Linux rpcgen program
does not compile on macOS due to this.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
17 months agorpcgen: Pass 3 arguments to xdrproc_t calls
Andrea Bolognani [Thu, 30 Nov 2023 10:03:10 +0000 (11:03 +0100)]
rpcgen: Pass 3 arguments to xdrproc_t calls

The test_demo program currently fails to compile on macOS with

  too few arguments to function call, expected 3, have 2
      ret = !!proc(&xdr, vorig);
              ~~~~            ^

Way back in 2013, commit 9fa3a8ab6fd8 handled this situation
for the main library code. Apply the same fix here.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
17 months agoci: Refresh generated files
Andrea Bolognani [Tue, 28 Nov 2023 18:23:52 +0000 (19:23 +0100)]
ci: Refresh generated files

This adds pytest everywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agorpcgen: Reformat meson files
Andrea Bolognani [Wed, 29 Nov 2023 16:44:13 +0000 (17:44 +0100)]
rpcgen: Reformat meson files

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agorpcgen: Skip tests if tests are disabled
Andrea Bolognani [Wed, 29 Nov 2023 16:43:16 +0000 (17:43 +0100)]
rpcgen: Skip tests if tests are disabled

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agorpcgen: Organize meson tests into suites
Andrea Bolognani [Wed, 29 Nov 2023 16:23:25 +0000 (17:23 +0100)]
rpcgen: Organize meson tests into suites

These are currently the only tests that are not part of any
suite.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agorpcgen: Don't skip all tests when pytest is missing
Andrea Bolognani [Wed, 29 Nov 2023 14:50:30 +0000 (15:50 +0100)]
rpcgen: Don't skip all tests when pytest is missing

Some of the files used by test_demo.c can only be regenerated
when pytest is present, but we have pre-generated copies in the
repository, so overall we just need the C compiler to build and
run that specific test program.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
17 months agoTranslated using Weblate (Korean)
김인수 [Thu, 30 Nov 2023 13:44:51 +0000 (14:44 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10414 of 10414 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
17 months agoUpdate translation files
Weblate [Thu, 30 Nov 2023 13:44:49 +0000 (14:44 +0100)]
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/

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
17 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 30 Nov 2023 13:44:46 +0000 (14:44 +0100)]
Translated using Weblate (Swedish)

Currently translated at 54.9% (5725 of 10414 strings)

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

Translated using Weblate (Swedish)

Currently translated at 54.3% (5664 of 10414 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
17 months agoNEWS: Mention image probing, snaphsot and hotplug fixes
Peter Krempa [Fri, 1 Dec 2023 10:15:59 +0000 (11:15 +0100)]
NEWS: Mention image probing, snaphsot and hotplug fixes

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
17 months agoqemuProcessStartWithMemoryState: Don't start qemu with '-loadvm SNAP' and '-incoming...
Peter Krempa [Fri, 1 Dec 2023 09:28:48 +0000 (10:28 +0100)]
qemuProcessStartWithMemoryState: Don't start qemu with '-loadvm SNAP' and '-incoming defer' together

A bug in qemuProcessStartWithMemoryState caused that we would start qemu
with '-loadvm SNAP' and '-incoming defer' together.  qemu doesn't expect
that and crashes on an assertion failure [1].

[1]: https://issues.redhat.com/browse/RHEL-16782

Fixes: 8a88d3e5860881f430e528d3e5e8d6455ded4d1d
Resolves: https://issues.redhat.com/browse/RHEL-17841
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
17 months agorpcgen: tests: Run cleanly on platforms where char is unsigned
Michal Privoznik [Wed, 29 Nov 2023 11:30:16 +0000 (12:30 +0100)]
rpcgen: tests: Run cleanly on platforms where char is unsigned

There are some platforms where 'char' is unsigned, by default
(RPi, s390x to name a few). And because of how test_demo is
written we are experiencing some test cases failing there. For
instance: /xdr/struct-scalar is failing. This is because in the
test (test_struct_scalar()), we have a struct with two chars. One
is initialized to 0xca, the other 0xfe (note that both have the
MSB set). The XDR encoder (xdr_TestStructScalar()) then calls
xdr_char() on both of them. But XDR itself has no notion of
char type, so under the hood, it expands it to int [1] and calls
xdr_int(). And this is where the problem lies. On platforms where
char is signed, the integer expansion results in 0xffffffca, but
on platforms where char is unsigned it results in 0x000000ca. Two
distinct results.

The test then goes and compares the encoded buffer with an
expected one (memcmp(), read from the disk earlier).

This poses no problem for real life use, because when decoding
those chars back, the padding is thrown away.

To avoid tickling this issue, use values that don't have the MSB
set.

1: https://git.linux-nfs.org/?p=steved/libtirpc.git;a=blob;f=src/xdr.c;h=28d1382cc4853ecf1238d792af5016160435d1e0;hb=HEAD#l487

Fixes: 40cbaa8fbe rpcgen: add test case for XDR serialization
Reported-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
17 months agorpcgen: tests: Allow running test_demo from anywhere
Michal Privoznik [Wed, 29 Nov 2023 11:22:21 +0000 (12:22 +0100)]
rpcgen: tests: Allow running test_demo from anywhere

The test_demo program compares whether XDR encoded data match the
expected output as read from a file. But the file path is not
absolute and thus relative to CWD which means the program can run
only from one specific directory.

Do what we do in the rest of our test suite: define 'abs_srcdir'
macro and prefix the path with it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
17 months agoch: Don't leak ch_driver->chCaps
Michal Privoznik [Tue, 28 Nov 2023 15:35:22 +0000 (16:35 +0100)]
ch: Don't leak ch_driver->chCaps

During CH driver initialization (chStateInitialize()) the
driver's capabilities bitmap is allocated
(virCHCapsInitCHVersionCaps()), but corresponding free call is
missing in chStateCleanup().

And while at it, reorder calls to virObjectUnref() inside of
chStateCleanup() to be the reverse order of that in
chStateInitialize() so that it's easier to spot missing
free/unref call.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agorpm: Drop rpcgen Build-Requires once again
Andrea Bolognani [Tue, 28 Nov 2023 17:51:04 +0000 (18:51 +0100)]
rpm: Drop rpcgen Build-Requires once again

We no longer use it, so commit a62486b95fee correctly dropped
the Build-Requires; shortly afterwards, however, I accidentally
reintroduced it by mistake.

Fixes: 3df8cc658ed0ac2f84089ad0db61ba20eb8b8aa7
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
17 months agopo: Refresh potfile for v9.10.0
Jiri Denemark [Mon, 27 Nov 2023 12:13:31 +0000 (13:13 +0100)]
po: Refresh potfile for v9.10.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
17 months agoqemuMigrationSrcNBDStorageCopyBlockdevPrepareSource: Don't setup 'raw' layer for...
Peter Krempa [Tue, 14 Nov 2023 16:19:10 +0000 (17:19 +0100)]
qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource: Don't setup 'raw' layer for migration NBD connection

The raw driver layer is not needed in this case and can be dropped.
Removing the nodename will cause other pieces of the code to pick up and
stop adding the layer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemu: block: Remove unused qemuBlockStorageSourceDetachOneBlockdev
Peter Krempa [Tue, 14 Nov 2023 16:09:03 +0000 (17:09 +0100)]
qemu: block: Remove unused qemuBlockStorageSourceDetachOneBlockdev

The only caller was converted to use the common blockdev infrastructure
thus this function is no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemuMigrationSrcNBDCopyCancel: Use qemuBlockStorageSourceAttachRollback to detach...
Peter Krempa [Tue, 14 Nov 2023 16:07:44 +0000 (17:07 +0100)]
qemuMigrationSrcNBDCopyCancel: Use qemuBlockStorageSourceAttachRollback to detach migration NBD blockdevs

Rewrite the code to use the common tooling for removing blockdevs
instead of the ad-hoc qemuBlockStorageSourceDetachOneBlockdev helper.

Use of the common infrastructure will properly handle cases when the raw
driver is ommited from the block graph.

Since the TLS data object is shared for all migration QMP commands and
objects we need to strip its alias from the definition of the storage
source before attempting to detach it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
17 months agoqemuBlockReopenAccess: prepare for removal of 'raw' format layer
Peter Krempa [Wed, 22 Nov 2023 15:58:12 +0000 (16:58 +0100)]
qemuBlockReopenAccess: prepare for removal of 'raw' format layer

Make the helper reopening a blockdev for access pick the correct layer
to reopen based on what is currently in use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>