Commit Graph

49755 Commits

Author SHA1 Message Date
Peter Krempa
b4e8196c50 qemuxml2*test: Remove FLAG_SKIP_CONFIG_ACTIVE flag
Neither qemuxml2argvtest nor qemuxml2xmltest now test configs parsed as
active, thus this flag is no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 17:31:12 +01:00
Peter Krempa
66eeeb610c qemuxml2xmltest: Parse all input files as inactive
In previous patches we've added testing of XML's explicitly parsed as
active (ensuring that it e.g. has a domain id) formatted into both
active and inactive versions.

Now qemuxml2xmltest can be simplified by making it test only XMLs parsed
as inactive.

To do this we pass VIR_DOMAIN_DEF_PARSE_INACTIVE in parseFlags. This
will also cause that all output files will become identical so the setup
of the test cases can be simplified by using the non-split output file
name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 17:31:12 +01:00
Peter Krempa
ae87e46a99 qemuxmlactivetest: Add qemu active XML to active/inactive XML tests
Add explicit test cases for XMLs from qemuxml2argvdata which
historically had different output in qemuxml2xmltest.

qemuxmlactivetest explicitly ensures that the input XMLs are parsed in
'live' state and formatted both in inactive as well as live state,
rather than the previously present inactive->inactive,  live->live tests
only.

The XMLs picked in this case are those which had separate output files
in qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 17:31:12 +01:00
Peter Krempa
a895686bd1 qemuxmlactivetest: Prepare for proper active/inactive -> active/inactive testing
Currently the xml->xml testing we have in qemuxml2xmltest covers only 3
of the 4 possibilities:

By invocation:
  active -> active;
  inactive -> inactive;

by unintentionally:
  active -> inactive  (for configs which don't set an 'id' as the
                       formatter assumes it's inactive)

To do it better introduce proper active -> inactive/active testing into
qemuxmlactivetest. It's chosen such as we only really parse an XML as
live when restoring a status XML. To give users possibility to avoid
constructing a full status XML add a simpler variant. As of such it will
be used only for configs where we specifically cared about parsing live
data.

To ensure that the formatter doesn't decide that a config is inactive
because it doesn't have an ID we fill in a domain ID if it was not
present in the source.

In this patch the tests are not yet added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 17:31:12 +01:00
Peter Krempa
3b04d48192 qemu*xml2*test: Invoke tests from a function
Refactor the code so that the test macros invoke a helper function with
no additional steps. This change prevents regressions in compilation
time when adding extra steps for the tests, which happen when the test
macro gets too complicated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 17:30:30 +01:00
Peter Krempa
aecd5085db testutilsqemu: Create a typedef for struct testQemuInfo
The typedef will come in handy to create an autoptr cleaning function
later on.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:39:50 +01:00
Peter Krempa
06c1ab8222 tests: Rename 'qemustatusxml2xmltest' to 'qemuxmlactivetest'
The test will be testing both status XMLs and active XMLs. Rename it to
a shorter name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:39:25 +01:00
Peter Krempa
0253d145e9 testCompareDomXML2XMLFiles: Sanitize handling of 'parse_flags'
Get rid of the extra temporary variable and set the parse and format
flags based on liveness together.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:39:06 +01:00
Peter Krempa
6443d77239 qemuxml2xmltest: Use same parameters as in qemuxml2argvtest for 'riscv64-virt'
The main idea of the test is to validate config when PCIe is compiled
out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:38:51 +01:00
Peter Krempa
03be1ce8cd qemuxmlargvdata: disk-network-nfs: Drop 'index' attribute from backing store
Index is auto-allocated normally. Additionally we now don't need the
extra active/inactive version of this test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:38:40 +01:00
Peter Krempa
904af0feee qemuxml2xmltest: Add invocation for 'numatune-auto-nodeset-invalid' case
The test case requires an exception in virschematest as the output file
is no longer invalid.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:38:36 +01:00
Peter Krempa
ad42a7e074 virschematest: Add possibility to have exceptions from the '-invalid' suffix
The exception is needed in qemuxml2xmltest which is in one instance
testing update from an invalid config to a valid one. Currently the
compliance with the test is achieved via a hack.

As further patches will be simpler without the hack present we need a
way to invert the expected output in specific cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2024-01-17 16:22:55 +01:00
Andrea Bolognani
3a45455558 news: Mention support for CPU clusters
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 15:30:34 +01:00
Andrea Bolognani
1968f69b01 docs: Document CPU clusters
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 15:30:34 +01:00
Andrea Bolognani
032d67311a docs: Improve documentation for CPU topology
On the guest configuration side, mention that support for the
"dies" attribute was introduced in libvirt 6.1.0 and clarify
that the ability to use non-default values is subject to
architecture and machine limitations.

On the host capabilities side, the documentation was pretty
much entirely missing. It's still far from perfect, but anything
is better than having no information at all.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 15:26:31 +01:00
Andrea Bolognani
cb7abb0703 tests: Verify handling of CPU clusters in QMP data
Since aarch64 doesn't support CPU hotplug at the moment, we have
to get a bit creative.

While the 'query-cpus-fast' output is taken directly from a VM
configured as

  <vcpu current='7'>16</vcpu>
  <cpu mode='host-passthrough'>
    <topology sockets='2' dies='1' clusters='2' cores='2' threads='2'/>
  </cpu>

the 'query-hotpluggable-cpus' output is constructed by hand
starting from the former and using the 'x86-dies' test data as
a model.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:36 +01:00
Andrea Bolognani
763381df53 qemu: Make monitor aware of CPU clusters
This makes it so libvirt can obtain accurate information about
guest CPUs from QEMU, and should make it possible to correctly
perform operations such as CPU hotplug.

Of course this is mostly moot at the moment: only aarch64 can use
CPU clusters, and CPU hotplug is not yet implemented on that
architecture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:36 +01:00
Andrea Bolognani
82c9196bfa tests: Add test case for CPU clusters
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Andrea Bolognani
655459420a qemu: Use CPU clusters for guests
https://issues.redhat.com/browse/RHEL-7043

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Andrea Bolognani
beb27dc61e qemu: Introduce QEMU_CAPS_SMP_CLUSTERS
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Andrea Bolognani
ef5c397584 conf: Allow specifying CPU clusters
The default number of CPU clusters is 1, and values other than
that one are currently rejected by all hypervisor drivers.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Andrea Bolognani
5fc56aefb6 conf: Report CPU clusters in capabilities XML
For machines that don't expose useful information through sysfs,
the dummy ID 0 is used.

https://issues.redhat.com/browse/RHEL-7043

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Andrea Bolognani
fb81a56f32 tests: Add hostcpudata for machine with CPU clusters
The data is taken from an HPE Apollo 70 machine, which uses
aarch64 CPUs. It is interesting for us because non-dummy
information about CPU clusters is exposed through sysfs.

In order to keep things reasonable, the data was manually
modified so that only 8 of the original 224 CPUs are included.
Care has been taken to ensure that the topology is otherwise
unaltered.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-15 14:56:35 +01:00
Peter Krempa
9139cf44d4 vshAdmCatchDisconnect: Don't probe connection URI
virsh already stores the connection URI in 'ctl->connname', use that
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 14:05:20 +01:00
Peter Krempa
6f956696cb vshAdmConnect: Preserve connection URI in ctl->connname if auto-detected
Probe the current URI so that other places don't need to do that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 14:05:20 +01:00
Peter Krempa
4763f62a96 virshCatchDisconnect: Don't probe connection URI
virsh already stores the connection URI in 'ctl->connname', use that
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 14:05:20 +01:00
Peter Krempa
06f6d76334 virshReconnect: Preserve current URI if not explicitly set in ctl->connname
Probe the current URI so that other places don't need to do that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 14:05:20 +01:00
Göran Uddeborg
f6e6d191ca Translated using Weblate (Swedish)
Currently translated at 63.1% (6601 of 10447 strings)

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

Translated using Weblate (Swedish)

Currently translated at 62.7% (6558 of 10447 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>
2024-01-15 10:58:06 +01:00
Jiri Denemark
db791c8601 Post-release version bump to 10.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-01-15 11:01:50 +01:00
Jiri Denemark
1899d7df34 Release of libvirt-10.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-01-15 10:58:03 +01:00
Jonathon Jongsma
5ed420d845 NEWS: mention nbdkit config option
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 09:42:29 +01:00
Laine Stump
493b49d67f news: document auto-selection of VFIO variant drivers
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-15 09:32:22 +01:00
Michal Privoznik
5167d3825e NEWS: Document my contributions for upcoming release
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2024-01-12 17:30:16 +01:00
Andrea Bolognani
10042f0253 ci: Do more as part of .qemu-build-template
Entering $SCRATCH_DIR, going back to the original directory and
setting SELinux labels for the newly-installed QEMU binaries
are all steps that logically belong to this template rather
than its callers.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-12 14:28:43 +01:00
Andrea Bolognani
9cf0faac48 ci: Fix .integration_tests_upstream_qemu
We enter $SCRATCH_DIR before going through the process of
cloning QEMU's upstream repo and building it, but once we're
done we don't get back to libvirt's sources, so the very next
step fails with

  /tmp/script.: line 188: ci/jobs.sh: No such file or directory

Use pushd/popd to ensure that we're back to the correct place
once QEMU has been built and installed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-12 14:28:38 +01:00
Peter Krempa
a6f73c69a7 NEWS: Mention migration fixes and iothread mapping
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-01-12 10:50:06 +01:00
Ricky Tigg
924ba34af9 Translated using Weblate (Finnish)
Currently translated at 22.3% (2331 of 10433 strings)

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

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
2024-01-12 00:08:34 +01:00
김인수
2bc06d5c0e Translated using Weblate (Korean)
Currently translated at 100.0% (10433 of 10433 strings)

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

Translated using Weblate (Korean)

Currently translated at 99.7% (10411 of 10433 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>
2024-01-12 00:08:34 +01:00
Göran Uddeborg
60923b8265 Translated using Weblate (Swedish)
Currently translated at 62.5% (6538 of 10447 strings)

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

Translated using Weblate (Swedish)

Currently translated at 62.4% (6512 of 10433 strings)

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

Translated using Weblate (Swedish)

Currently translated at 62.3% (6497 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>
2024-01-12 00:08:34 +01:00
Shaleen Bathla
9ef6fee129 conf: domain_conf: cleanup def in case of errors
Just like in rest of the function virDomainFSDefParseXML,
use goto error so that def will be cleaned up in error cases.

Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2024-01-11 16:53:31 -06:00
Sergio Durigan Junior
6fa82fd8e2 apparmor: Allow access to /sys/devices/system/node/*/cpumap for libnuma
A QEMU change (10218ae6d006f76410804cc4dc690085b3d008b5) introduced
some libnuma calls that require read access to
/sys/devices/system/node/*/cpumap, which currently is forbidden by the
standard apparmor profile.

This commit allows read-only access to the file specified above.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/515

Signed-off-by: Sergio Durigan Junior <sergio.durigan@canonical.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2024-01-11 15:15:23 -07:00
Yalei Li
9e555699a2 virsh: Command completion, add comp-methods with zlib and zstd
Signed-off-by: Yalei Li <liyl43@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-01-11 13:15:08 +01:00
Weblate
0e120bc431 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>
2024-01-10 13:44:49 +00:00
Göran Uddeborg
c27b795e2a Translated using Weblate (Swedish)
Currently translated at 62.3% (6497 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>
2024-01-10 13:44:49 +00:00
Michal Privoznik
9cbda34e98 qemu: Be less aggressive when dropping channel source paths
In v9.7.0-rc1~130 I've shortened the path that's generated for
<channel/> source. With that, I had to adjust regex that matches
all versions of paths we have ever generated so that we can drop
them (see comment around qemuDomainChrDefDropDefaultPath()). But
as it is usually the case with regexes - they are write only. And
while I attempted to make one portion of the path optional
("/target/") I accidentally made regex accept more, which
resulted in libvirt dropping the user provided path and
generating our own instead.

Fixes: d3759d3674
Resolves: https://issues.redhat.com/browse/RHEL-20807
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-01-10 08:44:32 +01:00
Daniel P. Berrangé
7cb03e6a28 rpc: fix race in waking up client event loop
The first thread to issue a client RPC request will own the event
loop execution, sitting in the virNetClientIOEventLoop function.

It releases the client lock while running:

   virNetClientUnlock()
   g_main_loop_run()
   virNetClientLock()

If a second thread arrives with an RPC request, it will queue it
for the first thread to process. To inform the first thread that
there's a new request it calls g_main_loop_quit() to break it out
of the main loop.

This works if the first thread is in g_main_loop_run() at that
time. There is a small window of opportunity, however, where
the first thread has released the client lock, but not yet got
into g_main_loop_run(). If that happens, the wakeup from the
second thread is lost.

This patch deals with that by changing the way the wakeup is
performed. Instead of directly calling g_main_loop_quit(), the
second thread creates an idle source to run the quit function
from within the first thread. This guarantees that the first
thread will see the wakeup.

Tested by: Fima Shevrin <efim.shevrin@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-01-09 11:58:41 +00:00
Daniel P. Berrangé
024d6dc263 qemu: tighten semantics of 'size' when resizing block devices
When VIR_DOMAIN_BLOCK_RESIZE_CAPACITY is set, the 'size' parameter
is currently ignored. Since applications must none the less pass a
value for this parameter, it is preferrable to declare some explicit
semantics for it.

This declare that the parameter must be 0, or the exact size of the
underlying block device. The latter gives the management application
the ability to sanity check that the block device size matches what
they think it should be.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-01-09 11:57:13 +00:00
Jiri Denemark
784d90fe68 po: Refresh potfile for v10.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-01-09 12:07:20 +01:00
Andrea Bolognani
f913c7a77b ci: Add notes for integration jobs
These are special in that, when a new target is introduced, some
preparation is needed before the changes can be merged. Since
this only happens every six months or so, it's unsurprising that
we keep messing it up and forgetting some steps. Having notes
right in the file will hopefully help going forward.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-09 09:45:49 +01:00
Andrea Bolognani
88169d35dd ci: Move upstream-qemu job to Fedora 39
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-01-09 09:45:45 +01:00