]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agotests: Enable *-headless and *-graphics in qemuxml2xml
Andrea Bolognani [Wed, 12 Jun 2019 10:25:28 +0000 (12:25 +0200)]
tests: Enable *-headless and *-graphics in qemuxml2xml

We didn't do this earlier because the DO_TEST_CAPS_ARCH_LATEST()
macro was limited to qemuxml2argv until recently.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Add riscv64-virt-graphics
Andrea Bolognani [Thu, 13 Jun 2019 11:51:33 +0000 (13:51 +0200)]
tests: Add riscv64-virt-graphics

Support for this has only relatively recently been added to
virt-manager.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Update *-headless and *-graphics
Andrea Bolognani [Wed, 12 Jun 2019 16:28:25 +0000 (18:28 +0200)]
tests: Update *-headless and *-graphics

Use the latest virt-manager to regenerate the files.

The command line is once again along the lines of

  $ virt-install \
    --name guest --os-variant fedora29 \
    --vcpus 4 --memory 4096 --disk size=5 \
    --graphics (none|vnc) \
    --print-xml

with some minor tweaks performed afterwards.

This removes a number of inconsistencies between the files,
and makes it so the only differences are actually relevant
either to the architecture and machine type at hand, or to
having graphics rather than being headless.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Normalize quotes for *-graphics
Andrea Bolognani [Wed, 12 Jun 2019 11:49:45 +0000 (13:49 +0200)]
tests: Normalize quotes for *-graphics

Right now *-headless and *-graphics tests are using different
quoting styles, which results in the diff between them being
basically useless, whereas we would like it to be possible to
compare these files directly and easily spot the differences.

Convert all *-graphics tests to single quotes, which is the
style libvirt itself uses when formatting XML: this is a fact
that will come in handy later.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_firmware: only set nfeatures on success
Marc-André Lureau [Wed, 5 Jun 2019 10:31:01 +0000 (12:31 +0200)]
qemu_firmware: only set nfeatures on success

The field is set just before returning on success.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotpm: minor argument comment fix
Marc-André Lureau [Wed, 5 Jun 2019 10:31:00 +0000 (12:31 +0200)]
tpm: minor argument comment fix

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agodevice-conf: removed unneeded virDomainDeviceInfoCopy()
Marc-André Lureau [Wed, 5 Jun 2019 10:30:59 +0000 (12:30 +0200)]
device-conf: removed unneeded virDomainDeviceInfoCopy()

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Remove rest of source backend if hotplug fails
Peter Krempa [Thu, 28 Mar 2019 14:59:38 +0000 (15:59 +0100)]
qemu: hotplug: Remove rest of source backend if hotplug fails

When changing media using blockdev-add we need to remove the leftovers
if we didn't succeed plugging in the full chain or closing the tray.
Otherwise the data structures will be freed and thus the backing chain
members will never be unplugged.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Use storage chain helpers in qemuDomainChangeMediaBlockdev
Peter Krempa [Fri, 5 Apr 2019 11:54:48 +0000 (13:54 +0200)]
qemu: hotplug: Use storage chain helpers in qemuDomainChangeMediaBlockdev

As this conversion removes the last use of qemuHotplugDiskSource*
functions we can remove all of them now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Use storage chain helpers in qemuDomainRemoveDiskDevice
Peter Krempa [Fri, 5 Apr 2019 11:47:44 +0000 (13:47 +0200)]
qemu: hotplug: Use storage chain helpers in qemuDomainRemoveDiskDevice

Use the new helpers for removing the backing chain in case when
-blockdev is used. For -drive this function has a local implementation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Use storage chain helpers in qemuDomainAttachDiskGeneric
Peter Krempa [Thu, 4 Apr 2019 15:10:27 +0000 (17:10 +0200)]
qemu: hotplug: Use storage chain helpers in qemuDomainAttachDiskGeneric

Replace the use of qemuHotplugDiskSourceAttach* helpers with
qemuBuildStorageSourceChainAttachPrepare(Blockdev|Drive).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine
Peter Krempa [Mon, 24 Jun 2019 13:48:59 +0000 (15:48 +0200)]
qemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: command: Use VIR_AUTO infrastructure in qemuBuildDiskSourceCommandLine
Peter Krempa [Mon, 24 Jun 2019 13:47:48 +0000 (15:47 +0200)]
qemu: command: Use VIR_AUTO infrastructure in qemuBuildDiskSourceCommandLine

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: command: Use storage chain helpers in commandline generator
Peter Krempa [Thu, 4 Apr 2019 14:58:58 +0000 (16:58 +0200)]
qemu: command: Use storage chain helpers in commandline generator

Replace the open-coded local implementation with
qemuBuildStorageSourceChainAttachPrepare(Drive|Blockdev).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Introduce new set of helpers for attaching and detaching storage chains
Peter Krempa [Thu, 4 Apr 2019 14:50:49 +0000 (16:50 +0200)]
qemu: Introduce new set of helpers for attaching and detaching storage chains

These are meant to replace the ad-hoc helpers qemuHotplugDiskSourceAttach...
and the open-coded version in qemu_command.c for use in command line
generation.

The functions for preparing for attach of chains unfortunately need to
be in qemu_command.c as they use function defined by that file and
inclusion hierarchy.

In this patch new functions are introduced and subsequent patches then
refactor individual parts to use them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Handle copy-on-read filter separate from rest of backing chain
Peter Krempa [Thu, 28 Mar 2019 15:04:55 +0000 (16:04 +0100)]
qemu: hotplug: Handle copy-on-read filter separate from rest of backing chain

We use only one copy-on-read filter per disk, so we should handle it
separately from the chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: block: Move and rename qemuHotplugRemoveStorageSourcePrepareData
Peter Krempa [Wed, 10 Oct 2018 13:30:24 +0000 (15:30 +0200)]
qemu: block: Move and rename qemuHotplugRemoveStorageSourcePrepareData

Move it to qemu_block.c and call it qemuBlockStorageSourceDetachPrepare.
It will be reused in other parts as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonews: Mention VIR_ERR_DEPRECATED in improvements
Peter Krempa [Fri, 21 Jun 2019 06:33:07 +0000 (08:33 +0200)]
news: Mention VIR_ERR_DEPRECATED in improvements

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Use VIR_ERR_DEPRECATED in QemuAttach and DomainXMLFromNative stubs
Peter Krempa [Fri, 21 Jun 2019 06:29:22 +0000 (08:29 +0200)]
qemu: Use VIR_ERR_DEPRECATED in QemuAttach and DomainXMLFromNative stubs

We've deprecated qemuConnectDomainXMLFromNative qemuDomainQemuAttach.
Switch the error code from VIR_ERR_OPERATION_UNSUPPORTED to the new
VIR_ERR_DEPRECATED.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoerror: Add VIR_ERR_DEPRECATED error code
Peter Krempa [Fri, 21 Jun 2019 06:28:17 +0000 (08:28 +0200)]
error: Add VIR_ERR_DEPRECATED error code

Allow a simple programatic check that a given feature is no longer
supported by introducing a separate error code for this scenario.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: storage: also sanitize source dir
Ján Tomko [Tue, 25 Jun 2019 11:37:16 +0000 (13:37 +0200)]
conf: storage: also sanitize source dir

Commit a7fb2258 added sanitization of storage pool target paths,
however source dir paths were left unsanitized.

A netfs pool with:
<source>
  <host name='10.20.30.40'/>
  <dir path='/nfs/'/>
</source>
will not be correctly detected as mounted by
virStorageBackendFileSystemIsMounted, because it shows up in the
mount list without the trailing slash.

Sanitize the source dir as well.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoconf: domain: Restore XPath context after virSecurityDeviceLabelDefParseXML
Peter Krempa [Mon, 24 Jun 2019 16:12:48 +0000 (18:12 +0200)]
conf: domain: Restore XPath context after virSecurityDeviceLabelDefParseXML

The function modifies the context but did not care to restore it back.
If a <seclabel> was used on a disk, the <privateData> would not be
parsed.

Use VIR_XPATH_NODE_AUTORESTORE and add a test case to validate that
everything works.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agostorage: fix omitted comma for ceph mon hosts to librados
Yi Li [Tue, 25 Jun 2019 11:41:25 +0000 (19:41 +0800)]
storage: fix omitted comma for ceph mon hosts to librados

Add omitted comma for multiple hosts.
Fixes: cdd362e0e7a34d4f8f102c75f2ca513d23dd1db0
Signed-off-by: Yi Li <yili@winhong.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_x86: Handle error in x86DataToCPU when calling x86DataAdd
John Ferlan [Fri, 21 Jun 2019 17:10:35 +0000 (13:10 -0400)]
cpu_x86: Handle error in x86DataToCPU when calling x86DataAdd

Commit 9c9620af called x86DataAdd without checking for an error,
so add the error checking.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agocpu_x86: Fix memory leak - virCPUx86GetHost
John Ferlan [Fri, 21 Jun 2019 17:07:15 +0000 (13:07 -0400)]
cpu_x86: Fix memory leak - virCPUx86GetHost

Commit 56b254dcc called virCPUx86DataAdd, but returned -1 directly
without calling the virCPUx86DataFree.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirpci: report dev->name in virPCIGetHeaderType error message
Daniel Henrique Barboza [Fri, 21 Jun 2019 15:58:28 +0000 (12:58 -0300)]
virpci: report dev->name in virPCIGetHeaderType error message

Trivial change. Adding the name of the device that has an
unknown PCI header type in that function helps when debugging
PCI code.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: Adjust ATTRIBUTE_NONNULL
John Ferlan [Fri, 21 Jun 2019 16:49:54 +0000 (12:49 -0400)]
qemu: Adjust ATTRIBUTE_NONNULL

Commit 7bf679ae removed the @json argument from the qemuMonitorOpen
prototype; however, it did not update the ATTRIBUTE_NONNULL value
which causes a build failure for when checking is enabled such as
when lv_cv_static_analysis is enabled.

Signed-off-by: John Ferlan <jferlan@redhat.com>
5 years agomaint: Add missing 'global:' tag in libvirt_public.syms
Eric Blake [Fri, 21 Jun 2019 19:23:06 +0000 (14:23 -0500)]
maint: Add missing 'global:' tag in libvirt_public.syms

Fixes: c08fc8d1
Signed-off-by: Eric Blake <eblake@redhat.com>
5 years agovirStorageSourceChainHasManagedPR: Check propely
Michal Privoznik [Fri, 21 Jun 2019 16:01:38 +0000 (18:01 +0200)]
virStorageSourceChainHasManagedPR: Check propely

In the virStorageSourceChainHasManagedPR() function we iterate
over whole backing chain trying to determine if one of the layers
has managed PR configured. But due to a typo we in fact check the
top layer only.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agorpc: add $(SASL_CFLAGS) to libvirt_net_rpc_server_la_CFLAGS
Daniel P. Berrangé [Fri, 21 Jun 2019 14:39:45 +0000 (15:39 +0100)]
rpc: add $(SASL_CFLAGS) to libvirt_net_rpc_server_la_CFLAGS

The files for libvirt-net-rpc-server.la refernce the sasl/sasl.h
system header but never used the $(SASL_CFLAGS) variable. This
was never noticed previously because the $(AVAHI_CLFAGS) were
set and these typically pulled in the same include directory.

When mDNS/Avahi support was removed this exposed the bug which
caused FreeBSD builds to break as /usr/local/include was no
longer searched for headers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Implement support for 'capability_filters' config option
Peter Krempa [Tue, 18 Jun 2019 08:04:32 +0000 (10:04 +0200)]
qemu: Implement support for 'capability_filters' config option

Filter out the given capabilities and set domain taint if we've done so.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: conf: Add debug option to allow disabling qemu capabilities
Peter Krempa [Tue, 18 Jun 2019 07:46:22 +0000 (09:46 +0200)]
qemu: conf: Add debug option to allow disabling qemu capabilities

In cases when e.g. a new feature breaks upstream behaviour it's useful
to allow users to disable the new feature to verify the regression and
possibly use it as a workaround until a fix is available.

The new qemu.conf option named "capability_filters" allows to remove
qemu capabilities from the detected bitmap.

This patch introduces the configuration infrastructure to parse the
option and pass it around.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Remove unused var 'corestr' from virQEMUDriverConfigLoadFile
Peter Krempa [Tue, 18 Jun 2019 07:02:28 +0000 (09:02 +0200)]
qemu: Remove unused var 'corestr' from virQEMUDriverConfigLoadFile

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuxml2argv: Test qemu namespace capability tweaking
Peter Krempa [Tue, 18 Jun 2019 06:29:36 +0000 (08:29 +0200)]
tests: qemuxml2argv: Test qemu namespace capability tweaking

Show that the capability tweaking stuff works by enabling blockdev in
the 'qemu-ns' test even in versions where it's not yet fully supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuxml2argv: Modernize and fork 'qemu-ns' test
Peter Krempa [Tue, 18 Jun 2019 06:27:07 +0000 (08:27 +0200)]
tests: qemuxml2argv: Modernize and fork 'qemu-ns' test

Use the DO_TEST_CAPS_LATEST/VER infrastructure to run a more modern
version of this and also fork it to a pre-blockdev version so that we
can check the qemu namespace capability tweaking.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Add support for modifying qemu capability list via qemu namespace
Peter Krempa [Mon, 17 Jun 2019 15:55:52 +0000 (17:55 +0200)]
qemu: domain: Add support for modifying qemu capability list via qemu namespace

For testing purposes it's sometimes desired to be able to control the
presence of capabilities of qemu. This adds the possibility to do this
via the qemu namespace.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Add support for controling qemu capabilities via the qemu XML namespace
Peter Krempa [Mon, 17 Jun 2019 15:17:56 +0000 (17:17 +0200)]
qemu: Add support for controling qemu capabilities via the qemu XML namespace

Similarly how we allow adding arbitrary command line arguments and
environment variables this patch introduces the ability to control
libvirt's perception of the qemu process by tweaking the capability bits
for testing purposes.

The idea is to allow developers and users either test a new feature by
enabling it early or disabling it to see whether it introduced
regressions.

This feature is not meant for production use though, so users should
handle it with care.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Add taint flag for custom hypervisor features
Peter Krempa [Mon, 17 Jun 2019 15:31:45 +0000 (17:31 +0200)]
conf: Add taint flag for custom hypervisor features

Upcoming patches will allow enabling/disabling custom hypervisor
features for debugging/testing purposes via the qemu namespace.

Add a taint flag where we will flag such a domain so it's obvious what's
happening.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Split out commandline namespace data formatting
Peter Krempa [Mon, 17 Jun 2019 14:45:06 +0000 (16:45 +0200)]
qemu: domain: Split out commandline namespace data formatting

Separate it from qemuDomainDefNamespaceFormatXML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Refactor qemuDomainDefNamespaceParse
Peter Krempa [Mon, 17 Jun 2019 14:10:12 +0000 (16:10 +0200)]
qemu: Refactor qemuDomainDefNamespaceParse

Rename 'cmd' to 'nsdef' and improve the control flow.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Extract parsing of qemu namespace env vars into separate function
Peter Krempa [Mon, 17 Jun 2019 13:41:50 +0000 (15:41 +0200)]
qemu: Extract parsing of qemu namespace env vars into separate function

Simplify the main function by splitting out how we parse the extra
passthrough environment variables.

Note that the validation function checks that the first letter must be a
character or underscore which makes the check whether the name is
redundant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Extract parsing of qemu namespace arguments into separate function
Peter Krempa [Mon, 17 Jun 2019 13:41:50 +0000 (15:41 +0200)]
qemu: Extract parsing of qemu namespace arguments into separate function

Simplify the main function by splitting out how we parse the extra
passthrough commandline arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Use virStringListFreeCount in qemuDomainXmlNsDefFree
Peter Krempa [Mon, 17 Jun 2019 13:12:13 +0000 (15:12 +0200)]
qemu: domain: Use virStringListFreeCount in qemuDomainXmlNsDefFree

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Move qemuDomainXmlNsDef(Free) from qemu_conf.(ch)
Peter Krempa [Mon, 17 Jun 2019 13:07:00 +0000 (15:07 +0200)]
qemu: Move qemuDomainXmlNsDef(Free) from qemu_conf.(ch)

qemu_conf.c deals with the configuration file. Better fit for the
structure and freeing function will be qemu_domain.c where the rest of
the namespace parsing/formatting stuff resides.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Rename qemuDomainCmdlineDefPtr to qemuDomainXmlNsDefPtr
Peter Krempa [Fri, 14 Jun 2019 12:18:37 +0000 (14:18 +0200)]
qemu: Rename qemuDomainCmdlineDefPtr to qemuDomainXmlNsDefPtr

The data injected via the namespace may contain also other things than
commandline passthrough definitions. Rename it to make it more
universal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: vircgroupv2: add support for BFQ files
Pavel Hrdina [Tue, 18 Jun 2019 13:19:43 +0000 (15:19 +0200)]
util: vircgroupv2: add support for BFQ files

In kernel 4.12 there was introduced new BFQ scheduler and in kernel
5.0 the old CFQ scheduler was removed.  This has an implication on
the cgroups file names.

If the CFQ controller is enabled we use one file:

    io.weight

The new BFQ controller expose one file with different name:

    io.bfq.weight

Except for different name they have different syntax.

io.weight:

    default $val
    major:minor $val

io.bfq.weight:

    $val

The difference is that BFQ doesn't support per-device weight.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: vircgroupv1: add support for BFQ blkio files
Pavel Hrdina [Tue, 18 Jun 2019 13:15:43 +0000 (15:15 +0200)]
util: vircgroupv1: add support for BFQ blkio files

In kernel 4.12 there was introduced new BFQ scheduler and in kernel
5.0 the old CFQ scheduler was removed.  This has an implication on
the cgroups file names.

If the CFQ controller is enabled we use these two files:

    blkio.weight
    blkio.weight_device

The new BFQ controller expose only one file with different name:

    blkio.bfq.weight

The reason is that BFQ controller doesn't support per-device weight.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: vircgroup: move virCgroupGetValueStr out of virCgroupGetValueForBlkDev
Pavel Hrdina [Tue, 18 Jun 2019 13:24:41 +0000 (15:24 +0200)]
util: vircgroup: move virCgroupGetValueStr out of virCgroupGetValueForBlkDev

If we need to get a path of specific file and we need to check its
existence before we use it then we can reuse that path to get value
for specific device.  This way we will not build the path again in
virCgroupGetValueForBlkDev.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: vircgroup: introduce virCgroup(Get|Set)ValueRaw
Pavel Hrdina [Tue, 18 Jun 2019 13:01:39 +0000 (15:01 +0200)]
util: vircgroup: introduce virCgroup(Get|Set)ValueRaw

If we need to get a path of specific file and we need to check its
existence before we use it then we can reuse that path to get/set
values instead of calling the existing get/set value functions which
would be building the path again.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: Space out entries in news.html
Peter Krempa [Fri, 21 Jun 2019 08:01:00 +0000 (10:01 +0200)]
docs: Space out entries in news.html

The header for the news entry blends together with the text and other
entries. This patch tries to space them out somewhat for better visual
separation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoremote: use VIR_DRV_OPEN_REMOTE_USER in ssh transport checks
Daniel P. Berrangé [Thu, 22 Mar 2018 17:31:56 +0000 (17:31 +0000)]
remote: use VIR_DRV_OPEN_REMOTE_USER in ssh transport checks

We currently refuse to connect to remote libvirtd over SSH if we see the
path ends in /session. Earlier on though we checked for /session and set
the VIR_DRV_OPEN_REMOTE_USER flag. There is one subtle distinction
though with the test driver. All test URIs are marked with this flag,
regardless of whether the URI indicates a local or remote connection.
Previously a local connection to the test driver would have used the
unprivileged libvirtd while a remote connection would have tried the
privileged libvirtd. With this we are consistent and use the
unprivileged for both local & remote, if the current user is non-root.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoremote: refactor how unprivileged user session connection is identified
Daniel P. Berrangé [Thu, 22 Mar 2018 15:13:48 +0000 (15:13 +0000)]
remote: refactor how unprivileged user session connection is identified

Currently the VIR_DRV_OPEN_REMOTE_USER flag is only set when we identify
that we're connecting to a local libvirtd daemon. We would like to be
able to set that even if connecting to a remote libvirtd daemon. This
entails refactoring the conditional check.

One subtle change is that the VIR_DRV_OPEN_REMOTE_USER is now set when
the test+XXX://  URI is used, even if a servername is present. This has
no effect in this patch, but will later.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoremote: delete the avahi mDNS support
Daniel P. Berrangé [Wed, 19 Jun 2019 14:19:23 +0000 (15:19 +0100)]
remote: delete the avahi mDNS support

Libvirtd has long had integration with avahi for advertising libvirtd
using mDNS when TCP/TLS listening is enabled. For a long time the
virt-manager application had support for auto-detecting libvirtds
on the local network using mDNS, but this was removed last year

  commit fc8f8d5d7e3ba80a0771df19cf20e84a05ed2422
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Sat Oct 6 20:55:31 2018 -0400

    connect: Drop avahi support

    Libvirtd can advertise itself over avahi. The feature is disabled by
    default though and in practice I hear of no one actually using it
    and frankly I don't think it's all that useful

    The 'Open Connection' wizard has a disproportionate amount of code
    devoted to this feature, but I don't think it's useful or worth
    maintaining, so let's drop it

I've never heard of any other applications having support for using
mDNS to detect libvirtd instances. Though it is theoretically possible
something exists out there, it is clearly going to be a niche use case
in the virt ecosystem as a whole.

By removing avahi integration we can cut down the dependency chain for
the basic libvirtd install and reduce our code maint burden.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoremote: drop code for migrating config files from pre-XDG dir layout
Daniel P. Berrangé [Wed, 19 Jun 2019 13:25:52 +0000 (14:25 +0100)]
remote: drop code for migrating config files from pre-XDG dir layout

The unprivileged libvirtd daemon switched to use the XDG dir layout in
the 0.9.13 release, and included code for moving config files from the
old location. The chances of someone upgrading libvirt from <= 0.9.12
directly to libvirt >= 5.5.0 is close enough to zero that we can
reasonably drop the back compat code.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agorpc: virnetlibsshsession: update deprecated functions
Pavel Hrdina [Fri, 21 Jun 2019 07:18:11 +0000 (09:18 +0200)]
rpc: virnetlibsshsession: update deprecated functions

In libssh 0.9.0 functions ssh_is_server_known and ssh_write_knownhost
are marked as deprecated.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoRevert "news: Document removal of qemu commandline parsing"
Peter Krempa [Fri, 21 Jun 2019 06:47:58 +0000 (08:47 +0200)]
Revert "news: Document removal of qemu commandline parsing"

Jano probably based his branch on top of mine and didn't notice
when I moved the section up slightly and thus git applied it again.

Keep only the instance followin the new features section.

This reverts commit 9c68bb4a5c2c8c050e531533e5188a637ba1dd9f.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 years agoFix 'validate' typo in comments
Jonathon Jongsma [Thu, 20 Jun 2019 19:36:18 +0000 (14:36 -0500)]
Fix 'validate' typo in comments

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agotest_driver: properly handle DHCP ranges and IPv6 networks in testDomainInterfaceAddr...
Ilias Stamatis [Wed, 19 Jun 2019 16:45:30 +0000 (18:45 +0200)]
test_driver: properly handle DHCP ranges and IPv6 networks in testDomainInterfaceAddresses

testDomainInterfaceAddresses always returns the same hard-coded
addresses. Change the behavior such as if there is a DHCP range defined,
addresses are returned from that pool.

The specific address returned depends on both the domain id and the
specific guest interface in an attempt to return unique addresses *most
of the time*.

Additionally, properly handle IPv6 networks which were previously
ignored completely.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: process: Report better error when virtlogd connection fails
Peter Krempa [Tue, 11 Jun 2019 11:58:29 +0000 (13:58 +0200)]
qemu: process: Report better error when virtlogd connection fails

When connecting to virtlogd fails e.g. due to wrong libvirtd selinux
process label we'd report an utterly useless error message:

$ virsh start upstream
error: Failed to start domain upstream
error: Cannot recv data: Connection reset by peer

Use virLastErrorPrefixMessage in the correct place to give a better
sense of what's going on:

$ virsh start upstream
error: Failed to start domain upstream
error: can't connect to virtlogd: Cannot recv data: Connection reset by peer

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: error: Add API for prefixing last set error with a string
Peter Krempa [Tue, 11 Jun 2019 09:23:48 +0000 (11:23 +0200)]
util: error: Add API for prefixing last set error with a string

In some cases we report a low level error message which does not have
enough information to see what the problem is. To allow improving on
this add an API which will prefix the error message with another error
message string which can be used to describe where the error comes from.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: domainsnapshotxml2xml: make 'disk-seclabel' test operational
Peter Krempa [Tue, 5 Jun 2018 14:02:11 +0000 (16:02 +0200)]
tests: domainsnapshotxml2xml: make 'disk-seclabel' test operational

Now that we added the seclabels to the schema we can test that they are
parsed and formatted correctly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 years agodocs: schemas: Add 'seclabel' for external disk snapshot
Peter Krempa [Tue, 5 Jun 2018 13:54:00 +0000 (15:54 +0200)]
docs: schemas: Add 'seclabel' for external disk snapshot

Allow using seclabels the same way as disk images allow it. Currently
the snapshot code copies the seclabels from the original image if no
seclabel is provided. Also there's no code change required as the
snapshot XML parser actually uses parts of the disk parser thus
seclabels are already parsed and formatted and even applied thus this is
just a formalization of our support for this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 years agodocs: snapshot: Encourage people ot use disk 'target' to refer to disks
Peter Krempa [Thu, 20 Jun 2019 07:57:54 +0000 (09:57 +0200)]
docs: snapshot: Encourage people ot use disk 'target' to refer to disks

Change the example and add a recommendation to use disk target rather
than path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 years agodocs: Fix Blog Planet links
Martin Kletzander [Thu, 20 Jun 2019 15:00:17 +0000 (17:00 +0200)]
docs: Fix Blog Planet links

They were pointing to the blogs instead, now they point the articles.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
5 years agovirsh: snapshot: Don't block --no-metadata with --print-xml
Peter Krempa [Thu, 20 Jun 2019 12:44:51 +0000 (14:44 +0200)]
virsh: snapshot: Don't block --no-metadata with --print-xml

When testing stuff you might want to print the XML. Interlocking it with
no metadata adds exactly 0 value to the user.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: driver: Fix off-by-one in qemuDomainSnapshotDiskDataCollect
Peter Krempa [Thu, 20 Jun 2019 13:41:48 +0000 (15:41 +0200)]
qemu: driver: Fix off-by-one in qemuDomainSnapshotDiskDataCollect

Commit f34397e51c17 introduced a crash-inducing problem when collecting
disk snapshot data, where the array would be filled starting from the
second element.

The code then dereferenced the first one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Remove qemuMonitorTextSetCPU
Peter Krempa [Thu, 20 Jun 2019 11:15:04 +0000 (13:15 +0200)]
qemu: Remove qemuMonitorTextSetCPU

It's not used any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: monitor: Remove text monitor support for cpu hot(un)plug
Peter Krempa [Thu, 20 Jun 2019 11:12:04 +0000 (13:12 +0200)]
qemu: monitor: Remove text monitor support for cpu hot(un)plug

The "cpu-add" command is supported in all supported qemu versions and
cpu unplug did not work at all until the new cpu unplug approach (using
device_add/del) was implemented.

Remove the support for falling back to the text monitor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirNetworkGetDHCPLeases: fix docstring format
Ilias Stamatis [Tue, 18 Jun 2019 14:21:57 +0000 (16:21 +0200)]
virNetworkGetDHCPLeases: fix docstring format

The docstring of virNetworkGetDHCPLeases is not correctly formatted and
as a result the example code snippet appears as normal text under the
"Returns:" section. This patch fixes the problem.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
5 years agotest_driver: check that the domain is running in testDomainGetTime
Ilias Stamatis [Thu, 20 Jun 2019 11:41:01 +0000 (13:41 +0200)]
test_driver: check that the domain is running in testDomainGetTime

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Remove unused JavaScript libraries
Martin Kletzander [Wed, 19 Jun 2019 14:49:15 +0000 (16:49 +0200)]
docs: Remove unused JavaScript libraries

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: Use our own implementation for fetching the RSS data
Martin Kletzander [Wed, 19 Jun 2019 13:50:40 +0000 (15:50 +0200)]
docs: Use our own implementation for fetching the RSS data

It will not be executed when the page is loaded locally.  It needs
planet.virt-tools.org to supply the right headers (which it does now).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: Some JavaScript clean-up
Martin Kletzander [Thu, 20 Jun 2019 09:21:37 +0000 (11:21 +0200)]
docs: Some JavaScript clean-up

Don't use the global namespace, unify quotes and semicolons at the end of lines
and "use strict".

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: Drop MSR features from host-model with old QEMU
Jiri Denemark [Wed, 19 Jun 2019 20:22:09 +0000 (22:22 +0200)]
qemu: Drop MSR features from host-model with old QEMU

With QEMU versions which lack "unavailable-features" we use CPUID based
detection of features which were enabled or disabled once QEMU starts.
Thus using MSR features with host-model would result in all of them
being marked as disabled in the active domain definition even though
QEMU did not actually disable them.

Let's make sure we add MSR features to host-model only when
"unavailable-features" property is supported by QEMU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Forbid MSR features with old QEMU
Jiri Denemark [Wed, 19 Jun 2019 19:59:49 +0000 (21:59 +0200)]
qemu: Forbid MSR features with old QEMU

Without "unavailable-features" CPU property we cannot properly detect
whether a specific MSR feature we asked for (either explicitly or
implicitly via a CPU model) was disabled by QEMU for some reason.
Because this could break migration, snapshots, and save/restore
operaions, it's better to just forbid any use of MSR features with QEMU
which lacks "unavailable-features" CPU property.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_map: Introduce IA32_ARCH_CAPABILITIES MSR features
Jiri Denemark [Thu, 14 Mar 2019 14:44:38 +0000 (15:44 +0100)]
cpu_map: Introduce IA32_ARCH_CAPABILITIES MSR features

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_x86: Read CPU features from IA32_ARCH_CAPABILITIES MSR
Jiri Denemark [Fri, 22 Mar 2019 15:52:21 +0000 (16:52 +0100)]
cpu_x86: Read CPU features from IA32_ARCH_CAPABILITIES MSR

This is used by the host capabilities code to construct host CPU
definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_x86: Introduce virCPUx86FeatureFilter*MSR
Jiri Denemark [Wed, 19 Jun 2019 19:59:12 +0000 (21:59 +0200)]
cpu_x86: Introduce virCPUx86FeatureFilter*MSR

This functions may be used as a virCPUDefFeatureFilter callbacks for
virCPUDefCheckFeatures, virCPUDefFilerFeatures, and similar functions to
select (virCPUx86FeatureFilterSelectMSR) or drop
(virCPUx86FeatureFilterDropMSR) features reported via MSR.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_x86: Turn virCPUx86DataIteratorInit into a function
Jiri Denemark [Wed, 19 Jun 2019 19:58:01 +0000 (21:58 +0200)]
cpu_x86: Turn virCPUx86DataIteratorInit into a function

Until now, this was a macro usable for direct initialization when a
variable is defined. Turning the macro into a function makes it more
general.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Introduce virCPUDefCheckFeatures
Jiri Denemark [Wed, 19 Jun 2019 17:01:30 +0000 (19:01 +0200)]
conf: Introduce virCPUDefCheckFeatures

This API can be used to check whether a CPU definition contains features
matching a given filter.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoapi: disallow virConnect*HypervisorCPU on read-only connections
Ján Tomko [Fri, 14 Jun 2019 07:17:39 +0000 (09:17 +0200)]
api: disallow virConnect*HypervisorCPU on read-only connections

These APIs can be used to execute arbitrary emulators.
Forbid them on read-only connections.

Fixes: CVE-2019-10168
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoapi: disallow virConnectGetDomainCapabilities on read-only connections
Ján Tomko [Fri, 14 Jun 2019 07:16:14 +0000 (09:16 +0200)]
api: disallow virConnectGetDomainCapabilities on read-only connections

This API can be used to execute arbitrary emulators.
Forbid it on read-only connections.

Fixes: CVE-2019-10167
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoapi: disallow virDomainManagedSaveDefineXML on read-only connections
Ján Tomko [Fri, 14 Jun 2019 07:14:53 +0000 (09:14 +0200)]
api: disallow virDomainManagedSaveDefineXML on read-only connections

The virDomainManagedSaveDefineXML can be used to alter the domain's
config used for managedsave or even execute arbitrary emulator binaries.
Forbid it on read-only connections.

Fixes: CVE-2019-10166
Reported-by: Matthias Gerstner <mgerstner@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoapi: disallow virDomainSaveImageGetXMLDesc on read-only connections
Ján Tomko [Fri, 14 Jun 2019 06:47:42 +0000 (08:47 +0200)]
api: disallow virDomainSaveImageGetXMLDesc on read-only connections

The virDomainSaveImageGetXMLDesc API is taking a path parameter,
which can point to any path on the system. This file will then be
read and parsed by libvirtd running with root privileges.

Forbid it on read-only connections.

Fixes: CVE-2019-10161
Reported-by: Matthias Gerstner <mgerstner@suse.de>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: monitor: s/ret/rc/ in UpdateVideoSize functions
Ján Tomko [Fri, 14 Jun 2019 19:40:19 +0000 (21:40 +0200)]
qemu: monitor: s/ret/rc/ in UpdateVideoSize functions

Use 'rc' to temporarily store the subfunction return values,
instead of ret.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: monitor: use VIR_AUTOFREE in qemuMonitor*VideoSize
Ján Tomko [Fri, 14 Jun 2019 19:38:40 +0000 (21:38 +0200)]
qemu: monitor: use VIR_AUTOFREE in qemuMonitor*VideoSize

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: monitor: remove the json field
Ján Tomko [Fri, 14 Jun 2019 18:05:26 +0000 (20:05 +0200)]
qemu: monitor: remove the json field

Now that it is no longer used, remove it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: monitor: remove mon->json checks
Ján Tomko [Fri, 14 Jun 2019 18:06:48 +0000 (20:06 +0200)]
qemu: monitor: remove mon->json checks

Remove all the mon->json checks in qemuMonitor functions.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: monitor: assume JSON in QEMU_CHECK_MONITOR macro
Ján Tomko [Fri, 14 Jun 2019 18:05:44 +0000 (20:05 +0200)]
qemu: monitor: assume JSON in QEMU_CHECK_MONITOR macro

In preparation to removing the json field from qemuMonitor,
stop checking for it in QEMU_CHECK_MONITOR.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: remove json argument from qemuMonitorOpen
Ján Tomko [Fri, 14 Jun 2019 18:08:00 +0000 (20:08 +0200)]
qemu: remove json argument from qemuMonitorOpen

Always assume JSON monitor was requested, since all the callers
pass true anyway.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: domain: remove monJSON field
Ján Tomko [Fri, 14 Jun 2019 19:14:42 +0000 (21:14 +0200)]
qemu: domain: remove monJSON field

If we have a monitor, it is a JSON monitor.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: assume monJSON is always true
Ján Tomko [Fri, 14 Jun 2019 19:13:58 +0000 (21:13 +0200)]
qemu: assume monJSON is always true

Now that we no longer support the HMP monitor, remove some dead code.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agonews: Document removal of qemu commandline parsing
Peter Krempa [Mon, 17 Jun 2019 12:12:46 +0000 (14:12 +0200)]
news: Document removal of qemu commandline parsing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: Update documentation for spapr-vio addresses
Andrea Bolognani [Fri, 14 Jun 2019 11:19:49 +0000 (13:19 +0200)]
docs: Update documentation for spapr-vio addresses

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Format spapr-vio addresses as 32-bit
Andrea Bolognani [Fri, 14 Jun 2019 10:46:15 +0000 (12:46 +0200)]
qemu: Format spapr-vio addresses as 32-bit

No reason not to be consistent with the user-visible value.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: Format spapr-vio addresses as 32-bit
Andrea Bolognani [Fri, 14 Jun 2019 10:46:05 +0000 (12:46 +0200)]
conf: Format spapr-vio addresses as 32-bit

Using 8 hex digits all the time, regardless of whether the
actual value can fit in fewer, makes it more obvious to the
user what the limits are.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: Add pseries-spaprvio-invalid
Andrea Bolognani [Fri, 14 Jun 2019 10:50:43 +0000 (12:50 +0200)]
tests: Add pseries-spaprvio-invalid

This test case shows that we now reject invalid spapr-vio
addresses.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Validate spapr-vio addresses
Andrea Bolognani [Fri, 14 Jun 2019 10:50:22 +0000 (12:50 +0200)]
qemu: Validate spapr-vio addresses

According to sPAPR, addresses are 32-bit rather than 64-bit.
Update qemuDomainDeviceDefValidateAddress() accordingly.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Rework qemuDomainDeviceDefValidateAddress()
Andrea Bolognani [Wed, 12 Jun 2019 11:05:24 +0000 (13:05 +0200)]
qemu: Rework qemuDomainDeviceDefValidateAddress()

Introduce a switch() statement and prepare for validating
more address types than just PCI.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Fix validation of spapr-vio addresses
Andrea Bolognani [Fri, 14 Jun 2019 10:50:32 +0000 (12:50 +0200)]
docs: Fix validation of spapr-vio addresses

According to sPAPR, addresses are 32-bit (8 hex digits) rather
than 64-bit (16 hex digits). Update the schema accordingly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>