]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
16 months agoqemuxml*test: Improve 'vhost_queues' test case
Peter Krempa [Mon, 4 Dec 2023 14:58:39 +0000 (15:58 +0100)]
qemuxml*test: Improve 'vhost_queues' test case

Modify the test case so that it can be used also for qemuxml2argvtest
by removing invalid configuration (interface type='user' + queues),
clean up unneeded disks and rename it accordingly. Also test the
ioeventfd.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2*test: Add specific test case for interface link state
Peter Krempa [Mon, 4 Dec 2023 14:26:13 +0000 (15:26 +0100)]
qemuxml2*test: Add specific test case for interface link state

Test both linkstates in an explicit test case. Note that link state is
setup via monitor, thus not visible on the commandline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2xmltest: Move 'graphics-listen-network2' case go genericxml2xmltest
Peter Krempa [Mon, 4 Dec 2023 13:16:13 +0000 (14:16 +0100)]
qemuxml2xmltest: Move 'graphics-listen-network2' case go genericxml2xmltest

The tested configuration is not valid for a qemu VM. Move it to the
generic test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Add test cases covered only by qemuxml2xmltest - part 1
Peter Krempa [Fri, 1 Dec 2023 15:53:32 +0000 (16:53 +0100)]
qemuxml2argvtest: Add test cases covered only by qemuxml2xmltest - part 1

There were plenty of test cases invoked only from qemuxml2xmltest but
not from qemuxml2argvtest, either by accident or it was deemed unneeded.

Bulk-add all test cases which fit the above description which don't
require faking the network driver. Use same invocation as present in
qemuxml2xmltest.

Arguably in certain cases we could move the test case to
genericxml2xmltest, but this covers the cases when that would not be
appropriate.

Tests requiring the network driver will be bulk-added when the fake
network driver will be implemented.

This patch also allows the use of FLAG_SKIP_CONFIG_ACTIVE in
qemuxml2argvtest although the flag will be dormant for now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvmock: Mock qemuInterfaceBridgeConnect
Peter Krempa [Fri, 1 Dec 2023 22:11:11 +0000 (23:11 +0100)]
qemuxml2argvmock: Mock qemuInterfaceBridgeConnect

Prepare for test cases which would want to call that function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Check for duplicate invocation of tests
Peter Krempa [Fri, 1 Dec 2023 15:27:26 +0000 (16:27 +0100)]
qemuxml2argvtest: Check for duplicate invocation of tests

Prevent duplicated invocation of tests by tracking use of output files.
Some cases need to be exempt from this for now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Remove duplicated invocations of tests
Peter Krempa [Fri, 1 Dec 2023 15:37:47 +0000 (16:37 +0100)]
qemuxml2argvtest: Remove duplicated invocations of tests

'parallel-tcp-chardev', 'parallel-parport-chardev' are invoked twice
with exactly the same parameters, remove the duplicity.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvdata: Move 'smbios-multiple-type2' case to genericxml2xmltest
Peter Krempa [Fri, 1 Dec 2023 15:12:42 +0000 (16:12 +0100)]
qemuxml2argvdata: Move 'smbios-multiple-type2' case to genericxml2xmltest

The qemu driver explicitly rejects such configuration, thus this is just
a generic XML2XML test case. Move it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Reinstate 'pseries-vio-address-clash' case
Peter Krempa [Fri, 1 Dec 2023 14:24:34 +0000 (15:24 +0100)]
qemuxml2argvtest: Reinstate 'pseries-vio-address-clash' case

The case was removed in commit 8ff73d22c7405049452e2bf7f281f7460a6b9d10
which modernized the cases without an explicit reason. Reinstate it.

Fixes: 8ff73d22c7405049452e2bf7f281f7460a6b9d10
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Fix and use 'disk-network-ssh-key' case
Peter Krempa [Fri, 1 Dec 2023 14:19:15 +0000 (15:19 +0100)]
qemuxml2argvtest: Fix and use 'disk-network-ssh-key' case

The test case was introduced by commit 68599168ea8185689bd227e6d142e3d933558f84
but is only used in the qemunbdkittest. Fix it and make use of it also
in qemuxml2argvtest.

Fixes: 68599168ea8185689bd227e6d142e3d933558f84
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemuxml2argvtest: Reinstate 'console-compat-chardev' and 'pci-serial-dev-chardev'
Peter Krempa [Fri, 1 Dec 2023 14:14:00 +0000 (15:14 +0100)]
qemuxml2argvtest: Reinstate 'console-compat-chardev' and 'pci-serial-dev-chardev'

The tests invocations were accidentaly removed in commit
54257ed51b5132032cedb7e1e7b8c34b9ae52115

Fixes: 54257ed51b5132032cedb7e1e7b8c34b9ae52115
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu: add runtime config option for nbdkit
Jonathon Jongsma [Wed, 8 Nov 2023 19:14:50 +0000 (13:14 -0600)]
qemu: add runtime config option for nbdkit

Currently when we build with nbdkit support, libvirt will always try to
use nbdkit to access remote disk sources when it is available. But
without an up-to-date selinux policy allowing this, it will fail.
because the required selinux policies are not yet widely available, we
have disabled nbdkit support on rpm builds for all distributions before
Fedora 40.

Unfortunately, this makes it more difficult to test nbdkit support.
After someone updates to the necessary selinux policies, they would also
need to rebuild libvirt to enable nbdkit support. By introducing a
configure option (nbdkit_config_default), we can build packages with
nbdkit support but have it disabled by default.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Suggested-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
16 months agonode_device: udevGetStringSysfsAttr() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:17:03 +0000 (03:17 +0300)]
node_device: udevGetStringSysfsAttr() to void

udevGetStringSysfsAttr() return value is invariant, so change it
type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agonode_device: udevTranslatePCIIds() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:17:02 +0000 (03:17 +0300)]
node_device: udevTranslatePCIIds() to void

udevTranslatePCIIds() return value is invariant, so change it
type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agovirprocess: virProcessGetNamespaces() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:17:01 +0000 (03:17 +0300)]
virprocess: virProcessGetNamespaces() to void

virProcessGetNamespaces() return value is invariant, so change it
type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoconf: virDomainNetUpdate() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:17:00 +0000 (03:17 +0300)]
conf: virDomainNetUpdate() to void

virDomainNetUpdate() return value is invariant, so change it type
and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agolxc: virLXCControllerAddConsole() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:16:59 +0000 (03:16 +0300)]
lxc: virLXCControllerAddConsole() to void

virLXCControllerAddConsole() return value is invariant, so change
it type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agorpc: virnetserver: virNetServerAddService() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:16:58 +0000 (03:16 +0300)]
rpc: virnetserver: virNetServerAddService() to void

virNetServerAddService() return value is invariant, so change it
type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agocpu: : virCPUx86DataAddItem() to void
Artem Chernyshev [Thu, 4 Jan 2024 00:16:57 +0000 (03:16 +0300)]
cpu: : virCPUx86DataAddItem() to void

virCPUx86DataAddItem() return value is invariant, so change it
type and remove all dependent checks.

Functions changed to void:

virCPUx86DataAddItem()
x86DataAdd()
virCPUx86DataAdd()
x86DataAddSignature()
virCPUx86DataSetSignature()
libxlCapsAddCPUID()
cpuidSetLeaf4()
cpuidSetLeaf7()
cpuidSetLeafB()
cpuidSetLeafD()
cpuidSetLeafResID()
cpuidSetLeaf12()
cpuidSetLeaf14()
cpuidSetLeaf17()

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoqemu_driver: Don't handle the EOF event if vm get restarted
Guoyi Tu [Thu, 7 Dec 2023 12:52:39 +0000 (20:52 +0800)]
qemu_driver: Don't handle the EOF event if vm get restarted

Currently, libvirt creates a thread pool with only on thread to handle all
qemu monitor events for virtual machines, In the cases that if the thread
gets stuck while handling a monitor EOF event, such as unable to kill the
virtual machine process or release resources, the events of other virtual
machine will be also blocked, which will lead to the abnormal behavior of
other virtual machines.

For instance, when another virtual machine completes a shutdown operation
and the monitor EOF event has been queued but remains unprocessed, we
immediately destroy and start the virtual machine again, at a later time
when EOF event get processed, the processMonitorEOFEvent() will kill the
virtual machine that just started.

To address this issue, in the processMonitorEOFEvent(), we check whether
the current virtual machine's id is equal to the the one at the time
the event was generated. If they do not match, we immediately return.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
Signed-off-by: dengpengcheng <dengpc12@chinatelecom.cn>
16 months agoci: Update Alpine and Fedora and regenerate
Michal Privoznik [Thu, 14 Dec 2023 07:36:01 +0000 (08:36 +0100)]
ci: Update Alpine and Fedora and regenerate

New Alpine and Fedora releases were added to libvirt-ci (3.19 and
39, respectively) and old ones were removed. Update the manifest
file and regenerate the rest.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
16 months agoci: integration: Switch upstream integration tests to Fedora 39
Michal Privoznik [Thu, 14 Dec 2023 07:44:10 +0000 (08:44 +0100)]
ci: integration: Switch upstream integration tests to Fedora 39

Currently, Fedora 37 and 38 is used. The former is now EOL since
there's new release. Switch 37 to 39 then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
16 months agoconf: Restore setting default bus for input devices
Jonathan Wright [Wed, 3 Jan 2024 15:26:59 +0000 (09:26 -0600)]
conf: Restore setting default bus for input devices

Prior to v9.3.0-rc1~30 we used to set default bus for <input/>
devices, during XML parsing. In the commit this code was moved to
a post parse callback. But somehow the line that sets the bus in
one specific case disappeared. Bring it back.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/577
Fixes: c4bc4d3b82fbe22e03c986ca896090f481df5c10
Signed-off-by: Jonathan Wright <jonathan@almalinux.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agodocs: fix typo in qemu-passthrough-security
Foster Snowhill [Thu, 14 Dec 2023 12:12:13 +0000 (12:12 +0000)]
docs: fix typo in qemu-passthrough-security

Signed-off-by: Foster Snowhill <2486761-ForstPenguin@users.noreply.gitlab.com>
16 months agoImprove error message in remoteGetUNIXSocket
Martin Kletzander [Thu, 7 Dec 2023 10:28:23 +0000 (11:28 +0100)]
Improve error message in remoteGetUNIXSocket

By adding a link to an explanation in the kbase.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
16 months agoqemucapabilitiesdata: Final update of 'caps_8.2.0_x86_64'
Peter Krempa [Thu, 16 Nov 2023 13:58:07 +0000 (14:58 +0100)]
qemucapabilitiesdata: Final update of 'caps_8.2.0_x86_64'

QEMU 8.2 was released, update the x86_64 data for a final time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
16 months agoci: Switch from FreeBSD 12.0 to FreeBSD 14.0
Michal Privoznik [Wed, 3 Jan 2024 09:07:49 +0000 (10:07 +0100)]
ci: Switch from FreeBSD 12.0 to FreeBSD 14.0

FreeBSD 12.0 is no longer supported since 14.0 is out. Change the
CI manifest and refresh the rest.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
16 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Mon, 1 Jan 2024 11:37:07 +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: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
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>
17 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>