Commit Graph

43765 Commits

Author SHA1 Message Date
Tim Wiederhake
9dcfd7030a virSCSIVHostOpenVhostSCSI: Cleanup
Remove unnecessary label, goto, and closing of not-open file descriptor.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
ddf48de4c8 virBufferAddBuffer: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
6ba7e1b330 virSaveCookieParse: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
bea22ecfe2 virNetworkEventDispatchDefaultFunc: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
5755c159cd virDomainCapsCPUModelsCopy: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
cf1177178e virCHDomainObjBeginJob: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Tim Wiederhake
7badb6eeeb adminConnectListServers: Cleanup
Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-08 14:32:32 +01:00
Michal Privoznik
d4433a73e4 bridge_driver: Drop needless fwd declarations
Some forward declarations in bridge_driver.c are not needed
really. They only create a noise when trying to jump onto the
correct tag. Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-11-08 13:24:43 +01:00
Tim Wiederhake
3bc6f46d30 qemu: Invalidate capabilities cache on host cpuid mismatch
See https://bugzilla.redhat.com/show_bug.cgi?id=1953389.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
f3f67d4ecd virQEMUCapsCachePriv: Add host cpuid information
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
568ce029e7 virQEMUCaps: Add host cpuid information
Many things can affect the availability of cpu flags (e.g. software
upgrades, kernel versions, kernel command line, etc.) and invalidate the
cached capabilities without notice. Add CPUID information to the
capabilities cache.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
773e956c2f cpu_x86: Implement virCPUDataGetHost for x86
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
19b52d952b cpu_x86: Add virCPUDataGetHost
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
cb79953b88 virhostcpu: Add virHostCPUGetCPUID
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
85c339955c cpu_ppc64: Implement virCPUDataNewCopy for ppc64
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
be62707232 cpu_arm: Implement virCPUDataNewCopy for arm
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
3d85a14b34 cpu_x86: Implement virCPUDataNewCopy for x86
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
a9da679bb4 cpu: Add virCPUDataNewCopy
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
25890756ec cpu_ppc64: Implement virCPUDataIsIdentical for ppc64
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
ad30d86019 cpu_arm: Implement virCPUDataIsIdentical for arm
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
bcfeff8471 cpu_arm: No need to protect macro definitions
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
c78d7eea71 cpu_x86: Implement virCPUDataIsIdentical for x86
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
20fcf0e9e5 cpu: Add virCPUDataIsIdentical
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
399d6df60e cpu: Split up virCPUDataParse
This makes it possible to call virCPUDataParse with a xmlNodePtr,
which will be required by a later patch.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
6c72b352e5 cpu: Change virCPUArchDataParse to take xmlNodePtr
The function does not need a full xmlXPathContextPtr any longer and a
later patch will require a call to this function with only a xmlNodePtr
available.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
0abc73665b cpu_x86: Add x86ParseDataItemList
Factor out duplicated code from x86FeatureParse and virCPUx86DataParse.
This also consolidates error messages.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:25 +01:00
Tim Wiederhake
cab9be89b9 cpu_x86: Simplify x86ParseMSR
... by using virXMLProp*() helpers. These only require a xmlNodePtr and
do not need a xmlXPathContextPtr. Reflect that in the function signature.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:24 +01:00
Tim Wiederhake
3092ee9e9e cpu_x86: Simplify x86ParseCPUID
... by using virXMLProp*() helpers. These only require a xmlNodePtr and
do not need a xmlXPathContextPtr. Reflect that in the function signature.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 17:12:24 +01:00
Peter Krempa
ebd796b811 syntax-check: Fix regex for sc_require_attribute_cleanup_initialization
When I was cleaning up the regex after we removed most of our custom
autofree helpers I've forgot to delete one closing brace, thus the regex
was not matching anything.

Fixes: 65f702020e
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 15:00:53 +01:00
Michal Privoznik
adc9c08b03 remote_daemon: Validate tcp_min_ssf value only if found in config
If there is no tcp_min_ssf value set in daemon config we still
compare it against the default (56 which corresponds to DES) and
if the value is below our expected minimum (112 which corresponds
to 3DES) an error is reported and the daemon refuses to start.
This is not what we want. What we want is to check the value iff
the value was specified in the config file.

Fixes: 58a48cff84
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 14:46:48 +01:00
zhanglei
3edc7604bb NEWS: add guest interface information in 'virDomainGetGuestInfo'
Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
zhanglei
635e7e8f9c qemu: add guest interface information in 'qemuDomainGetGuestInfo'
Support return guest interface information from guest agent

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
zhanglei
85e4f3db7c qemu: refactor 'qemuAgentGetInterfaces'
Add report_unsupported parameter to qemuAgentGetInterfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
zhanglei
c6d009620a virsh: add interface information to guestinfo command
The new parameter group returns information about network interfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
zhanglei
348758b1b5 domain: add interface information to 'virDomainGetGuestInfo'
Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
Peter Krempa
c43f22d5c1 qemuTPMEmulatorReconfigure: Fix two build issues
1) 'activePcrBanksStr' is not initialized:

../../../libvirt/src/qemu/qemu_tpm.c: In function ‘qemuExtTPMStart’:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: ‘activePcrBanksStr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   28 |   g_free (*pp);
      |   ^~~~~~~~~~~~
../../../libvirt/src/qemu/qemu_tpm.c:613:22: note: ‘activePcrBanksStr’ was declared here
  613 |     g_autofree char *activePcrBanksStr;
      |                      ^~~~~~~~~~~~~~~~~

2) 'pwdfile_fd' is unused:

../../../libvirt/src/qemu/qemu_tpm.c:615:19: error: unused variable 'pwdfile_fd' [-Werror,-Wunused-variable]
        VIR_AUTOCLOSE pwdfile_fd = -1;

Fixes: a5bbe1a8b6
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2021-11-05 09:55:20 +01:00
Jiri Denemark
6cb5464ab4 qemu: Do not pass negative ncpus to virCapabilitiesClearHostNUMACellCPUTopology
It won't cause any harm as cpus is NULL when we pass a negative ncpus,
but doing so when the function expects unsigned value is not right.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 09:25:55 +01:00
Jiri Denemark
0402a66e8b qemu: Check return value of virJSONValueObjectAdd
The return value was not properly checked in the code for input type
evdev.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 09:25:55 +01:00
Jiri Denemark
185b06ba35 util: Avoid null pointer dereference when setting QoS on OVS
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 09:25:55 +01:00
Stefan Berger
a5bbe1a8b6 qemu: tpm: Extend TPM domain XML with PCR banks to activate
Extend the TPM backend XML with a node 'active_pcr_banks' that allows a
user to specify the PCR banks to activate before starting a VM. Valid
choices for PCR banks are sha1, sha256, sha384 and sha512. When the XML
node is provided, the set of active PCR banks is 'enforced' by running
swtpm_setup before every start of the VM. The activation requires that
swtpm_setup v0.7 or later is installed and may not have any effect
otherwise.

<tpm model='tpm-tis'>
  <backend type='emulator' version='2.0'>
    <active_pcr_banks>
      <sha256/>
      <sha384/>
    </active_pcr_banks>
  </backend>
</tpm>

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

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 09:22:50 +01:00
Andrea Bolognani
506c3a39d6 meson: Stop looking up ZFS programs at build time
At this point, we're no longer using the availability of the
ZFS programs at build time to decide whether to enable ZFS
support, so the only purpose of these find_program() calls is
to record their absolute paths.

However, the virCommand facilities that we're ultimately using
to run them are already capable of performing this lookup at
runtime, and in fact that's exactly what we already do in the
case of, for example, vstorage.

Drop the build time lookups and always perform them at runtime.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2021-11-04 19:02:06 +01:00
Andrea Bolognani
ca4dc9613f meson: Enable ZFS storage backend even more often
Commit 73a2ff3616 already improved the situation a lot. This
pushes things even further.

If the user or, more likely, the distro packager explicitly
asked for ZFS support to be enabled, then we should comply with
that request regardless of whether the necessary programs are
available at build time.

This is particularly important in the context of Debian, where
ZFS cannot be a build dependency of libvirt due to licensing
issues but it can still be an optional runtime dependency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2021-11-04 19:01:55 +01:00
Ján Tomko
58a48cff84 daemon: add tcp_min_ssf option
Add an option to allow the admin to requet a higher minimum SSF
for connections than the built-in default.

The current default is 56 (single DES equivalent, to support
old kerberos) and will be raised to 112 in the future.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-04 17:02:56 +01:00
Ján Tomko
5e3a0bb57c daemon: virNetSASLContext: store tcpMinSSF
Store the minimum SSF value for TCP connections
in virNetSASLContext and introduce a getter for it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-04 17:02:56 +01:00
Ján Tomko
de7288ae97 remote: warn on low SSF
Prepare for deprecating old kerberos ciphers by warning users
with a SSF lower than 112.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-04 17:02:56 +01:00
simmon
1c06334608 Translated using Weblate (Korean)
Currently translated at 100.0% (10441 of 10441 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
2021-11-04 14:39:56 +01:00
Ján Tomko
da0a5ef598 qemu: retire QEMU_CAPS_SPICE_UNIX
It is now unused.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-11-04 14:37:15 +01:00
Ján Tomko
8fef11c9fb qemu: always assume QEMU_CAPS_SPICE_UNIX
The presence of this capability depends on QEMU being compiled
with spice that has the SPICE_ADDR_FLAG_UNIX_ONLY constant.
It was added by spice commit 5365caeaae released in spice v0.12.6,
which is older than the spice version on our supported architectures.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-11-04 14:37:15 +01:00
Ján Tomko
d7c814f7f7 tests: convert name-escape to use real caps
For later QEMUs than 2.11 we do FD passing for character devices,
so lock the capabilites to this exact version.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-11-04 14:37:15 +01:00
Ján Tomko
65b0b746b5 tests: qemuxml2argv: use latest caps for spice tests
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-11-04 14:37:15 +01:00