]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agovsh-table: Hide vshTableRow typedef
Michal Privoznik [Wed, 15 Dec 2021 09:35:50 +0000 (10:35 +0100)]
vsh-table: Hide vshTableRow typedef

There's no need for any caller to know vshTableRow typedef.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovshtabletest: Fix potential memleak
Michal Privoznik [Wed, 15 Dec 2021 09:23:15 +0000 (10:23 +0100)]
vshtabletest: Fix potential memleak

In testVshTableNew() we test whether vshTableNew(NULL) allocates
a table. This is expected to fail (and return NULL), because
passing nothing but NULL to vshTableNew() is viewed as error.
Nevertheless, if vshTableNew() did not fail and returned an
allocated table it would be leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: Document recent numatune change
Michal Privoznik [Thu, 16 Dec 2021 15:36:47 +0000 (16:36 +0100)]
NEWS: Document recent numatune change

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu_command: do use host-nodes for system memory
Michal Privoznik [Wed, 15 Dec 2021 15:46:27 +0000 (16:46 +0100)]
qemu_command: do use host-nodes for system memory

After previous commit, it's no longer possible to change nodeset
for strict numatune. Therefore, we can start generating
host-nodes onto command line again.

This partially reverts d73265af6ec41104c20633b5c0a23688a62105e6.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Explicitly forbid live changing nodeset for strict numatune
Michal Privoznik [Wed, 15 Dec 2021 13:20:21 +0000 (14:20 +0100)]
qemu: Explicitly forbid live changing nodeset for strict numatune

Let's imagine a guest that's configured with strict numatune:

  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>

For guests with NUMA:
Depending on machine type used (see commit v6.4.0-rc1~75) we
generate either:

  1) -object '{"qom-type":"memory-backend-ram","id":"ram-node0",\
               "size":20971520,"host-nodes":[0],"policy":"preferred"}' \
     -numa node,nodeid=0,cpus=0,memdev=ram-node0

or

  2) -numa node,nodeid=0,cpus=0,mem=20480

Later, when QEMU boots up and cpuset CGroup controller is
available we further restrict QEMU there too. But there's a
behaviour difference hidden: while in case 1) QEMU is restricted
from beginning, in case 2) it is not and thus it may happen that
it will allocate memory from different NUMA node and even though
CGroup will try to migrate it, it may fail to do so (e.g. because
memory is locked). Therefore, one can argue that case 2) is
broken. NB, case 2) is exactly what mode 'restrictive' is for.
However, in case 1) we are unable to update QEMU with new
host-nodes, simply because it's lacking a command to do so.

For guests without NUMA:
It's very close to case 2) from above. We have commit
v7.10.0-rc1~163 that prevents us from outputting host-nodes when
generating memory-backend-* for system memory, but that simply
allows QEMU to allocate memory anywhere and then relies on
CGroups to move it to desired location.

Due to all of this, there is no reliable way to change nodeset
for mode 'strict'. Let's forbid it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive()
Michal Privoznik [Wed, 15 Dec 2021 15:11:28 +0000 (16:11 +0100)]
qemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive()

The whole idea of VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE is that the
memory location is restricted only via CGroups and thus can be
changed on the fly (which is exactly what
qemuDomainSetNumaParamsLive() does. Allow this mode there then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agovirsh-completer: Provide completer for numatune --mode
Michal Privoznik [Thu, 16 Dec 2021 14:46:31 +0000 (15:46 +0100)]
virsh-completer: Provide completer for numatune --mode

The completer is trivial, just iterate over
virDomainNumatuneMemMode enum and convert each integer into its
string comrade.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agomanpages: Document 'restrictive' mode for numatune
Michal Privoznik [Thu, 16 Dec 2021 14:49:03 +0000 (15:49 +0100)]
manpages: Document 'restrictive' mode for numatune

While we document possibility of passing an integer from
virDomainNumatuneMemMode enum, we list string variants to only
the first three enum members. The fourth (and so far the last)
member is called 'restrictive' and thus should be documented.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemucapabilitiesdata: Fix command name in caps_3.0.0.ppc64.replies
Michal Privoznik [Fri, 17 Dec 2021 08:29:38 +0000 (09:29 +0100)]
qemucapabilitiesdata: Fix command name in caps_3.0.0.ppc64.replies

Under the qemucapabilitiesdata we have a replies file for
QEMU-3.0.0.ppc64. At least we think so. In fact, the file
contains replies from a development snapshot release that
predates 3.0.0 (specifically it's v2.12.0-1689-g518d23a) and as
such does not reflect any change that was made to QEMU after the
snapshot and before the official relase. One of such changes was
renaming 'exit-preconfig' command to 'x-exit-preconfig' (QEMU
commit v3.0.0-rc1~21^2~3). Ideally, we would just regenerate
capabilities using the official release but since this is a PPC64
machine and pretty old version anyway let's just fix the command
name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: format sev-guest.kernel-hashes property
Daniel P. Berrangé [Thu, 9 Dec 2021 14:57:05 +0000 (09:57 -0500)]
qemu: format sev-guest.kernel-hashes property

Set the kernel-hashes property on the sev-guest object if the config
asked for it explicitly. While QEMU machine types currently default to
having this setting off, it is not guaranteed to remain this way.

We can't assume that the QEMU capabilities were generated on an AMD host
with SEV, so we must force set the QEMU_CAPS_SEV_GUEST. This also means
that the 'sev' info in the qemuCaps struct might be NULL, but this is
harmless from POV of testing the CLI generator.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotests: allow setting extra capabilities on top of versioned caps
Daniel P. Berrangé [Thu, 9 Dec 2021 14:57:05 +0000 (09:57 -0500)]
tests: allow setting extra capabilities on top of versioned caps

In the QEMU tests a test can either use an explicitly listed set of
capabilities, or can request those matching a particular QEMU
version. Sometimes it is desirable to be able to list extra caps
on top of those implied by a particular version.

This is useful, for example, when QEMU won't report certain features
unless it was run on particular hardware or kernels, and those were
not used when a caps snapshot was imported to the libvirt source tree.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: probe for sev-guest.kernel-hashes property
Daniel P. Berrangé [Thu, 9 Dec 2021 14:39:22 +0000 (09:39 -0500)]
qemu: probe for sev-guest.kernel-hashes property

This sev-guest object property indicates whether QEMU should
expose the kernel, ramdisk, cmdline hashes to the firmware
for measurement.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoconf: add support for setting SEV kernel hashes
Daniel P. Berrangé [Thu, 9 Dec 2021 10:21:04 +0000 (05:21 -0500)]
conf: add support for setting SEV kernel hashes

Normally the SEV measurement only covers the firmware
loader contents. When doing a direct kernel boot, however,
with new enough OVMF it is possible to ask for the
measurement to cover the kernel, ramdisk and command line.

It can't be done automatically as that would break existing
guests using direct kernel boot with old firmware, so there
is a new XML setting allowing this behaviour to be toggled.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: validate VNC password length
Daniel P. Berrangé [Thu, 16 Dec 2021 10:20:37 +0000 (10:20 +0000)]
qemu: validate VNC password length

The VNC password authentication scheme is quite horrendous in that it
takes the user password and directly uses it as a DES case. DES is a
byte 8 keyed cipher, so the VNC password can never be more than 8
characters long. Anything over that length will be silently dropped.

We should validate this length restriction when accepting user XML
configs and report an error. For the global VNC password we don't
really want to break daemon startup by reporting an error, but
logging a warning is worthwhile.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: qemu_command: clean up includes
Ján Tomko [Wed, 15 Dec 2021 14:53:27 +0000 (15:53 +0100)]
qemu: qemu_command: clean up includes

Over time, the code using them got split into other files.
(Mostly qemu_interface.c and qemu_process.c)

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
3 years agoqemuxml2argvtest: disk-missing-target: Add two disks with same bus
Peter Krempa [Thu, 16 Dec 2021 13:07:48 +0000 (14:07 +0100)]
qemuxml2argvtest: disk-missing-target: Add two disks with same bus

A recent code movement introduced a bug which reproduces only when there
are two disks on the same bus missing the target. Improve the test case
for the missing target test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainDiskInsert: Don't access NULL disk target
Peter Krempa [Thu, 16 Dec 2021 13:14:43 +0000 (14:14 +0100)]
virDomainDiskInsert: Don't access NULL disk target

'virDomainDiskInsert' orders the inserted disks by target. If the target
is not provided though it would try to parse it anyways. This lead to a
crash when parsing a definition where there are multiple disks and of
two disks sharing the bus at least one also misses the target.

Since we want to actually use the parser for stuff which doesn't
necessarily need the disk target, we make virDomainDiskInsert tolerant
of missing target instead. The definition will be rejected by the
validator regardless of the order the disks were inserted in.

Fixes: 61fd7174
Closes: https://gitlab.com/libvirt/libvirt/-/issues/257
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agorpm: don't start/stop -ro.socket units for virtlockd/virtlogd
Daniel P. Berrangé [Tue, 14 Dec 2021 16:21:44 +0000 (16:21 +0000)]
rpm: don't start/stop -ro.socket units for virtlockd/virtlogd

These daemons do not have any support for unprivileged readonly
access, so we must not reference -ro.socket units in scripts.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpm: fix typo in daemon name in %post/%preun scripts
Daniel P. Berrangé [Tue, 14 Dec 2021 16:17:10 +0000 (16:17 +0000)]
rpm: fix typo in daemon name in %post/%preun scripts

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: fix missing cleanup on error in qemuSaveImageStartVM
Ani Sinha [Wed, 15 Dec 2021 13:07:21 +0000 (18:37 +0530)]
qemu: fix missing cleanup on error in qemuSaveImageStartVM

Commit 52521de8332c2323bd ("qemu: Use qemuDomainSaveStatus") replaced a call
to virDomainObjSave() with qemuDomainSaveStatus() as a part of cleanup. Since
qemuDomainSaveStatus() does not indicate any failure through its return code,
the error handling cleanup code got eliminated in the process. Thus upon
failure, we will no longer killing the started qemu process. This commit fixes
this by reverting the change that was introduced with the above commit.

Fixes: 52521de8332c2323bd ("qemu: Use qemuDomainSaveStatus")
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoqemucapstest: Update qemu capabilities probe dump for qemu-6.2 release
Peter Krempa [Fri, 26 Nov 2021 09:25:09 +0000 (10:25 +0100)]
qemucapstest: Update qemu capabilities probe dump for qemu-6.2 release

qemu-6.2 is out, update the caps dump for the final time.

Notable changes:
- 'unstable' feature flag for various QMP schema entries
- 'aio-max-batch' iothread property
- 'kernel-hashes' knob for the 'sev-guest' object
- 'native-hotplug' of 'pcie-root-port' is now unstable again
- 'page-sampling/dirty-ring/dirty-bitmap' mode for 'calc-dirty-rate'
- 'toolsversion' field for the 'vmdk' disk format driver
- CPU changes resulting in 'core-capability' being present on the cpu
  of the machine this dump was done on

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonetwork: remove unused 'driver' parameter
Ján Tomko [Tue, 14 Dec 2021 18:47:56 +0000 (19:47 +0100)]
network: remove unused 'driver' parameter

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: dnsmasq: remove caps completely
Ján Tomko [Tue, 14 Dec 2021 18:45:14 +0000 (19:45 +0100)]
util: dnsmasq: remove caps completely

Now that we only check whether the dnsmasq version is new enough,
there is no need for the caps field.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: remove dnsmasqCapsGetVersion
Ján Tomko [Tue, 14 Dec 2021 18:41:26 +0000 (19:41 +0100)]
util: remove dnsmasqCapsGetVersion

It has no callers anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agospec: do not require radvd
Ján Tomko [Tue, 14 Dec 2021 18:31:32 +0000 (19:31 +0100)]
spec: do not require radvd

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agobuild: do not search for radvd binary
Ján Tomko [Tue, 14 Dec 2021 18:31:15 +0000 (19:31 +0100)]
build: do not search for radvd binary

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoconf: remove radvdPid from virNetworkObj
Ján Tomko [Tue, 14 Dec 2021 18:30:16 +0000 (19:30 +0100)]
conf: remove radvdPid from virNetworkObj

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: driver: remove unused radvdStateDir variable
Ján Tomko [Tue, 14 Dec 2021 18:28:19 +0000 (19:28 +0100)]
network: driver: remove unused radvdStateDir variable

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: remove any code dealing with radvd
Ján Tomko [Tue, 14 Dec 2021 18:26:38 +0000 (19:26 +0100)]
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>
3 years agoutil: dnsmasq: delete assumed capability flags
Ján Tomko [Tue, 14 Dec 2021 18:40:41 +0000 (19:40 +0100)]
util: dnsmasq: delete assumed capability flags

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: assume DNSMASQ_CAPS_RA_PARAM
Ján Tomko [Tue, 14 Dec 2021 16:59:09 +0000 (17:59 +0100)]
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>
3 years agonetwork: assume DNSMASQ_CAPS_BIND_DYNAMIC
Ján Tomko [Tue, 14 Dec 2021 16:57:45 +0000 (17:57 +0100)]
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>
3 years agoutil: remove DNSMASQ_RA_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:55:42 +0000 (17:55 +0100)]
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>
3 years agonetwork: assume DNSMASQ_RA_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:54:44 +0000 (17:54 +0100)]
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>
3 years agonetwork: assume DNSMASQ_DHCPv6_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:46:24 +0000 (17:46 +0100)]
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>
3 years agoutil: dnsmasq: mandate at least version 2.67
Ján Tomko [Tue, 14 Dec 2021 16:36:23 +0000 (17:36 +0100)]
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>
3 years agotests: do not test dnsmasq older than 2.67
Ján Tomko [Tue, 14 Dec 2021 18:10:29 +0000 (19:10 +0100)]
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>
3 years agoutil: dnsmasqCapsSetFromBuffer: use error label
Ján Tomko [Tue, 14 Dec 2021 16:35:07 +0000 (17:35 +0100)]
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>
3 years agomeson: Detect XDR only when needed
Michal Privoznik [Wed, 8 Dec 2021 08:32:55 +0000 (09:32 +0100)]
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>
3 years agomeson: Require XDR for wireshark
Michal Privoznik [Wed, 8 Dec 2021 12:12:17 +0000 (13:12 +0100)]
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>
3 years agoadmin: Build only when RPC is available
Michal Privoznik [Wed, 8 Dec 2021 11:16:28 +0000 (12:16 +0100)]
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>
3 years agologging: Build log manager only when RPC is available
Michal Privoznik [Wed, 8 Dec 2021 11:14:44 +0000 (12:14 +0100)]
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>
3 years agorpc: Build only when XDR is available
Michal Privoznik [Wed, 8 Dec 2021 11:26:10 +0000 (12:26 +0100)]
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>
3 years agorpc: Separate out socket code into another static lib
Michal Privoznik [Wed, 8 Dec 2021 11:25:30 +0000 (12:25 +0100)]
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>
3 years agolibvirt-stream: Don't require RPC module
Michal Privoznik [Wed, 8 Dec 2021 11:12:27 +0000 (12:12 +0100)]
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>
3 years agodocs: domain: Clarify on the dangers of migrating with hyperv-passthrough enabled
Tim Wiederhake [Tue, 14 Dec 2021 16:21:16 +0000 (17:21 +0100)]
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>
3 years agoFix some typos
Tim Wiederhake [Tue, 14 Dec 2021 15:01:15 +0000 (16:01 +0100)]
Fix some typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Drop driver parameter from qemuDomainSetFakeReboot
Jiri Denemark [Tue, 14 Dec 2021 15:36:15 +0000 (16:36 +0100)]
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>
3 years agoqemu: Use qemuDomainSaveStatus
Jiri Denemark [Tue, 14 Dec 2021 15:33:35 +0000 (16:33 +0100)]
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>
3 years agoqemu: Add support for return-path migration capability
Jiri Denemark [Wed, 8 Dec 2021 15:19:26 +0000 (16:19 +0100)]
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>
3 years agoqemu: Support enabling migration caps unless a flag is used
Jiri Denemark [Wed, 8 Dec 2021 15:16:14 +0000 (16:16 +0100)]
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>
3 years agoqemu: report max number of SEV guests
Daniel P. Berrangé [Wed, 8 Dec 2021 19:53:45 +0000 (14:53 -0500)]
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>
3 years agoutil: pull CPUID helper function out of CPU driver
Daniel P. Berrangé [Fri, 10 Dec 2021 16:14:49 +0000 (16:14 +0000)]
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>
3 years agoinclude: define parameters for reporting SEV guest limits
Daniel P. Berrangé [Thu, 9 Dec 2021 16:51:01 +0000 (11:51 -0500)]
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>
3 years agoconf: extend domain capabilities for max SEV guest count
Daniel P. Berrangé [Thu, 9 Dec 2021 16:47:43 +0000 (11:47 -0500)]
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>
3 years agotools: add 'nodesevinfo' virsh command
Daniel P. Berrangé [Wed, 8 Dec 2021 13:28:48 +0000 (08:28 -0500)]
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>
3 years agotools: add 'domlaunchsecinfo' virsh command
Daniel P. Berrangé [Wed, 8 Dec 2021 12:53:00 +0000 (07:53 -0500)]
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>
3 years agoqemu: report new launch security parameters
Daniel P. Berrangé [Wed, 8 Dec 2021 12:52:33 +0000 (07:52 -0500)]
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>
3 years agoqemu: add monitor APIs for query-sev
Daniel P. Berrangé [Wed, 8 Dec 2021 12:05:44 +0000 (07:05 -0500)]
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>
3 years agoqemu: report error querying launch params for inactive guest
Daniel P. Berrangé [Wed, 8 Dec 2021 12:51:43 +0000 (07:51 -0500)]
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>
3 years agoinclude: add new launch security parameters
Daniel P. Berrangé [Wed, 8 Dec 2021 12:50:24 +0000 (07:50 -0500)]
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>
3 years agolibxl: Implement domainGetMessages API
Jim Fehlig [Mon, 13 Dec 2021 23:59:55 +0000 (16:59 -0700)]
libxl: Implement domainGetMessages API

Since commit 46783e6307a, 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>
3 years agodocs: domain: Add documentation for hyperv passthrough mode
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
docs: domain: Add documentation for hyperv passthrough mode

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Add tests for hyperv-passthrough
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
tests: Add tests for hyperv-passthrough

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoschema: hyperv: Add mode "passthrough"
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
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>
3 years agoconf: domain: Add hyperv passthrough mode
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
conf: domain: Add hyperv passthrough mode

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: domain: Add documentation for "hyperv"'s new "mode" attribute
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
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>
3 years agovirDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainFeaturesHyperVDefParse: Read attribute "mode" of element "hyperv"
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
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>
3 years agoconf: domain: Define enum for HyperV mode
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
conf: domain: Define enum for HyperV mode

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoschema: Add optional "mode" attribute to hyperv
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
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>
3 years agoschema: Wrap hyperv element in choice and group
Tim Wiederhake [Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)]
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>
3 years agoutil: use g_auto in virNodeSuspendHelper
Ján Tomko [Mon, 13 Dec 2021 18:52:28 +0000 (19:52 +0100)]
util: use g_auto in virNodeSuspendHelper

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virNodeSuspendSetNodeWakeup
Ján Tomko [Mon, 13 Dec 2021 18:51:42 +0000 (19:51 +0100)]
util: refactor virNodeSuspendSetNodeWakeup

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: iscsi: use two vars in CreateIfaceIQN
Ján Tomko [Fri, 10 Dec 2021 16:25:04 +0000 (17:25 +0100)]
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>
3 years agoutil: dnsmasq: refactor CapsRefresh
Ján Tomko [Fri, 10 Dec 2021 16:21:27 +0000 (17:21 +0100)]
util: dnsmasq: refactor CapsRefresh

Use two variables with automatic cleanup instead of reusing one.

Remove the pointless cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: use g_auto in virCommand example
Ján Tomko [Mon, 13 Dec 2021 18:47:25 +0000 (19:47 +0100)]
docs: use g_auto in virCommand example

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: storagevolxml2argvtest: do not reuse cmd
Ján Tomko [Mon, 13 Dec 2021 18:31:11 +0000 (19:31 +0100)]
tests: storagevolxml2argvtest: do not reuse cmd

Reduce the scope of the variable to avoid mixing automatic and manual
cleanup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: use g_auto in testCompareXMLToConfFiles
Ján Tomko [Mon, 13 Dec 2021 18:30:23 +0000 (19:30 +0100)]
tests: use g_auto in testCompareXMLToConfFiles

Use g_auto for dnsmasq context and remove the cmd variable.
It was unused since its introduction in:
commit 8b32c80df089a3612a0448c1a92abc2071d6b6a9

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovmware: refactor vmwareExtractVersion
Ján Tomko [Mon, 13 Dec 2021 17:33:11 +0000 (18:33 +0100)]
vmware: refactor vmwareExtractVersion

Use g_auto for cleanup and remove the cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovmware: use g_auto in vmwareLoadDomains
Ján Tomko [Mon, 13 Dec 2021 17:32:53 +0000 (18:32 +0100)]
vmware: use g_auto in vmwareLoadDomains

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovmware: refactor vmwareUpdateVMStatus
Ján Tomko [Mon, 13 Dec 2021 17:14:05 +0000 (18:14 +0100)]
vmware: refactor vmwareUpdateVMStatus

Use g_auto and get rid of the cleanup label, as well as the ret
variable.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovz: utils: use g_auto for virCommand
Ján Tomko [Mon, 13 Dec 2021 15:25:43 +0000 (16:25 +0100)]
vz: utils: use g_auto for virCommand

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzVEGetStringParam
Ján Tomko [Mon, 13 Dec 2021 18:28:27 +0000 (19:28 +0100)]
openvz: refactor openvzVEGetStringParam

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: use g_auto in openvzDomainMigratePerform3Params
Ján Tomko [Mon, 13 Dec 2021 18:27:02 +0000 (19:27 +0100)]
openvz: use g_auto in openvzDomainMigratePerform3Params

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzGetVEStatus
Ján Tomko [Mon, 13 Dec 2021 18:26:06 +0000 (19:26 +0100)]
openvz: refactor openvzGetVEStatus

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzDomainSetBarrierLimit
Ján Tomko [Mon, 13 Dec 2021 18:24:34 +0000 (19:24 +0100)]
openvz: refactor openvzDomainSetBarrierLimit

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzDomainGetBarrierLimit
Ján Tomko [Mon, 13 Dec 2021 18:24:07 +0000 (19:24 +0100)]
openvz: refactor openvzDomainGetBarrierLimit

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzConnectListDefinedDomains
Ján Tomko [Mon, 13 Dec 2021 18:22:28 +0000 (19:22 +0100)]
openvz: refactor openvzConnectListDefinedDomains

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzConnectListDomains
Ján Tomko [Mon, 13 Dec 2021 18:13:24 +0000 (19:13 +0100)]
openvz: refactor openvzConnectListDomains

Use g_auto where possible, reduce scope of some variables and remove
pointless ret and rc variables.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzDomainSetNetwork
Ján Tomko [Mon, 13 Dec 2021 18:08:49 +0000 (19:08 +0100)]
openvz: refactor openvzDomainSetNetwork

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzSetDiskQuota
Ján Tomko [Mon, 13 Dec 2021 18:06:11 +0000 (19:06 +0100)]
openvz: refactor openvzSetDiskQuota

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzSetInitialConfig
Ján Tomko [Mon, 13 Dec 2021 18:00:53 +0000 (19:00 +0100)]
openvz: refactor openvzSetInitialConfig

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzDomainDefineCmd
Ján Tomko [Fri, 10 Dec 2021 16:11:07 +0000 (17:11 +0100)]
openvz: refactor openvzDomainDefineCmd

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzGetVEID
Ján Tomko [Mon, 13 Dec 2021 17:47:47 +0000 (18:47 +0100)]
openvz: refactor openvzGetVEID

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzLoadDomains
Ján Tomko [Mon, 13 Dec 2021 17:46:43 +0000 (18:46 +0100)]
openvz: refactor openvzLoadDomains

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoopenvz: refactor openvzExtractVersionInfo
Ján Tomko [Mon, 13 Dec 2021 17:39:29 +0000 (18:39 +0100)]
openvz: refactor openvzExtractVersionInfo

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Generate command line for dirty-ring-size
Hyman Huang(黄勇) [Tue, 23 Nov 2021 14:36:59 +0000 (09:36 -0500)]
qemu: Generate command line for dirty-ring-size

On QEMU command line it's represented by the dirty-ring-size
attribute of KVM accelerator.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: support dirty ring feature
Hyman Huang(黄勇) [Tue, 23 Nov 2021 14:36:58 +0000 (09:36 -0500)]
qemu: support dirty ring feature

Dirty ring feature was introduced in qemu-6.1.0, this patch
add the corresponding feature named 'dirty-ring', which enable
dirty ring feature when starting VM.

To enable the feature, the following XML needs to be added to
the guest's domain description:

<features>
   <kvm>
     <dirty-ring state='on' size='xxx'>
   </kvm>
</features>

If property "state=on", property "size" must be specified, which
should be power of 2 and range in [1024, 65526].

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Turn virDomainDef.kvm_features into a struct
Michal Privoznik [Tue, 14 Dec 2021 09:24:30 +0000 (10:24 +0100)]
conf: Turn virDomainDef.kvm_features into a struct

In future commits we will need to store not just an array of
VIR_TRISTATE_SWITCH_* but also an additional integer. Follow the
example of TCG and introduce a structure where both the array an
integer can live.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>