Commit Graph

45724 Commits

Author SHA1 Message Date
Han Han
6e5852cb4b news: qemu: support kvm-poll-control performance hint
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:56 +02:00
Han Han
c9a37b64df news: Introduce "migrate_tls_force" to qemu.conf
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:55 +02:00
Han Han
c04bb76af7 news: qemu: Add 'fmode' and 'dmode' options for 9pfs
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:54 +02:00
Han Han
17fe7ae0cb news: qemu: virtiofs can be used without NUMA nodes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:53 +02:00
Han Han
95f9d4290c news: qemu: Introduce virtio free page reporting feature
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:51 +02:00
Han Han
49211723b6 news: qemu: Set noqueue qdisc for TAP devices
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:50 +02:00
Han Han
28deb22485 news: logging: allow max_len=0 to disable log rollover
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:49 +02:00
Han Han
07666093f7 news: cpu: Support for XML validation in cpu comparison
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:48 +02:00
Han Han
0529cf77f2 news: cpu_map: Add EPYC-Rome cpu model
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:46 +02:00
Han Han
02c898d801 news: support device stats collection for SR-IOV VF hostdev
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:42 +02:00
Han Han
cb12f8b8c8 news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:34 +02:00
Peter Krempa
f7c422993e doRemoteOpen: Refactor control flow
Use a temporary variable 'newconn' to hold the newly opened connection
until we are ready to pass it back instead of the original connection.

This way we can avoid complicated 'error'/'cleanup' sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
7f50557c08 virIdentityGetParameters: Return 'virTypedParamList'
Refactor the code to use virTypedParamList which simplifies cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
decc03857f virGetConnectGeneric: Fix memleak of 'identparams' when connecting between split daemons
The 'identparams' typed parameter list obtained from
virIdentityGetParameters is leaked when called from
'virGetConnectGeneric'.

Use 'virTypedParamListFromParams' to absorb it into a virTypedParamList
which can be autofreed.

Note that the memleak is observable only when running in split-daemon
mode.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/314
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
45064119c1 util: typedparam: Introduce virTypedParamListFromParams
The helper constructs a virTypedParamList from loose params.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Jan Kuparinen
6c9117c988 Translated using Weblate (Finnish)
Currently translated at 22.9% (2386 of 10419 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2022-05-18 09:04:46 +02:00
Peter Krempa
579403ba2e virclosecallbacks: Don't pass opqaue pointer to callback invocation
Remove the argument from the function prototypes and the callback
handler.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
e90301134c bhyveProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
2cada2c31c lxcProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
02fe5fe298 qemuProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
2f072e24db qemuMigrationSrcCleanup: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
6871553c3f lxc: Store 'driver' in VM private data
Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
f5c8abf176 bhyve: Store 'driver' in VM private data
Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
49ef0f95c6 qemuMigrationSrcBegin: Automatically free 'xml' variable on error
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
4f6b1fbcfa virObjectLockGuard: Require that returned value is used
The returned value is used to unlock the object, so all callers must
necessarily make use of the returned value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
66a014bc09 virclosecallbacks.h: Reformat header to contemporary style
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
58404f7871 qemu: fd: Fix documentation for FD set related functions
When dealing with fdsets only we don't need to pass the FD first as we
now generate fdset name directly. Also there are no more caveats in
passing multiple FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
4438b8ac09 qemuFDPassTransferCommand: Remove return value
Now that the 'direct' mode was separated and thus we don't have any
possible error case we can stop returning any values and simplify
callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
20ba291ebd qemu: fd: Remove support for 'direct' fd passing from 'qemuFDPass'
This finishes the separation of the fdset and direct helpers. Remove
'qemuFDPassNewDirect' and all internals which were applicable only in
direct mode.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
9bed5604db qemuFDPassValidate: Don't validate file descriptors
The callers adding the FDs are validating them regardless so this check
was redundant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
15bdced9b3 qemu: Use 'qemuFDPassDirect' for 'unix' chardevs
Unix socket chardevs with FD passing need to use the direct mode so we
need to convert it to use qemuFDPassDirect.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
7e1c24c925 qemu: Convert passing of 'slirpfd' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
1715dfce38 qemu: Convert passing of 'tapfds' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
7869eb9b31 qemu: Convert passing of 'vhostfd' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
bca9047906 qemu: fd: Add a distinct set of APIs for 'direct' fd passing mode
Originally I envisioned a common set of APIs for both FD passing
approaches but it turns out they are not really compatible enough for it
to make sense to use one set of APIs.

As of such introduce a distinct set of APIs for the 'direct' mode, which
will later be used to convert all places that currently use
'qemuFDPassNewDirect' and later clean up the existing APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
e04acdf39d qemu: EVENTHANDLERS.txt: Move to kbase and rSTisze
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
1095803ffa qemu: MIGRATION.txt: Move to kbase and rSTisze
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
b414c4a00a qemu: THREADS.txt: rSTize and move to knowledge-base
Move the internal documentation about qemu threading to the knowledge
base.

The conversion included rstizing of the text document, mainly just
fixing of the headline and enclosing function names and code examples
into code block sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
fcd7741c48 qemuBuildCommandLine: Remove 'flags' argument
The flags are not used for anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
bab089d379 qemuBuildCommandLine: Don't avoid '-S' flag for 'domxml-to-native' conversion
The commandline generated from our XML->native convertor is the majority
of cases not usable without libvirt anyways and the situation will not
improve any more.

As of such there's no much utility of avoiding the use of stopped CPUs
flag in such case.

Remove the QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING flag and the associated
logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
2afaa6894e qemuBuildCommandLine: Inline qemuCheckFips
Now that we store the state of the host FIPS mode setting in the qemu
driver object, we don't need to outsource the logic into
'qemuCheckFips'.

Additionally since we no longer support very old qemu's which would not
yet have --enable-fips we can drop the part of the comment about very
old qemus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
9b765882cd qemuBuildCommandLine: Remove 'driver' argument
We pass 'vm' which already contains it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
d810ae2fae qemuConnectDomainXMLToNative: Refactor cleanup
Automatically free the 'vm' temporary domain object and remove the
'cleanup' label and 'ret' helper variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
343920794d qemuBuildCommandLine: Sanitize debug logging
Improve the debug log inside 'qemuBuildCommandLine' to include the name
from the definition and remove useless data such as the pointer to the
qemuDriver object or qemuCaps.

Additionally remove the non-specific debug statements:

  VIR_DEBUG("Building emulator command line");

from the two callers of qemuBuildCommandLine.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
b5fd6f2b68 qemu: Store state of FIPS in virQEMUDriver
Rather than re-query all the time we can cache the state of FIPS of the
host as it will not change during the runtime of the guest.

Introduce a 'hostFips' flag to 'virQEMUDriver' and move the code
checking the state from 'qemuCheckFips' to 'qemuStateInitialize' and
also populate 'hostFips' in qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
552790edf2 qemuBuildCommandLine: Convert 'standalone' flag to use 'flags'
Introduce 'qemuBuildCommandLineFlags' and use it instead of specific
flag booleans.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
0b64b75a09 qemu: command: Don't hide 'vhost' fds from 'standalone' command line
We already format a commandline using FD passing for the tap devices so
formatting the 'vhost' file descriptors won't make it any less usable
directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
5b9c880e89 docs: drvqemu: Decrease expectations about command line from 'virsh domxml-to-native'
In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
6272e780e2 virConnectDomainXMLToNative: Add note about dynamically configured features
In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config" as
returned by 'virConnectDomainXMLToNative'.

Similarly at least the commandline for qemu contains resources passed
via file descriptors which are obviously not part of the returned
"native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
7bbfabc6b2 qemu: Implement 'absolute' clock offset mode
Add support for the mode and add the corresponding qemuxml2argv test
case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-17 19:30:59 +02:00