Commit Graph

44281 Commits

Author SHA1 Message Date
Ján Tomko
7a50e524df build: do not search for radvd binary
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
7193ef2bed conf: remove radvdPid from virNetworkObj
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
665702135e network: driver: remove unused radvdStateDir variable
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
b4efa0cfc5 network: remove any code dealing with radvd
Since dnsmasq supports --ra-param for a long time, this code is now
unused.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
4ddd442687 util: dnsmasq: delete assumed capability flags
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
c8e45725f9 network: assume DNSMASQ_CAPS_RA_PARAM
Introduced by dnsmasq commit:
commit c4cd95df68b573b63d234ecdb675228657d65353
Author:     Simon Kelley <simon@thekelleys.org.uk>
CommitDate: 2013-10-10 20:58:11 +0100

    Add --ra-param and remove --force-fast-ra

git describe: v2.67rc3-3-gc4cd95d contains: v2.67rc4~12

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
0927510d7f network: assume DNSMASQ_CAPS_BIND_DYNAMIC
Introduced by dnsmasq commit:
commit 54dd393f3938fc0c19088fbd319b95e37d81a2b0
CommitDate: 2012-06-20 11:23:38 +0100

    Add --bind-dynamic

git describe: v2.63test1 contains: v2.63test1^0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
ac0028f541 util: remove DNSMASQ_RA_SUPPORT
Now that the macro is unused, delete it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
166fdbad6c network: assume DNSMASQ_RA_SUPPORT
Delete the code that is only run without the capability.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
e3baacd344 network: assume DNSMASQ_DHCPv6_SUPPORT
Remove the (now unreachable) error message and the macro.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
80d1a5ff2e util: dnsmasq: mandate at least version 2.67
All the capabilities should be supported in 2.67.
Make this the minimum version, since even the oldest
distros we support have moved on:

Debian 8: 2.72
CentOS 7: 2.76
Ubuntu 18.04: 2.79

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
6b59d6cac1 tests: do not test dnsmasq older than 2.67
Prepare to retire older versions by droping older tests.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Ján Tomko
b9a4c5f8c8 util: dnsmasqCapsSetFromBuffer: use error label
Rename 'fail' to 'error' to match the prevalent usage.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Michal Privoznik
be592a6ebb meson: Detect XDR only when needed
If remote driver was disabled there is no need to check whether
host has a XDR library installed.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/196
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
a642cc648c meson: Require XDR for wireshark
The way our wireshark dissector works is by providing decoders
for primitive types (like integers, string, double, etc.) and
then parsing virsomethingprotocol.x files and generating complex
decoders for RPC. This obviously means that XDR is required for
the dissector, but corresponding check was missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
de617ce96b admin: Build only when RPC is available
The admin module is very closely tied to RPC. If we are
building without RPC support there's not much use for the
admin module, in fact it fails to build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
b7ccae7f1f logging: Build log manager only when RPC is available
The logging manager is very closely tied to RPC. If we are
building without RPC support there's not much use for the
manager, in fact it fails to build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
377f67d5b3 rpc: Build only when XDR is available
Our RPC layer is as tied to XDR as possible. Therefore, if we
haven't detected and XDR library there's not much sense in trying
to build RPC layer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
1bbcc79e0e rpc: Separate out socket code into another static lib
There's nothing RPC specific about virnettlscontext.c or
virnetsocket.c. We use TLS for other things than just RPC
encryption (e.g. for generating random numbers) and sockets can
be used even without RPC.

Move these two sources into a static library (virt_socket) so
that other areas can use it even when RPC is disabled.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:43 +01:00
Michal Privoznik
81025a6a18 libvirt-stream: Don't require RPC module
When implementing sparse streams, one of improvements I did was
to increase client buffer size for sending/receiving stream data
(commit v1.3.5-rc1~502). Previously, we were using 64KiB buffer
while packets on RPC are 256KiB (usable data is slightly less
because of the header). This meant that it took multiple calls of
virStreamRecv()/virStreamSend() to serve a single packet of data.
In my fix, I've included the virnetprotocol.h file which provides
VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX macro which is the exact size
of data in a single packet. However, including the file from
libvirt-stream.c which implements public APIs is not right. If
RPC module is not built then the file doesn't exists.

Redefine the macro and drop the include. The size can never
change anyways.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:43 +01:00
Tim Wiederhake
0519787f88 docs: domain: Clarify on the dangers of migrating with hyperv-passthrough enabled
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 11:53:08 +01:00
Tim Wiederhake
fdec0cbf43 Fix some typos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 11:52:54 +01:00
Jiri Denemark
7ab39cf04b qemu: Drop driver parameter from qemuDomainSetFakeReboot
And its callers. The parameter is no longer used since virDomainObjSave
was replaced with qemuDomainSaveStatus wrapper.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 10:44:50 +01:00
Jiri Denemark
38fb9106ed qemu: Use qemuDomainSaveStatus
It is a nice wrapper around virDomainObjSave which logs a warning, but
otherwise ignores the error. Let's use it where appropriate.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 10:44:50 +01:00
Jiri Denemark
877d1c2478 qemu: Add support for return-path migration capability
When return-path is enabled, QEMU on the source host won't report
completed migration until the destination QEMU sends a confirmation it
successfully loaded all data. Libvirt would detect such situation in the
Finish phase and report the error read from QEMU's stderr back to the
source, but using return-path could give use a bit better error
reporting with an earlier restart of vCPUs on the source.

The capability is only enabled when the connection between QEMU
processes on the source and destination hosts is bidirectional. In other
words, only when VIR_MIGRATE_TUNNELLED is not set, because our tunnel
only allows one-way communication from the source to the destination.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 10:44:50 +01:00
Jiri Denemark
4f9f3c5d13 qemu: Support enabling migration caps unless a flag is used
So far we were enabling specific migration capabilities when a
corresponding API flag is set. We need to generalize our code to be able
to enable some migration capabilities unless a particular API flag is
used.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 10:44:50 +01:00
Daniel P. Berrangé
7826148a72 qemu: report max number of SEV guests
Different CPU generations have different limits on the number
of SEV/SEV-ES guests that can be run. Since both limits come
from the same overall set, there is typically also BIOS config
to set the tradeoff betweeen SEV and SEV-ES guest limits.

This is important information to expose for a mgmt application
scheduling guests to hosts.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
2150c7c9f7 util: pull CPUID helper function out of CPU driver
This will be needed directly in the QEMU driver in a later patch.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
0ac34b614b include: define parameters for reporting SEV guest limits
There are limits on the number of SEV/SEV-ES guests that can
be run on machines, which may be influenced by firmware
settings. This is important to expose to users.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
34cb8f6fcd conf: extend domain capabilities for max SEV guest count
There are limits on the number of SEV/SEV-ES guests that can
be run on machines, which may be influenced by firmware
settings. This is important to expose to users.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
719bb0bf23 tools: add 'nodesevinfo' virsh command
While some SEV info is reported in the domain capabilities,
for reasons of size, this excludes the certificates. The
nodesevinfo command provides the full set of information.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
ac79e9ff5c tools: add 'domlaunchsecinfo' virsh command
This command reports the launch security parameters for
a guest, allowing an external tool to perform a launch
attestation.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
8c071180cf qemu: report new launch security parameters
Report extra info about the SEV setup, returning those fields
that are required to calculate the expected launch measurement

 HMAC(0x04 || API_MAJOR || API_MINOR || BUILD ||
      GCTX.POLICY || GCTX.LD || MNONCE; GCTX.TIK)

specified in section 6.5.1 of AMD Secure Encrypted
Virtualization API.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
cc9679ef14 qemu: add monitor APIs for query-sev
We're only returning the set of fields needed to perform an
attestation, per the SEV API docs.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
5842163910 qemu: report error querying launch params for inactive guest
Querying launch params on a inactive guest currently triggers
a warning about the monitor being NULL.

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

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
36fa504dd7 include: add new launch security parameters
Three more parameters are required in order that clients can
perform a launch attestation on the SEV guest.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Jim Fehlig
cbae4eaa19 libxl: Implement domainGetMessages API
Since commit 46783e6307, the 'virsh dominfo' command calls
virDomainGetMessages to report any messages from the domain.
Hypervisors not implementing the API now get the following
libvirtd log message when clients invoke 'virsh dominfo'

this function is not supported by the connection driver: virDomainGetMessages

Although libxl currently does not support any tainting or
deprecation messages, provide an implementation to squelch
the previously unseen error message when collecting dominfo.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 08:55:36 -07:00
Tim Wiederhake
8b6766bd77 docs: domain: Add documentation for hyperv passthrough mode
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:46 +01:00
Tim Wiederhake
565524fb5f tests: Add tests for hyperv-passthrough
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
ec0616cac3 schema: hyperv: Add mode "passthrough"
This mode will enable all enlightenments known to the hypervisor. See
https://bugzilla.redhat.com/show_bug.cgi?id=1851249

Example:

  <features>
    <hyperv mode='passthrough'/>
    ...
  </features>

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
9c2afd17fd conf: domain: Add hyperv passthrough mode
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
da9f798445 docs: domain: Add documentation for "hyperv"'s new "mode" attribute
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
5050b71da0 virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
6e83fafe33 virDomainFeaturesHyperVDefParse: Read attribute "mode" of element "hyperv"
Currently, this attribute may either have a value of "custom", or be absent
(which defaults to "custom"), for backwards compatibility.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
cc1546ac6b conf: domain: Define enum for HyperV mode
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
33d9d3806c schema: Add optional "mode" attribute to hyperv
Allow for an optional attribute "mode", set to the string "custom".

Later patches will introduce different modes. Omitting this attribute
will default to "custom" for backwards compatibility.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
fa0789cc0c schema: Wrap hyperv element in choice and group
This does not change the schema, but will make upcoming changes
easier.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Ján Tomko
6698d8f530 util: use g_auto in virNodeSuspendHelper
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 16:41:36 +01:00
Ján Tomko
00a565aa78 util: refactor virNodeSuspendSetNodeWakeup
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 16:41:36 +01:00
Ján Tomko
9abf18ace7 util: iscsi: use two vars in CreateIfaceIQN
Do not mix automatic and manual cleanup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 16:41:36 +01:00