Commit Graph

44479 Commits

Author SHA1 Message Date
Peter Krempa
cb15bf9d4d tests: qemucapabilities: Add test data for the qemu-7.0 development cycle
Update to commit v6.2.0-874-g1cd2ad11d3

Notable changes are:
- added flag noting that use of JSON syntax for -device was fixed
- 'dbus' backend for graphics and character devices added
- virtio-mem added 'node' property
- 'clusters' added to CPU topology
- 'open-timeout' property for NBD protocol backend
- 'wheel-left' and 'wheel-right' event types for 'input-send-event'
- increased default resolution to '1280x800' on 'virtio-gpu'
- SGX property 'section-size' changed to 'sections' incompatibly
  (unused luckily)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-17 09:26:17 +01:00
Peter Krempa
8a1e6c1ab1 qemuxml2(argv|xml)data: x86-kvm-32-on-64: Add machine type
The machine type doesn't change the test result and prevents tests being
changed every time we are about to update real capabilities to a new
qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-17 09:26:17 +01:00
Michal Privoznik
4f6d5656d3 tests: Report expected monitor command for simulated commands
There are two tests currently that simulate QMP talk:
qemucapabilitiestest and qemuhotplugtest. In both cases they
check whether currently executed command is the one for which
reply was provided. If not an error message is reported. However,
the error message contains only the actual command and not the
expected one. This makes it harder to navigate through .replies
files.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-15 06:33:33 +01:00
Göran Uddeborg
6076ca7a03 Translated using Weblate (Swedish)
Currently translated at 30.5% (3191 of 10455 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>
2022-01-14 23:16:33 +01:00
Daniel P. Berrangé
c723a98618 qemu: split handling of distinct firmware enum conversions
The qemuFirmwareOSInterfaceTypeFromOsDefFirmware method
was added to convert from virDomainOsDefFirmware to the
qemuFirmwareOSInterface enum.

It was later also used to convert from virDomainLoader
to qemuFirmwareOSInterface in:

  commit 8e1804f9f6
  Author: Michal Prívozník <mprivozn@redhat.com>
  Date:   Tue Dec 17 17:45:50 2019 +0100

    qemu_firmware: Try to autofill for old style UEFI specification

This caused compile errors with clang due to passing a
mis-matched enum type. These were later silenced by
stripping the enum types:

  commit 8fcee47807
  Author: Michal Prívozník <mprivozn@redhat.com>
  Date:   Wed Jan 8 09:42:47 2020 +0100

    qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()

This is still rather confusing to humans reading the
code. It is clearer to just define a separate helper
method for the virDomainLoader type conversion.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-14 18:56:39 +00:00
Daniel P. Berrangé
4bb150ed3a docs: use virYesNo definition in more schemas
A few places are still using an expend yes/no choice instead of the
common virYesNo definition.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-14 18:56:37 +00:00
Daniel P. Berrangé
08e3d9ed24 docs: split example for <os> schema
The docs illustration for the <os> schema contains a mixture of
incompatible configuration options. This is rather confusing and
misleading to users. Splitting the illustration into four separate
examples clarifies the situation.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-01-14 18:56:23 +00:00
Ivan Teterevkov
19407e8d7d meson: Detect rst2html5 and rst2man only when needed
Detect these commands in docs/meson.build, i.e. only when
users enable documentation.

Signed-off-by: Ivan Teterevkov <ivan.teterevkov@nutanix.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-01-14 18:17:56 +01:00
Peter Krempa
717f1cc4d1 virDomainSnapshotRedefinePrep: Don't do partial redefine
'virDomainSnapshotRedefinePrep' does everything needed for a redefine
when the snapshot exists but not when we are defining metadata for a new
snapshot. This gives us weird semantics.

Extract the code for replacing the definition of an existing snapshot
into a new helper 'virDomainSnapshotReplaceDef' and refactor all
callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
d281c1323f virDomainSnapshotAssignDef: Clear second argument when it is consumed
Rather than callers second-guessing when the snapshot definition is
assigned turn it into a double pointer and clear it on success.

Fix callers to work with the new semantics.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
91df85e057 qemuDomainSnapshotLoad: Refactor handling of snapshot definition object
Move the variable holding the snapshot definition into the loop and use
automatic clearing for it. Adjust the code for parity.

Note that the clearing of 'snapdef' on success of
'virDomainSnapshotAssignDef' will be refactored in upcoming patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
2d0f7d779d qemuSnapshotCreate: Standardize handling of the reference on @snapdef
As with qemuSnapshotRedefine, make an extra reference in a temporary
autocleaned variable and use that instead of refing the definition after
it's stolen.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
c0fd70c1e1 qemuSnapshotCreate: Use 'snapdef' instead of 'def'
'def' is commonly used for domain definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
4584a451e6 testDomainSnapshotCreateXML: Extract snapshot redefinition code
The test driver code was copied from qemu but wasn't refactored
recently. Split out the redefinition code similarly to what qemu driver
did.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
bec2a922bd virDomainSnapshotRedefineValidate: Don't modify the snapshot definition
It is not expected that a function with 'Validate' in the name actually
modifies the validated object, even worse when it even modifies another
object and the ultimatively worst bit is that it doesn't undo the mess
if the validation fails midway.

Move the stealing of the domain definition from the definition of a
snapshot being redefined into the caller along with the call to
virDomainSnapshotAlignDisks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
504b108cb9 virDomainSnapshotRedefinePrep: Use 'snapdef' for snapshot definition object
We use this variable name to distinguish it from the domain definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:58 +01:00
Peter Krempa
d1d4983dfc virDomainSnapshotRedefineValidate: Unexport
The function isn't used outside of src/conf/snapshot_conf.c as of
57d252c74

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:11:33 +01:00
Peter Krempa
ef3f3884a2 virDomainSnapshotAlignDisks: Allow alternate domain definition when redefining
Due to historical reasons we allow users to redefine an existing
snapshot without providing the domain definition which would correspond
to it. In such case we'd use the domain definition from the snapshot
that is being redefined.

To prevent callers from doing complex moving of the domain definition
object back and forth between the snapshot definitions we can add an
argument to virDomainSnapshotAlignDisks which will allow us to pass in
the alternate definition if the one from the snapshot is missing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:30 +01:00
Peter Krempa
0b97d87a6d virDomainSnapshotAlignDisks: Move 'require_match' selection logic inside
'require_match' set to true is only needed for internal snapshots taken
by hypervisors (qemu) which don't have a way to control which disks take
part in the snapshot (savevm).

To de-clutter callers we can change the argument to mean 'this code path
requires uniform snapshot for internal snapshots'.

Change the argument and fix the callers. For now all callers pass 'true'
but any new hypervisor or even usage in qemu is not going to share the
limitation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:30 +01:00
Peter Krempa
311b300d85 virDomainSnapshotAlignDisks: Convert @default_snapshot to virDomainSnapshotLocation
Use the appropriate type for the variable and fix all callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:29 +01:00
Peter Krempa
94686f1919 virDomainSnapshotAlignDisks: Improve function comment
Add description of arguments, reword the description for clarity, and
fix improper argument names mentioned in the existing description.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:29 +01:00
Peter Krempa
82e0a1878e virDomainSnapshotRedefineValidate: Fix validation of VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag
External snapshot with memory is created without using the
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag, but rather with properly
configuring the XML. When redefining the code should be checking the
same thing as by definition an external snapshot with memory is not a
disk-only snapshot.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:29 +01:00
Peter Krempa
ebfe9b1a15 virDomainMomentAssignDef: Simplify error handling
Remove error handling from the call to 'virDomainMomentObjNew' as it
can't return NULL and replace 'virHashAddEntry' by 'g_hash_table_insert'
as we've already checked that snapshot with such name doesn't exist in
the hash table. This removes handling for two impossible errors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-14 18:05:29 +01:00
Divya Garg
abf9eac87c qemu: add index for isa-serial device using target.port
VM XML accepts target.port but this does not get passed while
building the QEMU command line for this VM.

Signed-off-by: Divya Garg <divya.garg@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:41:57 +01:00
Divya Garg
11ddab1daf Add the port allocation logic for isa-serial devices.
This commit takes care of following cases:
-> Check availability of requested ports.
  ->The total number of requested ports should not be more than
    VIR_MAX_ISA_SERIAL_PORTS.
  ->The ports requested should be less than VIR_MAX_ISA_SERIAL_PORTS.
  ->VIR_MAX_ISA_SERIAL_PORTS should correspond to MAX_ISA_SERIAL_PORTS
    specified in QEMU code commit def337ffda34d331404bd7f1a42726b71500df22.
-> Prevent duplicate device assignments to the same port.
-> In case no ports are provided in the XML, this patch scans the list of unused
   isa-serial indices to automatically assign available ports for this VM.

Signed-off-by: Divya Garg <divya.garg@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:41:57 +01:00
Tim Wiederhake
d8f6e198bf virInterfaceDefParse: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:50 +01:00
Tim Wiederhake
56b4186efc virInterfaceDefParseXML: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:50 +01:00
Tim Wiederhake
7443101eb0 virInterfaceDefParseIfAdressing: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:50 +01:00
Tim Wiederhake
a2d7bb4062 virInterfaceDefParseProtoIPv6: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:50 +01:00
Tim Wiederhake
f4b970dc2a virInterfaceDefParseProtoIPv4: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
86cfd4d4e8 virInterfaceDefParseDhcp: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
5f9c35ffd6 virInterfaceDefParseIP: Simplify and cleanup
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
91624098e0 virInterfaceDefParseXML: Inline trivial virInterfaceDefParseName
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
3d54880af1 conf: interface: Remove ret and goto
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
9dde307c44 conf: interface: Use g_auto
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
77eb77ef4a conf: interface: Preparation for g_auto
These changes make the g_auto-ification in the next commit clearer.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Tim Wiederhake
c5860d177b virInterfaceDefDevFormat: Add missing error handling
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-14 15:38:49 +01:00
Jiri Denemark
fdc5f5d7ac Post-release version bump to 8.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-14 15:17:26 +01:00
Jiri Denemark
5f6025945b Release of libvirt-8.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-14 15:03:30 +01:00
Göran Uddeborg
347d954dfa Translated using Weblate (Swedish)
Currently translated at 30.3% (3175 of 10455 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>
2022-01-13 22:16:32 +01:00
Andrea Bolognani
55a248d354 virt-ssh-helper: Move manual page to section 8
While sections are somewhat loosely defined and thus the choice
is not quite a clear-cut one, section 8 might be a slightly
better fit in this case.

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-13 16:07:56 +01:00
Martin Kletzander
537b51daeb Print errors on daemon startup if logging setup fails
Fixes: a873924e36

https://bugzilla.redhat.com/show_bug.cgi?id=2039652

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-13 15:43:13 +01:00
Peter Krempa
d0198641bf NEWS: Mention propagation of sub-cluster allocation on snapshots and block-copy
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-13 13:51:30 +01:00
Michal Privoznik
c157c9c106 NEWS: Document my contributions for upcoming release
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-13 12:18:31 +01:00
Stefan Berger
7c17572798 docs: tpm: Clarify omission or removal of active_pcr_banks node
Add a sentence to the active_pcr_banks node documentation that clarifies
that when the active_pcr_banks node is removed from the XML or when it
is omitted that the set of active PCR banks is not changed anymore.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039246
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-13 10:44:15 +01:00
Boris Fiuczynski
654c72ee94 docs: minor fix in launchSecurity
Correcting XML element.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-01-13 10:22:24 +01:00
Peter Krempa
59e0d130fe qemuSnapshotRedefine: Fix use of snapshot definition after free
Commit f4aae9726d factored out the snapshot redefinition code into a
separate function, but didn't account for the fact that the code is
consuming the reference to the snapshot definition and by moving the
code away the caller (qemuSnapshotCreateXML) now frees the definition
which didn't happen before as we cleared the pointer.

Fix it by increasing the reference locally. Later patches will refactor
the code so that it's more obvious what's happening.

Fixes: f4aae9726d
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039651
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-13 09:22:49 +01:00
Peter Krempa
56f4ec311f qemuSnapshotRedefine: Rename 'def' to 'snapdef'
'def' is commonly used to refer to domain definition. Most of the
snapshot code uses 'snapdef' for the snapshot definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-01-13 09:22:49 +01:00
Peter Krempa
164aba8c4a qemuSnapshotCreate: Don't insert snapshot into list with VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA
Our approach to snapshots without metadata was to insert them to the
snapshot list and then later remove them from the list when the flag is
present.

This quirky logic was broken in a recent refactor of the snapshot code
causing that the snapshot stayed inserted in the snapshot list.

Recent refactor of the snapshot code didn't faithfully relocate this
logic to the new function.

Rather than attempting to restore the quirky logic of adding and then
removing the object, don't add the snapshot into the list at all when
the user doesn't want metadata.

We achieve this by creating a temporary 'virDomainMomentObj' wrapper
which is not inserted into the list and using that instead of calling
virDomainSnapshotAssignDef.

Fixes: 9bad0fb809
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039131
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-12 16:02:13 +01:00
Peter Krempa
6ba3334222 conf: moment: Export helpers to create the virDomainMoment wrapper
Export 'virDomainMomentObjNew' and 'virDomainMomentObjFree' and define
the latter as autoptr cleanup function for 'virDomainMomentObj'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-12 16:00:18 +01:00