Commit Graph

49579 Commits

Author SHA1 Message Date
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
Weblate
bf89c546f0 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>
2023-12-01 11:42:23 +01:00
Göran Uddeborg
e85d61f17a 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>
2023-12-01 11:42:23 +01:00
Peter Krempa
2b148748c2 NEWS: Mention image probing, snaphsot and hotplug fixes
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2023-12-01 11:42:01 +01:00
Peter Krempa
69880584e6 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: 8a88d3e586
Resolves: https://issues.redhat.com/browse/RHEL-17841
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2023-12-01 11:35:14 +01:00
Michal Privoznik
94ded36b3f 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>
2023-11-29 17:16:45 +01:00
Michal Privoznik
dec02f101e 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>
2023-11-29 14:34:11 +01:00
Michal Privoznik
944fe54b6e 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>
2023-11-29 08:54:14 +01:00
Andrea Bolognani
f3573b5efa rpm: Drop rpcgen Build-Requires once again
We no longer use it, so commit a62486b95f correctly dropped
the Build-Requires; shortly afterwards, however, I accidentally
reintroduced it by mistake.

Fixes: 3df8cc658e
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-11-28 19:14:05 +01:00
Jiri Denemark
6f11304849 po: Refresh potfile for v9.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2023-11-27 13:13:31 +01:00
Peter Krempa
0728bc47af 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>
2023-11-27 10:14:20 +01:00
Peter Krempa
734e4e9783 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>
2023-11-27 10:14:20 +01:00
Peter Krempa
e534d19b5d 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>
2023-11-27 10:14:20 +01:00
Peter Krempa
9ec0e28e87 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>
2023-11-27 10:14:20 +01:00
Peter Krempa
dee5b3fb8e qemu: block: Absorb qemuBlockReopenFormatMon into qemuBlockReopenAccess
Move all the code into the now only caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
abd1e08c42 testQemuMonitorJSONBlockdevReopen: Don't use qemuBlockReopenFormatMon
Use the low level monitor API directly to test the QMP wrapper itself.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
7e66ff4fd1 qemu: monitor: Sanitize arguments of qemuMonitorBlockdevReopen
Take the virJSONValue array object which is passed to the
'blockdev-reopen' command as the 'options' argument rather than making
the caller wrap all the properties.

The code was a leftover from the time when the blockdev-reopen command
had a different syntax, and thus can be cleaned up.

Also note that the logging of the node name never worked as the top
level object didn't ever contain a 'node-name' property.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
24b667eeed qemu: block: Absorb logic from qemuBlockReopenFormat to qemuBlockReopenAccess
Move all the logic into the new function and remove the old one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
214794c9c7 qemu: block: Extract logic from qemuBlockReopenReadWrite/ReadOnly
We want to preserve the wrappers for clarity but the inner logic can be
extracted to a common function qemuBlockReopenAccess. In further patches
the code from qemuBlockReopenFormat will be merged into the new wrapper
as well as logic for handling scenarios with missing 'format' layers
will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
834d283bcf qemuBlockStorageSourceGetEffectiveNodename: Prepare for missing 'format' driver
Return the effective storage nodename if the format layer is not
present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00
Peter Krempa
6ab5ee9a9a qemuDomainPrepareStorageSourceBlockdevNodename: Restructure code to allow missing 'format' layer
Similarly to other bits of code, we don't need to setup the format layer
if it will not be formatted. Add logic which uses
qemuBlockStorageSourceNeedsFormatLayer to see whether the setup of the
format node is needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-11-27 10:14:20 +01:00