]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agoqemu: add vdpa support
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:27 +0000 (12:08 -0500)] 
qemu: add vdpa support

Enable <interface type='vdpa'> for qemu domains. This provides basic
support and does not support hotplug or migration.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: add vhost-vdpa capability
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:26 +0000 (12:08 -0500)] 
qemu: add vhost-vdpa capability

Recent versions of qemu added the -netdev vhost-vdpa device. This
capability allows libvirt to know whether this is supported.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoconf: Add support for vDPA network devices
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:25 +0000 (12:08 -0500)] 
conf: Add support for vDPA network devices

This patch adds new schema and adds support for parsing and formatting
domain configurations that include vdpa devices.

vDPA network devices allow high-performance networking in a virtual
machine by providing a wire-speed data path. These devices require a
vendor-specific host driver but the data path follows the virtio
specification.

When a device on the host is bound to an appropriate vendor-specific
driver, it will create a chardev on the host at e.g.  /dev/vhost-vdpa-0.
That chardev path can then be used to define a new interface with
type='vdpa'.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agomeson: remove non-pkg-config fallback for devmapper
Daniel P. Berrangé [Tue, 20 Oct 2020 10:18:19 +0000 (11:18 +0100)] 
meson: remove non-pkg-config fallback for devmapper

The fallback for distros which lack pkg-config support for devmapper
references an undefined variable "tmp". It appears non of our supported
build platforms are triggering this bug and so the fallback code can be
removed entirely rather than fixed.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: agent: fix array access
Ján Tomko [Thu, 15 Oct 2020 12:54:39 +0000 (14:54 +0200)] 
qemu: agent: fix array access

My code movement changed the type of ifaces_ret from
virDomainInterfacePtr * to virDomainInterfacePtr **,
but failed to adjust the condition or dereference the
array correctly.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 6ddb1f803ea38d8d709b984fa9539e34318a9dc0
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuxml2argvmock: Remove mocking of 'virSCSIDeviceGetSgName'
Peter Krempa [Thu, 15 Oct 2020 14:51:47 +0000 (16:51 +0200)] 
qemuxml2argvmock: Remove mocking of 'virSCSIDeviceGetSgName'

Hostdev setup code no longer resolves hostdev name in the commandline
formatter but we mock it directly in the monitor code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Prepare hostdev data which depends on the host state separately
Peter Krempa [Thu, 15 Oct 2020 13:06:01 +0000 (15:06 +0200)] 
qemu: Prepare hostdev data which depends on the host state separately

SCSI hostdev setup requires querying the host os for the actual path of
the configured hostdev. This was historically done in the command line
formatter. Our new approach is to split out this part into
'qemuProcessPrepareHost' which is designed to be skipped in tests.

Refactor the hostdev code to use this new semantics, and add appropriate
handlers filling in the data for tests and the qemuConnectDomainXMLToNative
users.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: hostdev: Prepare definition bits in qemuDomainPrepareHostdev
Peter Krempa [Thu, 15 Oct 2020 13:27:30 +0000 (15:27 +0200)] 
qemu: hostdev: Prepare definition bits in qemuDomainPrepareHostdev

qemuBuildHostdevSCSIAttachPrepare is supposed to prepare the data
structure used for attaching the hostdev not preparing the hostdev
definition itself. Move the corresponding bits to qemuDomainPrepareHostdev

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuProcessCreatePretendCmd: Split up preparation and command building
Peter Krempa [Thu, 15 Oct 2020 12:39:16 +0000 (14:39 +0200)] 
qemuProcessCreatePretendCmd: Split up preparation and command building

Host preparation steps which are deliberately skipped when
pretend-creating a commandline are normally executed after VM object
preparation. In the test code we are faking some of the host
preparation steps, but we were doing that prior to the call to
qemuProcessPrepareDomain embedded in qemuProcessCreatePretendCmd.

By splitting up qemuProcessCreatePretendCmd into two functions we can
ensure that the ordering of the prepare steps stays consistent.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyverv: hypervCreateEmbeddedParam: Rework items counting
Michal Privoznik [Mon, 19 Oct 2020 10:08:46 +0000 (12:08 +0200)] 
hyverv: hypervCreateEmbeddedParam: Rework items counting

It's not necessarily clear, why we need to create the hash table
as big as number of fields we want to store, but nevertheless,
the code can be written a bit better. The @count should be type
of size_t and could be used directly in the loop that counts the
fields.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Drop needless error label in hypervCreateEmbeddedParam()
Michal Privoznik [Mon, 19 Oct 2020 09:56:11 +0000 (11:56 +0200)] 
hyperv: Drop needless error label in hypervCreateEmbeddedParam()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Use g_auto() for virHashTable in hypervCreateEmbeddedParam
Michal Privoznik [Mon, 19 Oct 2020 09:55:30 +0000 (11:55 +0200)] 
hyperv: Use g_auto() for virHashTable in hypervCreateEmbeddedParam

This will allow us to drop 'error' label later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: Accept const @value in hypervSetEmbeddedProperty()
Michal Privoznik [Mon, 19 Oct 2020 09:55:10 +0000 (11:55 +0200)] 
hyperv: Accept const @value in hypervSetEmbeddedProperty()

The hypervSetEmbeddedProperty() function is used to update a
value for given property in a list of properties created by
hypervCreateEmbeddedParam(). The list is nothing fancy - it's a
virHashTable that has NULL as dataFree callback => the table does
not own the value. This is not that obvious since
hypervSetEmbeddedProperty() accepts a non-const pointer. This
fact makes it unnecessary hard to consume, e.g. if we wanted to
pass a stack allocated string.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agovirschematest: Validate schema in tests/cputestdata
Peter Krempa [Wed, 7 Oct 2020 14:52:14 +0000 (16:52 +0200)] 
virschematest: Validate schema in tests/cputestdata

We now have a schema file for the 'cpu' elements. Use it to validate
files in 'tests/cputestdata'

Unfortunately the files in the directory are too disorganised and not
easy to split up to do something more straightforward.

The -baseline- input files are tested by the test internally and the
rest of the files are internal data feeding the tests so they don't
need validation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Validate more XMLs
Peter Krempa [Wed, 7 Oct 2020 11:58:24 +0000 (13:58 +0200)] 
virschematest: Validate more XMLs

We weren't validating certain directories containing nwfilter, network
and capability XML test files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Add directories containing domain XMLs
Peter Krempa [Wed, 7 Oct 2020 09:40:39 +0000 (11:40 +0200)] 
virschematest: Add directories containing domain XMLs

Validate additional XML documents we use for internal testing.
Specifically there's a lot of them belonging to the vmx and bhyve test
suite which were not validated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: vmx: Add <name> element for all domain XMLs
Peter Krempa [Wed, 7 Oct 2020 17:00:04 +0000 (19:00 +0200)] 
tests: vmx: Add <name> element for all domain XMLs

<name> is mandatory for a domain XML. Add 'displayName' for all the test
cases which were missing them so that <name> is parsed correctly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoschema: domain: Allow space in XML schema for bridge source
Peter Krempa [Wed, 7 Oct 2020 16:59:50 +0000 (18:59 +0200)] 
schema: domain: Allow space in XML schema for bridge source

vmware's network names can contain space and they are used as bridge
source. Modify the schema to allow it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoschema: domain: Add definition for the 'vmware' private namespace
Peter Krempa [Thu, 8 Oct 2020 06:46:55 +0000 (08:46 +0200)] 
schema: domain: Add definition for the 'vmware' private namespace

The 'vmware' private namespace wasn't present in our schema definition
making all XMLs having the <datacenterpath> element invalid.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonwfilterxml2xmltest: Rename cases with XMLs not conforming to schema
Peter Krempa [Wed, 7 Oct 2020 12:45:55 +0000 (14:45 +0200)] 
nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema

There's quite a few negative tests. In anticipation of schema testing of
the 'nwfilterxml2xmlin' directory rename all negative/non-conformant
XMLs with the -invalid suffix.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonwfilterxml2firewall: Fix schema compilance of 'tcp' test case
Peter Krempa [Wed, 7 Oct 2020 14:32:16 +0000 (16:32 +0200)] 
nwfilterxml2firewall: Fix schema compilance of 'tcp' test case

Fix the 'flags' of the last rule to conform to the RNG schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoschema: nwfiter: Allow leading/trailing whitespace in 'variable-name-type'
Peter Krempa [Wed, 7 Oct 2020 14:19:42 +0000 (16:19 +0200)] 
schema: nwfiter: Allow leading/trailing whitespace in 'variable-name-type'

The reference string parser tolerates some leading/trailing whitespace
for the reference strings as witnessed by
tests/nwfilterxml2xmlin/iter-test3.xml

Allow them in the schema so that the test passes schema validation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoschema: nwfilter: Allow all accepted values for 'ipsetflags'
Peter Krempa [Wed, 7 Oct 2020 13:37:40 +0000 (15:37 +0200)] 
schema: nwfilter: Allow all accepted values for 'ipsetflags'

The parser for the 'ipsetflags' accepts the 'src' and 'dst' values
stripping case. Express the same in the schema to pass validation of any
accepted string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomainconfdata/getfilesystem.xml: Remove <init> element
Peter Krempa [Wed, 7 Oct 2020 10:16:24 +0000 (12:16 +0200)] 
domainconfdata/getfilesystem.xml: Remove <init> element

The element is not needed for the test and doesn't conform to the domain
XML schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Fix testing of 'nwfilter' xmls
Peter Krempa [Wed, 7 Oct 2020 09:33:30 +0000 (11:33 +0200)] 
virschematest: Fix testing of 'nwfilter' xmls

The files are under 'src/nwfilter/xml'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Add coverage for 'examples/xml/test'
Peter Krempa [Tue, 6 Oct 2020 15:28:44 +0000 (17:28 +0200)] 
virschematest: Add coverage for 'examples/xml/test'

Add all appropriate file from our test driver example XML directory.

Note that the two 'node.*' files are actually custom for the test driver
to load full state. We don't have a schema for them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Add coverage for 'examples/xml/storage'
Peter Krempa [Tue, 6 Oct 2020 15:28:44 +0000 (17:28 +0200)] 
virschematest: Add coverage for 'examples/xml/storage'

Match the correct subsets of the files via the 'dirRegex' property.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoexamples: xml: Fix 'vol-raw.xml' and 'vol-sparse.xml'
Peter Krempa [Tue, 6 Oct 2020 15:35:01 +0000 (17:35 +0200)] 
examples: xml: Fix 'vol-raw.xml' and 'vol-sparse.xml'

Our schema forces a <target/> element which was not present in the
files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoexamples: xml: Fix 'pool-netfs.xml' example
Peter Krempa [Tue, 6 Oct 2020 15:29:58 +0000 (17:29 +0200)] 
examples: xml: Fix 'pool-netfs.xml' example

Schema mandates a '<dir>' element, not '<directory>'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Add regex filtering for directory contents
Peter Krempa [Tue, 6 Oct 2020 15:25:52 +0000 (17:25 +0200)] 
virschematest: Add regex filtering for directory contents

In some cases we have directories with mixed XML files in the test
suite. Adding regex filtering will allow testing subsets of the XML
files against schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirschematest: Rewrite internals to allow increasing XML test coverage
Peter Krempa [Wed, 7 Oct 2020 08:26:56 +0000 (10:26 +0200)] 
virschematest: Rewrite internals to allow increasing XML test coverage

To allow greater variablitity of XML schema validation tests without
needlessly reparsing the schema we need to refactor the internals to
pass in structs rather than just paths to directory.

This allows to directly implement testing of single files and will
simplify further additions such as filtering of the list of XML files in
a directory.

The list of tested paths is directly ported for now and will be improved
in follow-up patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agospec: Fix numad check
Boris Fiuczynski [Mon, 19 Oct 2020 12:23:00 +0000 (14:23 +0200)] 
spec: Fix numad check

This caused

DEBUG: meson.build:2149:2: ERROR: Problem encountered: You must have numactl enabled for numad support.

on s390x.

Fixes: 974dc0a4c678af8ccb9224abecc834bb593e81fa
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoutil: xml: Add autoptr cleanup for virXMLValidator
Peter Krempa [Wed, 7 Oct 2020 08:26:30 +0000 (10:26 +0200)] 
util: xml: Add autoptr cleanup for virXMLValidator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuBlockExportAddNBD: Use 'block-export-add' when available
Peter Krempa [Wed, 14 Oct 2020 09:49:50 +0000 (11:49 +0200)] 
qemuBlockExportAddNBD: Use 'block-export-add' when available

Switch to the new QMP command once it becomes available. Since the code
was refactored to have just one central location to do this we can
contain the ugly bits to just this one function.

Since we now use the replacement for 'nbd-server-add' mark the test case
as being OK with removal of the command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Add infrastructure for 'block-export-add' to export NBD
Peter Krempa [Wed, 14 Oct 2020 09:33:06 +0000 (11:33 +0200)] 
qemu: Add infrastructure for 'block-export-add' to export NBD

Add the monitor code, corresponding generator of properties for NBD and
tests validating it against the schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: capabilities: Add QEMU_CAPS_BLOCK_EXPORT_ADD
Peter Krempa [Wed, 14 Oct 2020 09:42:58 +0000 (11:42 +0200)] 
qemu: capabilities: Add QEMU_CAPS_BLOCK_EXPORT_ADD

The 'block-export-add' QMP command is a replacement for 'nbd-server-add'
and will allow greater flexibility. Add a capability so that we can
switch to it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: qemucapabilities: Update capabilities for qemu-5.2 dev cycle
Peter Krempa [Wed, 14 Oct 2020 08:05:29 +0000 (10:05 +0200)] 
tests: qemucapabilities: Update capabilities for qemu-5.2 dev cycle

Update to commit v5.1.0-2207-g96292515c0

Recent changes include deprecation of 'nbd-server-add' and addition of
'block-export-add'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemumonitorjsontest: Allow deprecation of 'nbd-server-add' QMP command
Peter Krempa [Wed, 14 Oct 2020 09:36:02 +0000 (11:36 +0200)] 
qemumonitorjsontest: Allow deprecation of 'nbd-server-add' QMP command

qemu is going to deprecate this command in the next release. Allow this
as later patches will implement the use of replacement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: block: Extract code for adding NBD exports to 'qemuBlockExportAddNBD'
Peter Krempa [Wed, 14 Oct 2020 09:12:19 +0000 (11:12 +0200)] 
qemu: block: Extract code for adding NBD exports to 'qemuBlockExportAddNBD'

Centralize the logic deciding which arguments to use when exporting a
block backend via NBD to a single place so that it can be centrally
fixed in upcoming commits to support the new export method via
'block-export-add'.

Additionally this allows simplification of the caller from migration as
the logic deciding which arguments to use is extracted too.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoscripts: meson-html-gen: Remove
Peter Krempa [Tue, 13 Oct 2020 09:51:20 +0000 (11:51 +0200)] 
scripts: meson-html-gen: Remove

The script was obscuring what's happening and not reporting errors
properly. Remove it since it's no longer used now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs/manpages/meson.build: Use template code for XSLT processing
Peter Krempa [Tue, 13 Oct 2020 15:19:50 +0000 (17:19 +0200)] 
docs/manpages/meson.build: Use template code for XSLT processing

Replace the reimplementation of the XSLT processing custom target with
an identical copy form docs/meson.build and a comment to keep them in
sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs/kbase/meson.build: Use template code for XSLT processing
Peter Krempa [Tue, 13 Oct 2020 15:19:50 +0000 (17:19 +0200)] 
docs/kbase/meson.build: Use template code for XSLT processing

Replace the reimplementation of the XSLT processing custom target with
an identical copy form docs/meson.build and a comment to keep them in
sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs/internals/meson.build: Use template code for XSLT processing
Peter Krempa [Tue, 13 Oct 2020 15:19:50 +0000 (17:19 +0200)] 
docs/internals/meson.build: Use template code for XSLT processing

Replace the reimplementation of the XSLT processing custom target with
an identical copy form docs/meson.build and a comment to keep them in
sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs: meson.build: Prepare for use of identical code for XSLT processing of htmls
Peter Krempa [Tue, 13 Oct 2020 15:14:53 +0000 (17:14 +0200)] 
docs: meson.build: Prepare for use of identical code for XSLT processing of htmls

Meson unfortunately doesn't give us any means to share the code using
xsltproc to output HTMLs processed by our template. This means we will
have to resort to copy&paste engineering.

To make things simpler, let's use the same block of code in
docs/meson.build but also any of the subdirs which generate htmls.

This will be achieved by making it configurable and wrapping it in a
comment that instructs anybody editing it to keep it identical.

We need to be able to configure the template file used and installation
directory. The rest of the processing is same as we do in
docs/meson.build.

This code will then be copied to subdirs to refactor the current
approach used there.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs: meson.build: Generate HTML files directly by meson
Peter Krempa [Mon, 12 Oct 2020 14:13:08 +0000 (16:13 +0200)] 
docs: meson.build: Generate HTML files directly by meson

Since we no longer reformat the XSLT-transformed files, there's no need
to use an external script any more.

Unfortunately this hid errors from 'xsltproc' as return value was not
checked and the stderr was piped into xmllints stdin. The result was
that any invalid input file would result into an empty output file.

Since the script's only purpose was to prevent additional temporary
files at the time we were reformatting the output in a pipeline we no
longer need this.

Moving the generation directly into the meson definition makes it more
obvious what's happening and saves readers from having to parse what's
going on. A free bonus is that errors are now properly caught and
reported.

This patch converts the main docs/ directory for now with cleanup of
other comming later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs: meson.build: Limit html files depending on 'aclperms.htmlinc'
Peter Krempa [Tue, 13 Oct 2020 09:32:59 +0000 (11:32 +0200)] 
docs: meson.build: Limit html files depending on 'aclperms.htmlinc'

Only 'acl.html' output file includes that file so there's no need to
make everything depend on it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agoscripts/meson-html-gen.py: Don't rereformat output files
Peter Krempa [Tue, 13 Oct 2020 14:47:48 +0000 (16:47 +0200)] 
scripts/meson-html-gen.py: Don't rereformat output files

The output HTML files (especially those generated from rST files) don't
look good even after reformatting. Skip the extra step and accept that
no matter what we do HTMLs will not look great.

This additionally makes it way simpler to remove meson-html-gen.py in
the future (thus I've neglected to remove passing of xmllint).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodocs: migration: Fix syntax
Peter Krempa [Mon, 12 Oct 2020 14:09:52 +0000 (16:09 +0200)] 
docs: migration: Fix syntax

One of the paragraphs added in f51cbe92c0d was not terminated thus
making it invalid XML/XHTML.

This was not caught by the build system as 'scripts/meson-html-gen.py'
unnecessarily obscures and hides errors from 'xsltproc'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agoschema: domain: Accept VMware disk sources for the disk
Peter Krempa [Thu, 8 Oct 2020 08:39:57 +0000 (10:39 +0200)] 
schema: domain: Accept VMware disk sources for the disk

Accept the 'datastore' variant of disk source specification used by our
VMware driver.

https://libvirt.org/drvesx.html#datastore

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
4 years agobhyve: parse: Set video device model when parsing bhyve commandline
Peter Krempa [Wed, 7 Oct 2020 11:46:38 +0000 (13:46 +0200)] 
bhyve: parse: Set video device model when parsing bhyve commandline

Add the proper video device type when parsing bhyve's commandline into a
XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 years agobhyveargv2xmldata: Remove XML files for console2/3/4 test case
Peter Krempa [Wed, 7 Oct 2020 10:39:33 +0000 (12:39 +0200)] 
bhyveargv2xmldata: Remove XML files for console2/3/4 test case

The test case is invoked using DO_TEST_FAIL so the XML files are
actually unexpected, unused and actually don't even conform to the RNG
schema for <domain>.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
4 years agohyperv: Simplify @memResource freeing in hypervDomainSetMemoryFlags()
Michal Privoznik [Thu, 15 Oct 2020 13:34:02 +0000 (15:34 +0200)] 
hyperv: Simplify @memResource freeing in hypervDomainSetMemoryFlags()

Now, that ownership transfer of hypervSetEmbeddedProperty() is
clear, we can use automatic freeing of the hash table.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Make it obvious that hypervAddEmbeddedParam() consumes an argument
Michal Privoznik [Thu, 15 Oct 2020 13:31:51 +0000 (15:31 +0200)] 
hyperv: Make it obvious that hypervAddEmbeddedParam() consumes an argument

Upon successful return hypervAddEmbeddedParam() transfers
ownership of @table argument to @params. But because it takes
only simple pointer (which hides this ownership transfer) it
doesn't clear the @table pointer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Drop needless label in hypervDomainSetMemoryFlags()
Michal Privoznik [Thu, 15 Oct 2020 13:24:36 +0000 (15:24 +0200)] 
hyperv: Drop needless label in hypervDomainSetMemoryFlags()

Now, that hypervInvokeMethod() clears the passed pointer we don't
need a special cleanup label ('params_cleanup') that handles
non-obvious ownership transfer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Reindent hypervInvokeMethod() body
Michal Privoznik [Thu, 15 Oct 2020 13:03:47 +0000 (15:03 +0200)] 
hyperv: Reindent hypervInvokeMethod() body

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Make it obvious that hypervInvokeMethod() consumes an argument
Michal Privoznik [Thu, 15 Oct 2020 13:53:27 +0000 (15:53 +0200)] 
hyperv: Make it obvious that hypervInvokeMethod() consumes an argument

Upon invocation, hypervInvokeMethod() consumes passed @params
(the second argument) regardless whether success or failure is
released. However, it takes only simple pointer (which hides this
ownership transfer) and because of that it doesn't clear it.

Switch to double pointer and tweak the documentation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agoconf: domain: sev: Make 'cbitpos' & 'reducedPhysBits' attrs optional
Erik Skultety [Fri, 9 Oct 2020 13:15:21 +0000 (15:15 +0200)] 
conf: domain: sev: Make 'cbitpos' & 'reducedPhysBits' attrs optional

These XML attributes have been mandatory since the introduction of SEV
support to libvirt. This design decision was based on QEMU's
requirement for these to be mandatory for migration purposes, as
differences in these values across platforms must result in the
pre-migration checks failing (not that migration with SEV works at the
time of this patch).

Expecting the user to specify these is cumbersome and the same XML
cannot be re-used across different revisions of SEV. Since
we have SEV platform information saved in QEMU capabilities, we can
make the attributes optional and should fill them in automatically
in the QEMU driver right before starting it.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/57

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: process: sev: Fill missing 'cbitpos' & 'reducedPhysBits' from caps
Erik Skultety [Thu, 8 Oct 2020 12:11:45 +0000 (14:11 +0200)] 
qemu: process: sev: Fill missing 'cbitpos' & 'reducedPhysBits' from caps

These XML attributes have been mandatory since the introduction of SEV
support to libvirt. This design decision was based on QEMU's
requirement for these to be mandatory for migration purposes, as
differences in these values across platforms must result in the
pre-migration checks failing (not that migration with SEV works at the
time of this patch).

This patch enables autofill of these attributes right before launching
QEMU and thus updating the live XML.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: process: Move SEV capability check to qemuValidateDomainDef
Erik Skultety [Thu, 15 Oct 2020 09:18:58 +0000 (11:18 +0200)] 
qemu: process: Move SEV capability check to qemuValidateDomainDef

Checks such as this one should be done at domain def validation time,
not before starting the QEMU process.
As for this change, existing domains will see some QEMU error when
starting as opposed to a libvirt error that this QEMU binary doesn't
support SEV, but that's okay, we never guaranteed error messages to
remain the same.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_process: sev: Drop an unused variable
Erik Skultety [Thu, 8 Oct 2020 12:04:41 +0000 (14:04 +0200)] 
qemu_process: sev: Drop an unused variable

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agodocs: Document camelCase preference for XML elements and attributes
Michal Privoznik [Thu, 15 Oct 2020 09:30:47 +0000 (11:30 +0200)] 
docs: Document camelCase preference for XML elements and attributes

Recently I've merged a patch that used hyphens in an attribute
name. I fixed it later, but turned out we don't document our
preference which is camelCase.

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu_validate.c: move secure boot checks to qemuValidateDomainDefBoot()
Daniel Henrique Barboza [Wed, 14 Oct 2020 18:38:06 +0000 (15:38 -0300)] 
qemu_validate.c: move secure boot checks to qemuValidateDomainDefBoot()

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_validate.c: move VCPU topology checks to qemuValidateDomainCpuCount()
Daniel Henrique Barboza [Wed, 14 Oct 2020 18:08:47 +0000 (15:08 -0300)] 
qemu_validate.c: move VCPU topology checks to qemuValidateDomainCpuCount()

Rename the function to qemuValidateDomainVCpuTopology() to reflect
what it is currently doing as well.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_validate.c: move NUMA HMAT check to qemuValidateDomainDefNuma()
Daniel Henrique Barboza [Wed, 14 Oct 2020 18:01:24 +0000 (15:01 -0300)] 
qemu_validate.c: move NUMA HMAT check to qemuValidateDomainDefNuma()

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_DEVICE_NVDIMM_UNARMED check to qemu_validate.c
Daniel Henrique Barboza [Wed, 14 Oct 2020 13:11:13 +0000 (10:11 -0300)] 
qemu_command.c: move QEMU_CAPS_DEVICE_NVDIMM_UNARMED check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move 'panic' validation to qemu_validate.c
Daniel Henrique Barboza [Tue, 13 Oct 2020 21:38:07 +0000 (18:38 -0300)] 
qemu_command.c: move 'panic' validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move usb_redir validations to qemu_validate.c
Daniel Henrique Barboza [Tue, 13 Oct 2020 20:10:08 +0000 (17:10 -0300)] 
qemu_command.c: move usb_redir validations to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move SHMEM validation to qemu_validate.c
Daniel Henrique Barboza [Tue, 13 Oct 2020 18:12:59 +0000 (15:12 -0300)] 
qemu_command.c: move SHMEM validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move NUMA memory backing check to qemu_validate.c
Daniel Henrique Barboza [Tue, 13 Oct 2020 17:04:25 +0000 (14:04 -0300)] 
qemu_command.c: move NUMA memory backing check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move CPU mode check to qemu_validate.c
Daniel Henrique Barboza [Sat, 10 Oct 2020 14:39:20 +0000 (11:39 -0300)] 
qemu_command.c: move CPU mode check to qemu_validate.c

All but VIR_CPU_MODE_HOST_MODEL were moved. 'host_model' mode
has nuances that forbid the verification to be moved to parse
time.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_FW_CFG validation to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 20:09:03 +0000 (17:09 -0300)] 
qemu_command.c: move QEMU_CAPS_FW_CFG validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move RNG backend validation to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 18:18:53 +0000 (15:18 -0300)] 
qemu_command.c: move RNG backend validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_DEVICE_VHOST_SCSI check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 17:02:34 +0000 (14:02 -0300)] 
qemu_command.c: move QEMU_CAPS_DEVICE_VHOST_SCSI check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_DEVICE_USB_KBD check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 16:59:14 +0000 (13:59 -0300)] 
qemu_command.c: move QEMU_CAPS_DEVICE_USB_KBD check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: reduce qemuBuildNicDevStr() if clauses
Daniel Henrique Barboza [Fri, 9 Oct 2020 14:48:24 +0000 (11:48 -0300)] 
qemu_command.c: reduce qemuBuildNicDevStr() if clauses

We have a lot of "if (usingVirtio)" checks being done while
constructing the NIC command line. Let's put all of them in
a single "if".

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_VIRTIO_NET_HOST_MTU check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 14:30:35 +0000 (11:30 -0300)] 
qemu_command.c: move QEMU_CAPS_VIRTIO_NET_HOST_MTU check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 14:14:00 +0000 (11:14 -0300)] 
qemu_command.c: move QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 14:08:49 +0000 (11:08 -0300)] 
qemu_command.c: move QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move QEMU_CAPS_VIRTIO_TX_ALG check to qemu_validate.c
Daniel Henrique Barboza [Fri, 9 Oct 2020 13:56:34 +0000 (10:56 -0300)] 
qemu_command.c: move QEMU_CAPS_VIRTIO_TX_ALG check to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move DISK_BUS_USB validation to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 19:35:58 +0000 (16:35 -0300)] 
qemu_command.c: move DISK_BUS_USB validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move DISK_BUS_VIRTIO validation to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 18:45:28 +0000 (15:45 -0300)] 
qemu_command.c: move DISK_BUS_VIRTIO validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move DISK_BUS_SATA validation to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 18:26:20 +0000 (15:26 -0300)] 
qemu_command.c: move DISK_BUS_SATA validation to qemu_validate.c

A few tweaks were made during the move:

- the error messages were changed to mention 'sata controller'
instead of 'ide controller';

- a check for address type 'drive' was added like it is done
with other bus types. The error message of qemuxml2argdata was
updated to reflect that now, instead of erroring it out from the
common code in virDomainDiskDefValidate(), we're failing earlier
with a different error message.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move LSILOGIC controller validation to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 16:54:42 +0000 (13:54 -0300)] 
qemu_command.c: move LSILOGIC controller validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move LUN and IDE checks to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 16:02:12 +0000 (13:02 -0300)] 
qemu_command.c: move LUN and IDE checks to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_command.c: move wwn validation to qemu_validate.c
Daniel Henrique Barboza [Thu, 8 Oct 2020 14:02:20 +0000 (11:02 -0300)] 
qemu_command.c: move wwn validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agodocs: Expand on recommendation in hypervisor-cpu-baseline description
Tim Wiederhake [Fri, 9 Oct 2020 13:02:11 +0000 (15:02 +0200)] 
docs: Expand on recommendation in hypervisor-cpu-baseline description

On some architectures, e.g. aarch64 and s390x, the output of
`virsh capabilities` is not suitable for use in
`virsh hypervisor-cpu-baseline`. Expand the description of the
man page to make this explicit.

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

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agodocs: Clarify free_page_reporting attribute
Michal Privoznik [Wed, 14 Oct 2020 14:46:18 +0000 (16:46 +0200)] 
docs: Clarify free_page_reporting attribute

The 'reporting' suffix of the attribute makes it sound like we
could be reporting something to user. While in fact, this is
purely virtio membaloon <-> QEMU business. Clarify the docs to
make it clear.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agolib: s/free-page-reporting/freePageReporting/
Michal Privoznik [Wed, 14 Oct 2020 14:46:12 +0000 (16:46 +0200)] 
lib: s/free-page-reporting/freePageReporting/

In fee8a61d29 a new attribute to <memballoon/> was introduced:
free-page-reporting. We don't really like hyphens in attribute
names. Use camelCase instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotests: Turn virtio-options-memballoon-freepage-reporting.xml into a symlink
Michal Privoznik [Wed, 14 Oct 2020 14:46:59 +0000 (16:46 +0200)] 
tests: Turn virtio-options-memballoon-freepage-reporting.xml into a symlink

The output virtio-options-memballoon-freepage-reporting.xml of
xml2xmlout is the same as the input. Make it as symlink to save
space.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: Mention GPG key used for signing releases
Jiri Denemark [Wed, 14 Oct 2020 11:24:29 +0000 (13:24 +0200)] 
docs: Mention GPG key used for signing releases

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agovmx: start parsing SATA disks
Pino Toscano [Mon, 12 Oct 2020 15:06:59 +0000 (17:06 +0200)] 
vmx: start parsing SATA disks

Always reverse-engineering VMX files, attempt to support SATA disks in
guests, and their controllers.

The esx-in-the-wild-10 test case is taken from RHBZ#1883588, while the
result of esx-in-the-wild-8 is updated with SATA disks.

Fixes (hopefully):
https://bugzilla.redhat.com/show_bug.cgi?id=1677608
https://bugzilla.redhat.com/show_bug.cgi?id=1883588

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovmx: expand the disk array
Pino Toscano [Mon, 12 Oct 2020 11:33:45 +0000 (13:33 +0200)] 
vmx: expand the disk array

Account for the possible SATA disks too, which means 120 potential
disks.

This means the size of the array triples, however that is unavoidable
with the current way of reading disks.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovmx: shortcut 'cdrom-image' as CD-ROM earlier
Pino Toscano [Mon, 12 Oct 2020 11:25:25 +0000 (13:25 +0200)] 
vmx: shortcut 'cdrom-image' as CD-ROM earlier

Add it to the list of 'deviceType' values ignored for disks.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovmx: hide private helpers
Pino Toscano [Mon, 12 Oct 2020 11:16:24 +0000 (13:16 +0200)] 
vmx: hide private helpers

Move all the private helpers for parsing and formatting of domain
elements as private static functions in vmx.c, to avoid using them
directly.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: remove some unnecessary local variables
Jonathon Jongsma [Tue, 13 Oct 2020 21:14:46 +0000 (16:14 -0500)] 
qemu: remove some unnecessary local variables

These variables seem to be left over from a previous refactoring and
they don't add anything to the code.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoReflect in virtiofs.rst that virtiofs can be used without NUMA
Halil Pasic [Tue, 13 Oct 2020 16:53:12 +0000 (18:53 +0200)] 
Reflect in virtiofs.rst that virtiofs can be used without NUMA

Reflect in the virtiofs documentation that virtiofs can now be used
even without NUMA. While at it, be more precise where and why shared
memory is required.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: virtiofs can be used without NUMA nodes
Marc Hartmayer [Tue, 13 Oct 2020 16:53:11 +0000 (18:53 +0200)] 
qemu: virtiofs can be used without NUMA nodes

...if a machine memory-backend using shared memory is configured for
the guest. This is especially important for QEMU machine types that
don't have NUMA but virtiofs support.

An example snippet:

  <domain type='kvm'>
    <name>test</name>
    <memory unit='KiB'>2097152</memory>
    <memoryBacking>
      <access mode='shared'/>
    </memoryBacking>
    <devices>
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<source dir='/tmp/test'/>
<target dir='coffee'/>
      </filesystem>
      ...
    </devices>
    ...
  </domain>

and the corresponding QEMU command line:

  /usr/bin/qemu-system-s390x \
  -machine s390-ccw-virtio-5.2,memory-backend=s390.ram \
  -m 2048 \
  -object
  memory-backend-file,id=s390.ram,mem-path=/var/lib/libvirt/qemu/ram/46-test/s390.ram,share=yes,size=2147483648 \
  ...

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoprovide testing for free-page-reporting feature in QEMU
Nico Pache [Mon, 12 Oct 2020 23:35:39 +0000 (19:35 -0400)] 
provide testing for free-page-reporting feature in QEMU

This provides basic testing for the free-page-reporting feature that is
introduced in qemu 5.1.

Signed-off-by: Nico Pache <npache@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoQEMU: introduce Virtio free page reporting feature
Nico Pache [Mon, 12 Oct 2020 23:35:38 +0000 (19:35 -0400)] 
QEMU: introduce Virtio free page reporting feature

This patch enables the free-page-reporting in qemu.

Signed-off-by: Nico Pache <npache@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoQEMU: declare qemu capabilities for the Virtio Free page reporting feature
Nico Pache [Mon, 12 Oct 2020 23:35:37 +0000 (19:35 -0400)] 
QEMU: declare qemu capabilities for the Virtio Free page reporting feature

This patch will introduce the free-page-reporting feature capabilities
that are in qemu 5.1

Signed-off-by: Nico Pache <npache@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>