Commit Graph

49599 Commits

Author SHA1 Message Date
Göran Uddeborg
ff8c5c523f 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>
2023-12-10 11:44:00 +01:00
Jim Fehlig
1a2f33cb59 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>
2023-12-08 08:18:39 -07:00
Göran Uddeborg
fba411a805 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>
2023-12-07 22:43:57 +01:00
Peter Krempa
06e344f762 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>
2023-12-07 16:42:32 +01:00
Peter Krempa
9f855b149a 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>
2023-12-07 16:42:32 +01:00
Peter Krempa
73c1e87e6a 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>
2023-12-07 16:42:32 +01:00
Peter Krempa
a2f98b6b8c 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: 1c2bd205ed
Resolves: https://issues.redhat.com/browse/RHEL-17596
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-12-07 16:42:32 +01:00
Peter Krempa
831c55ae3e 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>
2023-12-07 16:42:32 +01:00
Peter Krempa
b99c709d8d 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>
2023-12-07 16:42:32 +01:00
Anastasia Belova
d96858b0e8 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>
2023-12-07 11:31:30 +01:00
Anastasia Belova
d17474a5f1 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>
2023-12-07 11:31:29 +01:00
Jonathon Jongsma
a949a53e13 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 49c945a6f5. 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>
2023-12-06 14:57:46 -06:00
Daniel P. Berrangé
3b45fcd6b6 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>
2023-12-06 16:45:46 +00:00
Göran Uddeborg
da1057c8eb 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>
2023-12-06 12:44:05 +01:00
Michal Privoznik
a3129ae6df 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>
2023-12-06 12:36:03 +01:00
Michal Privoznik
d6169ad739 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>
2023-12-06 12:30:10 +01:00
Michal Privoznik
cab49d394f 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>
2023-12-05 16:36:53 +01:00
Michal Privoznik
b41f730c33 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>
2023-12-05 16:36:46 +01:00
Han Han
6beeca77be 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>
2023-12-05 12:21:38 +01:00
Andrea Bolognani
fa14b4a1a6 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>
2023-12-05 11:50:52 +01:00
Andrea Bolognani
417bd41cba ci: Refresh generated files
Add black, drop scrub.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2023-12-05 11:50:50 +01:00
Andrea Bolognani
dca48ec74c rpm: Drop BuildDepends on passt
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2023-12-05 11:50:49 +01:00
Andrea Bolognani
6adbc1dd6c rpm: Drop BuildDepends on scrub
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2023-12-05 11:50:47 +01:00
Andrea Bolognani
eb131d30d6 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>
2023-12-05 11:50:45 +01:00
Andrea Bolognani
6aa2fa38b0 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>
2023-12-05 11:50:44 +01:00
Andrea Bolognani
58b17ce789 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>
2023-12-05 11:50:42 +01:00
Andrea Bolognani
5b4d1a68b2 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>
2023-12-05 11:50:40 +01:00
Andrea Bolognani
e8d149614b 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>
2023-12-05 11:50:29 +01:00
Andrea Bolognani
57395ea9eb 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>
2023-12-05 11:49:11 +01:00
Andrea Bolognani
a8e3bae5b1 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>
2023-12-05 11:49:02 +01:00
Andrea Bolognani
3aade50055 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>
2023-12-05 11:48:28 +01:00
Michal Privoznik
7ec4e6e3b5 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>
2023-12-05 09:26:47 +01:00
Michal Privoznik
cc9f439be9 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>
2023-12-05 09:26:47 +01:00
Michal Privoznik
58292bae47 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>
2023-12-05 09:26:47 +01:00
Göran Uddeborg
f1a950379d 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>
2023-12-04 09:49:46 +01:00
Michal Privoznik
cca4b0463d 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>
2023-12-04 09:50:17 +01:00
Thanos Makatos
cd65b895dd 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>
2023-12-02 08:55:28 +01:00
Andrea Bolognani
d8de4f2770 NEWS: Fix indentation
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2023-12-01 16:58:35 +01:00
Andrea Bolognani
86fd3eec66 NEWS: Fix vertical spacing
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2023-12-01 16:57:35 +01:00
Jiri Denemark
ce7d0a7db4 Post-release version bump to 10.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2023-12-01 16:24:28 +01:00
Jiri Denemark
2cf755d168 Release of libvirt-9.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2023-12-01 16:11:26 +01:00
Andrea Bolognani
c43b69fea3 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>
2023-12-01 13:50:19 +01:00
Daniel P. Berrangé
1f3fe268eb 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>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
fb48e1633c 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 9fa3a8ab6f 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>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
10b354f913 ci: Refresh generated files
This adds pytest everywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
a12e13bdc3 rpcgen: Reformat meson files
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
233e74e3bf rpcgen: Skip tests if tests are disabled
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
688aedf2eb 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>
2023-12-01 13:50:16 +01:00
Andrea Bolognani
4a01a0bc25 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>
2023-12-01 13:50:16 +01:00
김인수
f7110f8201 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>
2023-12-01 11:42:24 +01:00