]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
4 years agoDocument and parser support for the Virtio free page reporting feature.
Nico Pache [Mon, 12 Oct 2020 23:35:36 +0000 (19:35 -0400)]
Document and parser support for the Virtio free page reporting feature.

This will add the proper documentation and parser support for the free page
reporting feature that is introduced in QEMU 5.1.

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: Set noqueue qdisc for TAP devices
Michal Privoznik [Thu, 8 Oct 2020 14:22:50 +0000 (16:22 +0200)]
qemu: Set noqueue qdisc for TAP devices

By default, pfifo_fast queueing discipline (qdisc) is set on
newly created interfaces (including TAPs). This qdisc has three
queues and packets that want to be sent through given NIC are
placed into one of the queues based on TOS field. Queues are then
emptied based on their priority allowing interactive sessions
stay interactive whilst something else is downloading a large
file.

Obviously, this means that kernel has to be involved and some
locking has to happen (when placing packets into queues). If
virtualization is taken into account then the above algorithm
happens twice - once in the guest and the second time in the
host.

This is arguably not optimal as it burns host CPU cycles
needlessly. Guest already made it choice and sent packets in the
order it wants.

To resolve this, Linux kernel offers 'noqueue' qdisc which can be
applied on virtual interfaces and in fact for 'lo' it is by
default:

  lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue

Set it for other TAP devices we create for domains too. With this
change I was able to squeeze 1Mbps more from a macvtap attached
to a guest and to my 1Gbps LAN (as measured by iperf3).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329644
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agovirnetdev: Introduce virNetDevSetRootQDisc()
Michal Privoznik [Thu, 8 Oct 2020 12:37:54 +0000 (14:37 +0200)]
virnetdev: Introduce virNetDevSetRootQDisc()

This helper changes the root qdisc on given interface.
Ideally, it would be written using netlink but my attempts to
write the code were not successful and thus I've fallen back to
virCommand() + tc.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agorpm: remove rpath from rpms
Daniel Letai [Tue, 13 Oct 2020 10:11:49 +0000 (11:11 +0100)]
rpm: remove rpath from rpms

The rpath improvements in:

  commit 69980ab798e240923ef12f86a92665b6c9ff7292
  Author: Andrea Bolognani <abologna@redhat.com>
  Date:   Wed Aug 19 11:15:35 2020 +0200

    meson: Improve RPATH handling

missed that Fedora's %meson macro sets --auto-features=enabled, thus
force enabling rpath in the RPM build. Thus we need to explicitly
disable it

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel Letai <dani@letai.org.il>
4 years agologging: allow max_len=0 to disable log rollover
Daniel P. Berrangé [Tue, 13 Oct 2020 09:20:19 +0000 (10:20 +0100)]
logging: allow max_len=0 to disable log rollover

Currently setting max_len=0 causes virtlogd to spin in a busy loop. It
is natural to allow this to disable log rollover which can be useful for
developers debugging things.

Note disabling rollover exposes the host to denial of service from a
malicious guest, so must be used with care.

Closes https://gitlab.com/libvirt/libvirt/-/issues/85
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: virsecretobj: fix g_new0 allocation
Pavel Hrdina [Mon, 12 Oct 2020 17:54:36 +0000 (19:54 +0200)]
conf: virsecretobj: fix g_new0 allocation

Fixes commit <d5b05614dfbc9bd60ea1a31a9cc32aaf3c771ddc> which changed
allocation from VIR_ALLOC_N to g_new0 but missed one +1 on number of
allocated elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoconf: fix g_new0 allocation
Pavel Hrdina [Mon, 12 Oct 2020 17:45:37 +0000 (19:45 +0200)]
conf: fix g_new0 allocation

Fixes commit <a5d88ffe0ad9b5d5314ab0058c5b363f9f79b8ee> which changed
allocation from VIR_ALLOC_N to g_new0 but missed some +1 on number of
allocated elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: migration: don't open storage driver too early
Cole Robinson [Wed, 7 Oct 2020 19:20:30 +0000 (15:20 -0400)]
qemu: migration: don't open storage driver too early

If storage migration is requested, and the destination storage does
not exist on the remote host, qemu's migration support will call
into the libvirt storage driver to precreate the destination storage.

The storage driver virConnectPtr is opened too early though, adding
an unnecessary dependency on the storage driver for several cases
that don't require it. This currently requires kubevirt to install
the storage driver even though they aren't actually using it.

Push the virGetConnectStorage calls to right before the cases they are
actually needed.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
4 years agonews: document bhyve virtio-9p support
Roman Bogorodskiy [Sat, 10 Oct 2020 04:11:33 +0000 (08:11 +0400)]
news: document bhyve virtio-9p support

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: bhyve: document virtio-9p support
Roman Bogorodskiy [Sat, 10 Oct 2020 04:11:08 +0000 (08:11 +0400)]
docs: bhyve: document virtio-9p support

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agobhyve: fix virtio-9p src/dst order
Roman Bogorodskiy [Sat, 10 Oct 2020 04:08:07 +0000 (08:08 +0400)]
bhyve: fix virtio-9p src/dst order

For the virtio-9p bhyve command line argument, the proper order
is mount_tag=/path/to/host/dir, not the opposite.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsocketaddr: Zero @netmask in virSocketAddrPrefixToNetmask()
Michal Privoznik [Fri, 9 Oct 2020 14:16:58 +0000 (16:16 +0200)]
virsocketaddr: Zero @netmask in virSocketAddrPrefixToNetmask()

The aim of virSocketAddrPrefixToNetmask() is to initialize passed
virSocketAddr structure based on prefix length and family.
However, it doesn't set all members in the struct which may lead
to reads of uninitialized values:

==15421== Use of uninitialised value of size 8
==15421==    at 0x50F297A: _itoa_word (in /lib64/libc-2.31.so)
==15421==    by 0x510C8FE: __vfprintf_internal (in /lib64/libc-2.31.so)
==15421==    by 0x5120295: __vsnprintf_internal (in /lib64/libc-2.31.so)
==15421==    by 0x50F8969: snprintf (in /lib64/libc-2.31.so)
==15421==    by 0x51BB602: getnameinfo (in /lib64/libc-2.31.so)
==15421==    by 0x496DEE0: virSocketAddrFormatFull (virsocketaddr.c:486)
==15421==    by 0x496DD9F: virSocketAddrFormat (virsocketaddr.c:444)
==15421==    by 0x11871F: networkDnsmasqConfContents (bridge_driver.c:1404)
==15421==    by 0x1118F5: testCompareXMLToConfFiles (networkxml2conftest.c:48)
==15421==    by 0x111BAF: testCompareXMLToConfHelper (networkxml2conftest.c:112)
==15421==    by 0x112679: virTestRun (testutils.c:142)
==15421==    by 0x111D09: mymain (networkxml2conftest.c:144)
==15421==  Uninitialised value was created by a stack allocation
==15421==    at 0x1175D2: networkDnsmasqConfContents (bridge_driver.c:1056)

All callers expect the function to initialize the structure
fully.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agobhyve: implement virtio-9p support
Roman Bogorodskiy [Wed, 7 Oct 2020 16:07:04 +0000 (20:07 +0400)]
bhyve: implement virtio-9p support

Recently virtio-9p support was added to bhyve.

On the host side it looks this way:

  bhyve .... -s 25:0,virtio-9p,sharename=/path/to/shared/dir

It could also have ",ro" suffix to make share read-only.

In the Linux guest, this share is mounted with:

  mount -t 9p sharename /mnt/sharename

In the guest user will see the same permissions and ownership
information for this directory as on the host. No uid/gid remapping is
supported, so those could resolve to wrong user or group names.

The same applies to the other side: chowning/chmodding in the guest will
set specified ownership and permissions on the host.

In libvirt domain XML it's modeled using the 'filesystem' element:

  <filesystem type='mount'>
    <source dir='/path/to/shared/dir'/>
    <target dir='sharename'/>
  </filesystem>

Optional 'readonly' sub-element enables read-only mode.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotools: use g_autoptr for virCgroup
Pavel Hrdina [Tue, 22 Sep 2020 10:52:38 +0000 (12:52 +0200)]
tools: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agotests: use g_autoptr for virCgroup
Pavel Hrdina [Tue, 22 Sep 2020 10:52:26 +0000 (12:52 +0200)]
tests: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoutil: use g_autoptr for virCgroup
Pavel Hrdina [Fri, 9 Oct 2020 14:09:46 +0000 (16:09 +0200)]
util: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoqemu: use g_autoptr for virCgroup
Pavel Hrdina [Fri, 9 Oct 2020 14:01:07 +0000 (16:01 +0200)]
qemu: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agolxc: use g_autoptr for virCgroup
Pavel Hrdina [Tue, 22 Sep 2020 10:49:58 +0000 (12:49 +0200)]
lxc: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agolibvirt-lxc: use g_autoptr for virCgroup
Pavel Hrdina [Tue, 22 Sep 2020 10:49:33 +0000 (12:49 +0200)]
libvirt-lxc: use g_autoptr for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoutil: vircgroup: introduce g_autoptr() for virCgroup
Pavel Hrdina [Tue, 22 Sep 2020 09:33:19 +0000 (11:33 +0200)]
util: vircgroup: introduce g_autoptr() for virCgroup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoutil: vircgroup: change virCgroupFree to take only virCgroupPtr
Pavel Hrdina [Tue, 22 Sep 2020 12:07:27 +0000 (14:07 +0200)]
util: vircgroup: change virCgroupFree to take only virCgroupPtr

As preparation for g_autoptr() we need to change the function to take
only virCgroupPtr.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoutil: vircgroup: use GLib alloc functions
Pavel Hrdina [Tue, 22 Sep 2020 09:18:51 +0000 (11:18 +0200)]
util: vircgroup: use GLib alloc functions

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoqemu_cgroup: introduce qemuRestoreCgroupThread helper
Pavel Hrdina [Tue, 22 Sep 2020 12:05:50 +0000 (14:05 +0200)]
qemu_cgroup: introduce qemuRestoreCgroupThread helper

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agodoc: Fix element name in description of "feature"
Tim Wiederhake [Fri, 9 Oct 2020 10:47:20 +0000 (12:47 +0200)]
doc: Fix element name in description of "feature"

Actual change is "s/``elements``/``feature`` elements/", rest is
reflow.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agodocs: Remove references to "cpu_map.xml" in the documentation
Tim Wiederhake [Fri, 9 Oct 2020 10:47:19 +0000 (12:47 +0200)]
docs: Remove references to "cpu_map.xml" in the documentation

"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoqemu: Remove references to "cpu_map.xml" in the code
Tim Wiederhake [Fri, 9 Oct 2020 10:47:18 +0000 (12:47 +0200)]
qemu: Remove references to "cpu_map.xml" in the code

"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agotests: Remove references to "cpu_map.xml" in the code
Tim Wiederhake [Fri, 9 Oct 2020 10:47:17 +0000 (12:47 +0200)]
tests: Remove references to "cpu_map.xml" in the code

"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agospec: Introduce arches_*
Andrea Bolognani [Mon, 5 Oct 2020 16:05:35 +0000 (18:05 +0200)]
spec: Introduce arches_*

With this commit, all architecture lists that we base feature
enablement decisions on are defined within a few lines of each
other, increasing maintainability.

Additionally, generic architecture lists that appear in the
conditions for multiple features are defined, so that repetition
is reduced.

Note that a few checks (numactl, zfs, ceph) have been changed
from %ifarch to %ifnarch for consistency: while doing so, the
corresponding list of architectures has also been replaced with
the complement of the original one to ensure the overall behavior
would be preserved.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: Refactor qemu_kvm_arches definition
Andrea Bolognani [Mon, 5 Oct 2020 16:56:50 +0000 (18:56 +0200)]
spec: Refactor qemu_kvm_arches definition

There's no need to set a default for it if we're going to override
it immediately afterwards anyway, and setting with_qemu_tcg at the
same time only makes things more confusing.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: Drop s390 architecture from conditionals
Andrea Bolognani [Mon, 5 Oct 2020 17:10:12 +0000 (19:10 +0200)]
spec: Drop s390 architecture from conditionals

Neither Fedora nor RHEL build packages on this architecture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
4 years agospec: Move _vpath_builddir definition
Andrea Bolognani [Mon, 5 Oct 2020 16:54:29 +0000 (18:54 +0200)]
spec: Move _vpath_builddir definition

It belongs before package-specific feature flags are defined.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: Introduce with_dmidecode
Andrea Bolognani [Mon, 5 Oct 2020 16:43:32 +0000 (18:43 +0200)]
spec: Introduce with_dmidecode

To keep things maintainable, we want to have architecture handling
all in one spot instead of sprinkling %ifarch conditionals all over
the place.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: Move with_numactl definition
Andrea Bolognani [Mon, 5 Oct 2020 16:40:22 +0000 (18:40 +0200)]
spec: Move with_numactl definition

Keep it close to similar ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: bash completion actually defaults to on
Andrea Bolognani [Mon, 5 Oct 2020 16:30:22 +0000 (18:30 +0200)]
spec: bash completion actually defaults to on

Remove the red herring.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: firewalld is always enabled
Andrea Bolognani [Mon, 5 Oct 2020 16:31:37 +0000 (18:31 +0200)]
spec: firewalld is always enabled

Knowing this, we can remove some code.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agospec: Simplify setting features off by default
Andrea Bolognani [Mon, 5 Oct 2020 16:28:26 +0000 (18:28 +0200)]
spec: Simplify setting features off by default

The right-hand side of these expressions will always evaluate to
zero. Stop obfuscating this fact.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agomeson: add tests build option to enable/disable unit tests
Pavel Hrdina [Thu, 8 Oct 2020 12:46:03 +0000 (14:46 +0200)]
meson: add tests build option to enable/disable unit tests

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agomeson: add docs option to enable/disable generating documentation
Pavel Hrdina [Thu, 8 Oct 2020 12:39:38 +0000 (14:39 +0200)]
meson: add docs option to enable/disable generating documentation

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>