]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 months agoconf: Introduce dynamicMemslots attribute for virtio-mem
Michal Privoznik [Thu, 4 Jan 2024 09:03:36 +0000 (10:03 +0100)]
conf: Introduce dynamicMemslots attribute for virtio-mem

Introduced in v8.2.0-rc0~74^2~2, QEMU now allows setting
.dynamic-memslots attribute for virtio-mem-pci devices. When
turned on, it allows memory exposed to guest to be split into
multiple memslots and thus smaller memory footprint (see the
original commit for detailed explanation).

Therefore, introduce new <target/> attribute which will control
that QEMU knob.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 29 Jan 2024 15:36:25 +0000 (16:36 +0100)]
Translated using Weblate (Swedish)

Currently translated at 65.4% (6842 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>
15 months agoTranslated using Weblate (Korean)
김인수 [Mon, 29 Jan 2024 15:36:25 +0000 (16:36 +0100)]
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/

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
15 months agoremote_driver: Restore special behavior of remoteDomainGetBlockIoTune()
Michal Privoznik [Mon, 29 Jan 2024 09:07:05 +0000 (10:07 +0100)]
remote_driver: Restore special behavior of remoteDomainGetBlockIoTune()

In v9.10.0-rc1~103 the remote driver was switched to g_auto() for
client RPC return parameters. But whilst doing so a small bug
slipped in: previously, when virDomainGetBlockIoTune() was called
with *nparams == 0, the function set *nparams to the number of
supported params and zero was returned (so that client can
allocate memory and call the API second time). IOW - the usual,
old style of APIs where we didn't want to allocate memory on
caller's behalf. But because of this bug, a negative one is
returned instead.

Fixes: 501825011c1fe80f458820c7efe5a198e0af9be5
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Improve ABI_UPDATE macros
Andrea Bolognani [Fri, 26 Jan 2024 10:57:21 +0000 (11:57 +0100)]
tests: Improve ABI_UPDATE macros

There are a number of cases in which we want to test both the
normal behavior and the ABI_UPDATE behavior for the same input
XML.

The way this is currently implemented is ad-hoc, and involves
symlinking the input XML as well as coming up with an
alternative name for the ABI_UPDATE variant: in most cases the
-abi-update suffix is added, but since this is not enforced
there are a couple of cases where we do something else instead.

To make things simpler and more consistent, implement the
naming convention at the macro level. This way, we no longer
need to create any symlinks for the input file, and the output
files are automatically named correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agotests: Use ABI_UPDATE macros more
Andrea Bolognani [Fri, 26 Jan 2024 10:56:54 +0000 (11:56 +0100)]
tests: Use ABI_UPDATE macros more

In one case, the macro was open-coded.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agotests: Drop ppc64-usb-controller-legacy
Andrea Bolognani [Fri, 26 Jan 2024 11:16:39 +0000 (12:16 +0100)]
tests: Drop ppc64-usb-controller-legacy

The input file is a symlink for the ppc64-usb-controller input
file, so the output files are identical as well. It's just an
unnecessary duplicate.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agoqemu: block: fix error when blockcopy target is librbd encrypted
Or Ozeri [Thu, 12 Jan 2023 09:04:01 +0000 (03:04 -0600)]
qemu: block: fix error when blockcopy target is librbd encrypted

Encryption secrets are considered a format dependency, even
when being used by the storage node itself, as in the case of
using encryption engine=librbd.
Currently, the storage node is created (blockdev-add) before
creating the format dependencies (including encryption secrets).
As a result, when trying to perform a blockcopy when the target
disk uses librbd encryption, an error of this form is returned:

  "error: internal error: unable to execute QEMU command 'blockdev-add': No secret with id 'libvirt-5-format-encryption-secret0'"

To overcome this error, we change the order of commands so that
format dependencies are created BEFORE creating the storage node.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
15 months agoqemu_hotplug: Don't lose 'created' flag in qemuDomainChangeNet()
Michal Privoznik [Wed, 24 Jan 2024 17:43:21 +0000 (18:43 +0100)]
qemu_hotplug: Don't lose 'created' flag in qemuDomainChangeNet()

After v9.1.0-rc1~116 we track whether it's us who created a
macvtap or not. But when updating a vNIC its definition might be
replaced with a new one (though, ifname is not allowed to
change), e.g. to reflect new QoS, link state, etc.

Now, the fact whether we created macvtap for given vNIC is stored
in net->privateData->created. And replacing definition is done by
simply freeing the old definition and making the pointer point to
the new one. But this does not preserve the 'created' flag, which
in turn means when a domain is shutting off, the macvtap is not
removed (see loop inside of qemuProcessStop()).

Copy this flag into new definition and leave a note in
_qemuDomainNetworkPrivate struct.

Fixes: 61d1b9e6592660121aeda66bf7adbcd39de06aa8
Resolves: https://issues.redhat.com/browse/RHEL-22714
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovmx: Separate disk target name generation into a function
Michal Privoznik [Fri, 15 Dec 2023 13:48:25 +0000 (14:48 +0100)]
vmx: Separate disk target name generation into a function

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovmx2xmltest: Add another test case
Michal Privoznik [Fri, 15 Dec 2023 12:55:53 +0000 (13:55 +0100)]
vmx2xmltest: Add another test case

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovmx: Accept empty fileName for cdrom-image
Michal Privoznik [Fri, 15 Dec 2023 13:12:42 +0000 (14:12 +0100)]
vmx: Accept empty fileName for cdrom-image

Turns out, there are two ways to specify an empty CD-ROM drive in
a .vmx file:

  1) .fileName = "emptyBackingString"
  2) .fileName = ""

While we do parse 1) successfully, the code does not accept 2)
and an error is reported. Modify the code to treat both cases the
same.

Resolves: https://issues.redhat.com/browse/RHEL-19380
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoAdd explanation about the attribute "delay"
Yalan Zhang [Wed, 10 Jan 2024 04:58:58 +0000 (12:58 +0800)]
Add explanation about the attribute "delay"

The libvirt created linux bridge has a configurable value "delay",
the default value is "0", but it will not take effect. That's because
kernel has a minimum value for linux bridge. Add some explanation
about it in the document.

Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoNEWS: Document recent rx-filter bugfix
Michal Privoznik [Thu, 25 Jan 2024 13:19:06 +0000 (14:19 +0100)]
NEWS: Document recent rx-filter bugfix

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agoqemu_process: Skip over non-virtio non-TAP NIC models when refreshing rx-filter
Michal Privoznik [Tue, 23 Jan 2024 16:20:42 +0000 (17:20 +0100)]
qemu_process: Skip over non-virtio non-TAP NIC models when refreshing rx-filter

After guest is started, or we are reconnecting to already running
one (after daemon restart), qemuProcessRefreshRxFilters() is
called to refresh rx-filters (basically MAC addresses of guest
NICs) as they might have changed while we were not running (for
the case when reconnecting to an already running guest), or we
need to enable them by running a command (for freshly started
guest - see processNicRxFilterChangedEvent()).

Now, our XML parser allowed trustGuestRxFilters attribute for all
types and models of <interface/> while in reality, only virtio
model AND TUN/TAP based types can see MAC address changes. For
other combinations, QEMU reports an error.

This all means that when the daemon is restarted and it
reconnects to a guest with, well invalid configuration, or when
such guest is restored from a saved image, or migrated then we
issue the monitor command, to which QEMU replies with an error
which is then propagated to users:

  error: internal error: unable to execute QEMU command 'query-rx-filter': invalid net client name: hostdev0

While on one hand users should fix their configuration (and after
v10.0.0-rc1~123 they can do that even on live domains), libvirt
can also has some logic built in that prevent issuing the command
in the first place (for obviously wrong cases).

Fixes: 060d4c83ef436cf56abfad51a4d64c39448e199d
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agobuild: Make daemons depend on generated *_protocol.[ch]
Jiri Denemark [Wed, 24 Jan 2024 18:23:54 +0000 (19:23 +0100)]
build: Make daemons depend on generated *_protocol.[ch]

This should fix build failures when a daemon code is compiled before the
included *_protocol.h headers are ready, such as:

    FAILED: src/virtqemud.p/remote_remote_daemon_config.c.o
    ../src/remote/remote_daemon_config.c: In function ‘daemonConfigNew’:
    ../src/remote/remote_daemon_config.c:111:30: error:
        ‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
      111 |         data->auth_unix_rw = REMOTE_AUTH_POLKIT;
          |                              ^~~~~~~~~~~~~~~~~~
    ../src/remote/remote_daemon_config.c:111:30: note: each undeclared
        identifier is reported only once for each function it appears in
    ../src/remote/remote_daemon_config.c:115:30: error:
        ‘REMOTE_AUTH_NONE’ undeclared (first use in this function)
      115 |         data->auth_unix_rw = REMOTE_AUTH_NONE;
          |                              ^~~~~~~~~~~~~~~~
    ../src/remote/remote_daemon_config.c: In function
        ‘daemonConfigLoadOptions’:
    ../src/remote/remote_daemon_config.c:252:31: error:
        ‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
      252 |     if (data->auth_unix_rw == REMOTE_AUTH_POLKIT) {
          |                               ^~~~~~~~~~~~~~~~~~

or

    FAILED: src/virtqemud.p/remote_remote_daemon_dispatch.c.o
    In file included from ../src/remote/remote_daemon.h:28,
                     from ../src/remote/remote_daemon_dispatch.c:26:
    src/remote/lxc_protocol.h:13:5: error:
        unknown type name ‘remote_nonnull_domain’
       13 |     remote_nonnull_domain dom;
          |     ^~~~~~~~~~~~~~~~~~~~~
    In file included from ../src/remote/remote_daemon.h:29,
                     from ../src/remote/remote_daemon_dispatch.c:26:
    src/remote/qemu_protocol.h:13:5: error:
        unknown type name ‘remote_nonnull_domain’
       13 |     remote_nonnull_domain dom;
          |     ^~~~~~~~~~~~~~~~~~~~~
    src/remote/qemu_protocol.h:14:5: error:
        unknown type name ‘remote_nonnull_string’
       14 |     remote_nonnull_string cmd;
          |     ^~~~~~~~~~~~~~~~~~~~~
    ...

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
15 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 24 Jan 2024 09:36:12 +0000 (10:36 +0100)]
Translated using Weblate (Swedish)

Currently translated at 64.5% (6741 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>
15 months agotests: Remove readahead and timeout from ssh tests
Jonathon Jongsma [Fri, 19 Jan 2024 21:18:21 +0000 (15:18 -0600)]
tests: Remove readahead and timeout from ssh tests

These values are currently unsupported for ssh disks, and in fact aren't
even parsed for ssh disks. So while this didn't result in any test
errors, we can remove them from the test input files.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
15 months agoqemu: Fix bug in nbdkit-backed backing chains
Jonathon Jongsma [Thu, 18 Jan 2024 23:17:07 +0000 (17:17 -0600)]
qemu: Fix bug in nbdkit-backed backing chains

When trying to start nbdkit-backed disks in backing chains, we were
accidentally always checking the private data of the top of the chain
instead of using the loop variable.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
15 months agoExplicitly convert type to double to avoid losing precision
Egor Makrushin [Tue, 23 Jan 2024 09:28:34 +0000 (12:28 +0300)]
Explicitly convert type to double to avoid losing precision

Division between integers will also be integer.
Thus, to preserve fractional part explicitly
convert first operand to double.

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

Fixes: 28d54aab05 ("examples: Introduce domtop")
Signed-off-by: Egor Makrushin <emakrushin@astralinux.ru>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
15 months agoconf: make virNetDevVPortProfileFormat() void
Alexandra Diupina [Wed, 17 Jan 2024 16:04:58 +0000 (19:04 +0300)]
conf: make virNetDevVPortProfileFormat() void

Since commit 4af3cbafdd0e the function always returns 0, so it is
possible to make this function void and remove return value checks.

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

Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
15 months agoqemuxmlconftest: Move 'qemuxml2xmloutdata' into 'qemuxmlconfdata'
Peter Krempa [Mon, 22 Jan 2024 15:49:18 +0000 (16:49 +0100)]
qemuxmlconftest: Move 'qemuxml2xmloutdata' into 'qemuxmlconfdata'

Unify the output directory. Symlinks needed to be adapted to work
properly, but the 'qemuxml2argvdata' symlink can now be removed.

The virschematest exceptions needed to be moved to the proper directory
once the files are moved.

The unification of the output directory now also ensures that files
won't be forgotten once tests are removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agoqemuxmlconftest: Move data directory 'qemuxml2argvdata' to 'qemuxmlconfdata'
Peter Krempa [Mon, 22 Jan 2024 12:18:56 +0000 (13:18 +0100)]
qemuxmlconftest: Move data directory 'qemuxml2argvdata' to 'qemuxmlconfdata'

Unify the naming of the data directory with the test name.

'tests/qemuxml2argvdata' is for the time converted to a symlink to
'qemuxmlconfdata', to preserve the symlinks in
'tests/qemuxml2xmloutdata'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agoqemuxml2xmloutdata: Drop unused output files
Peter Krempa [Tue, 23 Jan 2024 13:29:01 +0000 (14:29 +0100)]
qemuxml2xmloutdata: Drop unused output files

Remove leftover output files. The list of files was identified by
temporarily hacking testConfXMLEnumerate to also enumerate
'tests/qemuxml2xmloutdata' directory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agoqemuxmlconftest: Check also output files for usage
Peter Krempa [Tue, 23 Jan 2024 12:44:50 +0000 (13:44 +0100)]
qemuxmlconftest: Check also output files for usage

Include also the output files in the validation of used files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agoqemuxmlconftest: Populate output/error file only when needed
Peter Krempa [Tue, 23 Jan 2024 12:35:39 +0000 (13:35 +0100)]
qemuxmlconftest: Populate output/error file only when needed

Populate the output filename strings only when the files are expected to
exist, so that other logic can be based on the presence of the strings
rather than having to re-check the test flags for expected state.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agovirschematest: Don't bother checking symlinked XMLs
Peter Krempa [Tue, 23 Jan 2024 12:59:11 +0000 (13:59 +0100)]
virschematest: Don't bother checking symlinked XMLs

There's plenty symlinks in qemuxml2argvdata and qemuxml2xmlout
directories pointing to other files in the same directory. It makes no
sense to check those files twice, thus we can simply skip symlinks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agodomain_validate: Check for domain address conflicts fully
Michal Privoznik [Fri, 19 Jan 2024 07:22:13 +0000 (08:22 +0100)]
domain_validate: Check for domain address conflicts fully

Current implementation of virDomainMemoryDefCheckConflict() does
only a one way comparison, i.e. if there's a memory device within
def->mems[] which address falls in [mem->address, mem->address +
mem->size] range (mem is basically an iterator within
def->mems[]). And for static XML this works just fine. Problem is
with hot/cold plugging of a memory device. Then mem points to
freshly parsed memory device and these half checks are
insufficient. Not only we must check whether an existing memory
device doesn't clash with freshly parsed memory device, but also
whether freshly parsed memory device does not fall into range of
already existing memory device.

Resolves: https://issues.redhat.com/browse/RHEL-4452
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
15 months agomeson: drop explicit python interpreter
Biswapriyo Nath [Sun, 21 Jan 2024 06:25:57 +0000 (06:25 +0000)]
meson: drop explicit python interpreter

meson wraps python scripts already on win32, so we end up with these
failing commands:

[185/868] Generating src/rpc/virnetprotocol.h with a custom command
FAILED: src/rpc/virnetprotocol.h
"sh" "libvirt/scripts/meson-python.sh" "F:/msys64/ucrt64/bin/python3.EXE" "F:/msys64/ucrt64/bin/python.exe" "libvirt/scripts/rpcgen/main.py" "--mode=header" "../src/rpc/virnetprotocol.x" "src/rpc/virnetprotocol.h"
SyntaxError: Non-UTF-8 code starting with '\x90' in file F:/msys64/ucrt64/bin/python.exe on line 1, but no encoding declared; see https://peps.python.org/pep-0263/ for details

The issue was introduced in a62486b95feed2cf17ce4adbe794a1ecff9ef22a commit.
These changes are similar as e06beacec2f8e57bbc5cd8f6eb9d44a1f291966d commit.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
15 months agoTranslated using Weblate (Georgian)
Mariam Low-Ghelaghutashvili [Fri, 19 Jan 2024 13:51:07 +0000 (14:51 +0100)]
Translated using Weblate (Georgian)

Currently translated at 4.4% (461 of 10433 strings)

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

Co-authored-by: Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
Signed-off-by: Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
15 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Fri, 19 Jan 2024 13:51:06 +0000 (14:51 +0100)]
Translated using Weblate (Swedish)

Currently translated at 63.5% (6641 of 10447 strings)

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

Translated using Weblate (Swedish)

Currently translated at 63.3% (6621 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>
15 months agodocs: Add redirects configuration for gitlab pages
Peter Krempa [Mon, 3 Apr 2023 14:18:54 +0000 (16:18 +0200)]
docs: Add redirects configuration for gitlab pages

Adapt the configuration of redirects from the server hosting libvirt.org

The redirect to the 'libvirt-console-proxy' Golang module is not adapted
as it doesn't exist on the current server.

NOTES:
 - The redirects are currently configured for hosting via the
   'gitlab.io/libvirt' URI. For hosting via custom domain it will need
   to be rewritten to drop the '/libvirt' prefixes.

 - gitlab pages doesn't currently support redirects to outside content,
   thus most of the redirects don't actually work:

     https://gitlab.com/gitlab-org/gitlab-pages/-/issues/601

 - The redirects file is only installed in the webpage job but is not
   actually distributed.

 - The validity of the redirects can be checked by visiting:

     https://libvirt.gitlab.io/_redirects

   Having them installed allows us to validate them before we'll be
   switching to use gitlab pages completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
15 months agogitlab-ci: Configure website build to be published via gitlab pages
Peter Krempa [Mon, 3 Apr 2023 14:02:05 +0000 (16:02 +0200)]
gitlab-ci: Configure website build to be published via gitlab pages

On pushes to master publish the webpage (built in the 'website_job' job)
via gitlab pages. The 'pages' job uses the default image that gitlab
assumes as it's consuming artifacts from an existing job and naming
them properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
15 months agoci: Regenerate with latest 'lcitool' and fix manual job definitions
Peter Krempa [Thu, 18 Jan 2024 15:20:14 +0000 (16:20 +0100)]
ci: Regenerate with latest 'lcitool' and fix manual job definitions

The latest lcitool merged the 'prebuilt-env' and 'local-env' jobs into
one which use variables to pick up the right environment and steps
rather than duplicating everything.

Regenerate the generated job definitions, fix the helper definitions
and also fix the manually defined jobs (website-job).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
15 months agonews: document my changes for 10.0.0
Ján Tomko [Wed, 17 Jan 2024 14:30:13 +0000 (15:30 +0100)]
news: document my changes for 10.0.0

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Improve qemuDomainSupportsPCIMultibus()
Andrea Bolognani [Wed, 17 Jan 2024 08:53:19 +0000 (09:53 +0100)]
qemu: Improve qemuDomainSupportsPCIMultibus()

Rewrite the function so that it's more compact and easier to
extend as new architectures, which will likely come with
multibus support right out the gate, are introduced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Move qemuDomainSupportsPCIMultibus()
Andrea Bolognani [Wed, 17 Jan 2024 08:39:48 +0000 (09:39 +0100)]
qemu: Move qemuDomainSupportsPCIMultibus()

It belongs next to qemuDomainSupportsPCI().

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Improve qemuDomainSupportsPCI()
Andrea Bolognani [Tue, 16 Jan 2024 15:42:18 +0000 (16:42 +0100)]
qemu: Improve qemuDomainSupportsPCI()

The way the function is currently written sort of obscures this
fact, but ultimately we already unconditionally assume PCI
support on most architectures.

Arm and RISC-V need some additional checks to maintain
compatibility with existing configurations but for all future
architectures, such as the upcoming LoongArch64, we expect PCI
support to come out of the box.

Last but not least, the functions is made const-correct.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Retire QEMU_CAPS_OBJECT_GPEX
Andrea Bolognani [Tue, 16 Jan 2024 15:36:58 +0000 (16:36 +0100)]
qemu: Retire QEMU_CAPS_OBJECT_GPEX

It's no longer used anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Stop checking QEMU_CAPS_OBJECT_GPEX
Andrea Bolognani [Tue, 16 Jan 2024 15:36:46 +0000 (16:36 +0100)]
qemu: Stop checking QEMU_CAPS_OBJECT_GPEX

For all versions of QEMU that we support, the virt machine type
has a hard dependency on this device, so we can stop checking
whether the capability is present and just use it unconditionally.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Request virtio-mmio for balloon-mmio-deflate
Andrea Bolognani [Tue, 16 Jan 2024 14:44:44 +0000 (15:44 +0100)]
tests: Request virtio-mmio for balloon-mmio-deflate

For all supported QEMU version, the virt machine type has a hard
dependency on PCI support, so if we want to test virtio-balloon
together with virtio-mmio we have to either request that
explicitly or trick libvirt by masking capabilities. Do the
former instead of the latter.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Simplify balloon-mmio-deflate
Andrea Bolognani [Tue, 16 Jan 2024 14:45:53 +0000 (15:45 +0100)]
tests: Simplify balloon-mmio-deflate

Drop everything that's not directly related to the scenario
being tested.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Drop various redundant tests
Andrea Bolognani [Tue, 16 Jan 2024 14:52:52 +0000 (15:52 +0100)]
tests: Drop various redundant tests

All of these are either a subset of other tests, or provide
coverage for scenarios that are not really possible: for all
versions of QEMU that we support, the virt machine type has a
hard dependency on the generic PCIe controller, which means
that we will never need to fall back to virtio-mmio.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Add {aarch64,riscv64}-virt-headless-mmio
Andrea Bolognani [Tue, 16 Jan 2024 14:51:31 +0000 (15:51 +0100)]
tests: Add {aarch64,riscv64}-virt-headless-mmio

Even though virtio-mmio is no longer the default on either
architecture, and likely nobody is using it at this point, we
still provide a way to opt into virtio-mmio usage and want to
keep existing guests working. Add explicit test suite coverage
for this scenario.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Drop aarch64-virtio-pci-default
Andrea Bolognani [Tue, 16 Jan 2024 15:21:52 +0000 (16:21 +0100)]
tests: Drop aarch64-virtio-pci-default

After commit 1d8454639f40 (libvirt 3.0.0), the default address
type for aarch64/virt guests is PCI. These tests are then
pointless, as they are just a subset of other tests, and the
comment attached to them inaccurate.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Fix handling of user aliases for default PHB
Andrea Bolognani [Tue, 16 Jan 2024 16:19:15 +0000 (17:19 +0100)]
qemu: Fix handling of user aliases for default PHB

The bus name for the default PHB is always "pci.0".

Fixes: 937f319536723fec57ad472b002a159d0f67a77c
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Add pseries-phb-user-alias
Andrea Bolognani [Tue, 16 Jan 2024 16:05:07 +0000 (17:05 +0100)]
tests: Add pseries-phb-user-alias

This is the same as the existing pseries-phb-simple, except that
each of the controllers is given a user alias. If we tried to
start the resulting guest, we'd get an error:

  Bus 'ua-phb0' not found

This is because, at the QEMU command line level, the default PHB
is not represented and so it can't be given a custom alias. We're
going to address this issue in a follow-up commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Add devices to pseries-phb-simple
Andrea Bolognani [Tue, 16 Jan 2024 16:08:49 +0000 (17:08 +0100)]
tests: Add devices to pseries-phb-simple

We want to make sure that not only the controllers themselves
are added correctly, but also that devices attached to them
get assigned the expected bus value. In order to do that add
some devices, one per controller.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2conftest: Test re-parsing of formatted XML
Peter Krempa [Mon, 18 Dec 2023 15:38:46 +0000 (16:38 +0100)]
qemuxml2conftest: Test re-parsing of formatted XML

Re-parse and re-format the output XML to validate that the auto-added
bits and the formatter always agree. There's no way to specify an
alternative output file as a libvirt-formatted XML must be reformatted
identically.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovirDomainDefAddConsoleCompat: Fix numbering of console targets after modification
Peter Krempa [Mon, 18 Dec 2023 15:41:01 +0000 (16:41 +0100)]
virDomainDefAddConsoleCompat: Fix numbering of console targets after modification

The XML parser for consoles sets the 'port=' attribute of '<target' to
be always the index of the console.

Thus when the "really crazy backcompat stuff for consoles" function
modifies the order of consoles by inserting the default one for a serial
port it must re-number the ports to ensure that the value will not
change on subsequent parse.

This luckily didn't cause any visible changes to the VM as the port
number isn't used for anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuDomainAssignPCIAddresses: Assign extension addresses when auto-assigning PCI...
Peter Krempa [Mon, 18 Dec 2023 21:23:35 +0000 (22:23 +0100)]
qemuDomainAssignPCIAddresses: Assign extension addresses when auto-assigning PCI address

Assigning a PCI address needs to also assign any extension addresses
right away. Otherwise they'd be assigned only after subsequent
format->parse cycle and thus be potentially missing on first run after
defining the VM and thus could change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemu: Move 'shmem' device size validation to qemu_validate
Peter Krempa [Mon, 18 Dec 2023 23:16:29 +0000 (00:16 +0100)]
qemu: Move 'shmem' device size validation to qemu_validate

The 'size' of a 'shmem' device is parsed and formatted as a "scaled"
value, stored in bytes, but the formatting scale is mebibytes. This
precission loss combined with the fact that the value was validated only
when starting and the size is formatted only when non-zero meant that
on first parse a value < 1 MiB would be accepted, but would be formatted
to the XML as 0 MiB as it was non-zero but truncated and a subsequent
parse would parse of such XML would parse it as 0 bytes, which in turn
would be interpreted as 'default' size.

Fix the issue by moving the validator, which ensures that the number is
a power of two and more than 1 MiB to the validator code so that it'll
be rejected at XML parsing time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovirDomainAssignControllerIndexes: Ensure controller ordering after assigning indexes
Peter Krempa [Mon, 18 Dec 2023 21:10:35 +0000 (22:10 +0100)]
virDomainAssignControllerIndexes: Ensure controller ordering after assigning indexes

Similarly to auto-adding of controllers, the assignment of indexes can
cause them to be considered in different ordering according to the logic
in 'virDomainControllerInsert' than they currently are.

To prevent changes in commandline between first run after defining a VM
xml and any subsequent run or restart of the daemon, we need to reorder
them when assigning the index.

The simplest method is to assign indexes and then create a new list of
controllers and re-instert them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoconf: domain: Insert auto-added controllers in same order as in XML parser
Peter Krempa [Mon, 18 Dec 2023 17:32:57 +0000 (18:32 +0100)]
conf: domain: Insert auto-added controllers in same order as in XML parser

'virDomainDefAddController' which is used in code-paths which auto-add
controllers to the definition such as 'virDomainDefMaybeAddController',
'virDomainDefAddUSBController', 'qemuDomainDefAddDefaultDevices' was
adding the controller at the end of the list. However that is not how
the XML parser would order the controller in the list as it uses
virDomainControllerInsert grouping them by type and additional
properties.

This would cause that auto-added controllers would re-order:
 - between first and any subsequent run of the VM (even on commandline)
 - after a libvirtd/virtqemud restart
 - after any update of the definition based on the 'define' operation
   (e.g. virsh edit)

To ensure that the ordering of controllers is identical always use
virDomainControllerInsert.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agovirDomainDefMaybeAddVirtioSerialController: Reformat hard to read linebreaks
Peter Krempa [Tue, 19 Dec 2023 21:51:41 +0000 (22:51 +0100)]
virDomainDefMaybeAddVirtioSerialController: Reformat hard to read linebreaks

Format the code the usual way despite having more than 80 columns so
that it's easier to read.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Rename 'qemuxml2argvtest' to 'qemuxmlconftest'
Peter Krempa [Mon, 18 Dec 2023 15:21:40 +0000 (16:21 +0100)]
tests: Rename 'qemuxml2argvtest' to 'qemuxmlconftest'

Since this tests inactive/config XML files rename it accordingly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agomeson: tests: Allow 'timeout' override for all tests
Peter Krempa [Mon, 8 Jan 2024 15:48:15 +0000 (16:48 +0100)]
meson: tests: Allow 'timeout' override for all tests

Don't special-case qemuxml2argvtest's handling of timeout but rather
allow each test array entry to have it's own.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Populate all outstanding def->xml cases
Peter Krempa [Sat, 16 Dec 2023 16:26:37 +0000 (17:26 +0100)]
qemuxml2argvtest: Populate all outstanding def->xml cases

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agotests: Remove qemuxml2xmltest
Peter Krempa [Sat, 16 Dec 2023 19:12:05 +0000 (20:12 +0100)]
tests: Remove qemuxml2xmltest

The full functionality was merged into qemuxmlconftest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Test (inactive) def -> xml conversion
Peter Krempa [Sat, 16 Dec 2023 16:13:35 +0000 (17:13 +0100)]
qemuxml2argvtest: Test (inactive) def -> xml conversion

This is an intermediate step to merge qemuxml2xmltest into this common
helper. This eliminates double setup/parsing of the input data as well
as will ensure that all input XMLs are tested both for ARGV as well as
XML output. For now we skip tests that don't have an output XML to show
that the this does everything that qemuxml2xmltest does.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Add parsing of the input XML as separate test
Peter Krempa [Mon, 18 Dec 2023 15:02:33 +0000 (16:02 +0100)]
qemuxml2argvtest: Add parsing of the input XML as separate test

Get clean separation between the parsing and argv conversion so that
it's obvious in the test output:

2409) QEMU XML def parse s390-async-teardown.s390x-6.0.0                ... libvirt: QEMU Driver error : unsupported configuration: asynchronous teardown is not available with this QEMU binary
OK
2410) QEMU XML def -> ARGV s390-async-teardown.s390x-6.0.0              ... SKIP

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Extract setup/parse step
Peter Krempa [Sat, 16 Dec 2023 15:30:57 +0000 (16:30 +0100)]
qemuxml2argvtest: Extract setup/parse step

Extract the common setup and parsing of the input XML into a separate
helper testQemuConfXMLCommon(). The helper has semantics which will
allow us to call it from multiple places so that VIR_TEST_RANGE will
still work properly even when we'll add multiple steps reusing the
prepared data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Setup fake driver only once
Peter Krempa [Sat, 16 Dec 2023 07:48:21 +0000 (08:48 +0100)]
qemuxml2argvtest: Setup fake driver only once

Move the setup of the fake driver from testCompareXMLToArgv to 'mymain'.
With this we also won't need to reset the fake drivers which was done
only partially.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Use virDomainDefParseFile instead of virXMLParse+virDomainDefParseNode
Peter Krempa [Sat, 16 Dec 2023 08:05:09 +0000 (09:05 +0100)]
qemuxml2argvtest: Use virDomainDefParseFile instead of virXMLParse+virDomainDefParseNode

As we don't do any additional parsing of the input file in
qemuxml2argvtest we can simplify the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2argvtest: Remove unused separate parsing of arch
Peter Krempa [Sat, 16 Dec 2023 07:58:55 +0000 (08:58 +0100)]
qemuxml2argvtest: Remove unused separate parsing of arch

Prior to all tests being converted to "DO_TEST_CAPS*" invocation the
fake-caps tests required knowing the architecture, which was pre-parsed
in qemuxml2argvtest. This code was now removed, but the arch parser was
forgotten.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2xmltest: Remove pointless inactive->active testing
Peter Krempa [Fri, 15 Dec 2023 21:51:48 +0000 (22:51 +0100)]
qemuxml2xmltest: Remove pointless inactive->active testing

'virDomainDefFormatInternalSetRootName' which is the top level XML
formatter function has the following condition as the very first thing:

     if (def->id == -1)
         flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;

This makes it pointless to separately do inactive->active and
inactive->inactive XML -> XML testing as both will be in the end treated
as inactive->inactive.

This patch adds a warning to virDomainDefFormatInternalSetRootName and
removes the second pointless invocation of the test from
qemuxml2xmtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 months agoqemuxml2*test: Remove FLAG_SKIP_CONFIG_ACTIVE flag
Peter Krempa [Tue, 5 Dec 2023 09:12:41 +0000 (10:12 +0100)]
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>
15 months agoqemuxml2xmltest: Parse all input files as inactive
Peter Krempa [Fri, 15 Dec 2023 15:30:32 +0000 (16:30 +0100)]
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>
15 months agoqemuxmlactivetest: Add qemu active XML to active/inactive XML tests
Peter Krempa [Mon, 18 Dec 2023 12:36:45 +0000 (13:36 +0100)]
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>
15 months agoqemuxmlactivetest: Prepare for proper active/inactive -> active/inactive testing
Peter Krempa [Fri, 15 Dec 2023 15:30:20 +0000 (16:30 +0100)]
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>
15 months agoqemu*xml2*test: Invoke tests from a function
Peter Krempa [Mon, 4 Dec 2023 16:00:54 +0000 (17:00 +0100)]
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>
15 months agotestutilsqemu: Create a typedef for struct testQemuInfo
Peter Krempa [Mon, 4 Dec 2023 21:28:10 +0000 (22:28 +0100)]
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>
15 months agotests: Rename 'qemustatusxml2xmltest' to 'qemuxmlactivetest'
Peter Krempa [Fri, 15 Dec 2023 12:39:49 +0000 (13:39 +0100)]
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>
15 months agotestCompareDomXML2XMLFiles: Sanitize handling of 'parse_flags'
Peter Krempa [Fri, 15 Dec 2023 14:57:50 +0000 (15:57 +0100)]
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>
15 months agoqemuxml2xmltest: Use same parameters as in qemuxml2argvtest for 'riscv64-virt'
Peter Krempa [Sat, 16 Dec 2023 18:59:15 +0000 (19:59 +0100)]
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>
15 months agoqemuxmlargvdata: disk-network-nfs: Drop 'index' attribute from backing store
Peter Krempa [Fri, 15 Dec 2023 15:12:21 +0000 (16:12 +0100)]
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>
15 months agoqemuxml2xmltest: Add invocation for 'numatune-auto-nodeset-invalid' case
Peter Krempa [Sat, 16 Dec 2023 19:18:13 +0000 (20:18 +0100)]
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>
15 months agovirschematest: Add possibility to have exceptions from the '-invalid' suffix
Peter Krempa [Fri, 15 Dec 2023 20:47:17 +0000 (21:47 +0100)]
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>
15 months agonews: Mention support for CPU clusters
Andrea Bolognani [Mon, 8 Jan 2024 16:47:45 +0000 (17:47 +0100)]
news: Mention support for CPU clusters

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agodocs: Document CPU clusters
Andrea Bolognani [Mon, 8 Jan 2024 15:11:51 +0000 (16:11 +0100)]
docs: Document CPU clusters

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agodocs: Improve documentation for CPU topology
Andrea Bolognani [Mon, 8 Jan 2024 15:13:25 +0000 (16:13 +0100)]
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>
15 months agotests: Verify handling of CPU clusters in QMP data
Andrea Bolognani [Mon, 8 Jan 2024 17:44:25 +0000 (18:44 +0100)]
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>
15 months agoqemu: Make monitor aware of CPU clusters
Andrea Bolognani [Fri, 5 Jan 2024 17:51:29 +0000 (18:51 +0100)]
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>
15 months agotests: Add test case for CPU clusters
Andrea Bolognani [Mon, 8 Jan 2024 15:21:25 +0000 (16:21 +0100)]
tests: Add test case for CPU clusters

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agoqemu: Use CPU clusters for guests
Andrea Bolognani [Fri, 5 Jan 2024 17:44:56 +0000 (18:44 +0100)]
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>
15 months agoqemu: Introduce QEMU_CAPS_SMP_CLUSTERS
Andrea Bolognani [Fri, 5 Jan 2024 17:42:13 +0000 (18:42 +0100)]
qemu: Introduce QEMU_CAPS_SMP_CLUSTERS

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
15 months agoconf: Allow specifying CPU clusters
Andrea Bolognani [Fri, 5 Jan 2024 17:20:14 +0000 (18:20 +0100)]
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>
15 months agoconf: Report CPU clusters in capabilities XML
Andrea Bolognani [Fri, 5 Jan 2024 15:03:54 +0000 (16:03 +0100)]
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>
15 months agotests: Add hostcpudata for machine with CPU clusters
Andrea Bolognani [Fri, 5 Jan 2024 14:07:06 +0000 (15:07 +0100)]
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>
15 months agovshAdmCatchDisconnect: Don't probe connection URI
Peter Krempa [Thu, 14 Dec 2023 16:13:08 +0000 (17:13 +0100)]
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>
15 months agovshAdmConnect: Preserve connection URI in ctl->connname if auto-detected
Peter Krempa [Thu, 14 Dec 2023 16:18:39 +0000 (17:18 +0100)]
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>
15 months agovirshCatchDisconnect: Don't probe connection URI
Peter Krempa [Thu, 14 Dec 2023 16:13:08 +0000 (17:13 +0100)]
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>
15 months agovirshReconnect: Preserve current URI if not explicitly set in ctl->connname
Peter Krempa [Thu, 14 Dec 2023 16:11:08 +0000 (17:11 +0100)]
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>
15 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 15 Jan 2024 04:59:27 +0000 (05:59 +0100)]
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>
15 months agoPost-release version bump to 10.1.0
Jiri Denemark [Mon, 15 Jan 2024 10:01:50 +0000 (11:01 +0100)]
Post-release version bump to 10.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 months agoRelease of libvirt-10.0.0
Jiri Denemark [Mon, 15 Jan 2024 09:58:03 +0000 (10:58 +0100)]
Release of libvirt-10.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 months agoNEWS: mention nbdkit config option
Jonathon Jongsma [Fri, 12 Jan 2024 15:17:56 +0000 (09:17 -0600)]
NEWS: mention nbdkit config option

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
15 months agonews: document auto-selection of VFIO variant drivers
Laine Stump [Sun, 14 Jan 2024 23:01:34 +0000 (18:01 -0500)]
news: document auto-selection of VFIO variant drivers

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
15 months agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Fri, 12 Jan 2024 12:42:28 +0000 (13:42 +0100)]
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
15 months agoci: Do more as part of .qemu-build-template
Andrea Bolognani [Fri, 12 Jan 2024 10:02:56 +0000 (11:02 +0100)]
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>