]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agovirhostdev: Use VIR_AUTOUNREF more
Michal Privoznik [Sat, 15 Jun 2019 07:03:47 +0000 (09:03 +0200)]
virhostdev: Use VIR_AUTOUNREF more

There are couple of functions which get shorter after the
treatment.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirHostdevReAttachPCIDevices: Construct pcidevs list earlier
Michal Privoznik [Mon, 10 Jun 2019 15:19:01 +0000 (17:19 +0200)]
virHostdevReAttachPCIDevices: Construct pcidevs list earlier

There's no need to translate virDomainHostdevDef-s into
virPCIDevice-s with locked list of PCI devices.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirHostdevPreparePCIDevices: Construct pcidevs list earlier
Michal Privoznik [Fri, 7 Jun 2019 11:56:46 +0000 (13:56 +0200)]
virHostdevPreparePCIDevices: Construct pcidevs list earlier

There's no need to translate virDomainHostdevDef-s into
virPCIDevice-s with locked list of PCI devices.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirHostdevGetPCIHostDeviceList: Use VIR_AUTOPTR for virPCIDevice
Michal Privoznik [Sat, 15 Jun 2019 06:28:05 +0000 (08:28 +0200)]
virHostdevGetPCIHostDeviceList: Use VIR_AUTOPTR for virPCIDevice

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirHostdevGetPCIHostDeviceList: Add @pci a bit later
Michal Privoznik [Sat, 15 Jun 2019 06:25:33 +0000 (08:25 +0200)]
virHostdevGetPCIHostDeviceList: Add @pci a bit later

This function is a good candidate for VIR_AUTOPTR() conversion.
But this conversion will be easier if we only add @pci device
onto @pcidevs list after it was all set up.

This is no functional change.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuProcessLaunch: Return earlier if spawning qemu failed
Michal Privoznik [Thu, 23 May 2019 09:00:27 +0000 (11:00 +0200)]
qemuProcessLaunch: Return earlier if spawning qemu failed

If spawning qemu fails then we report an error and proceed to
writing status XML onto the disk. This is unnecessary as we are
sure that the domain is not running.

At the same time, if virPidFileReadPath() fails it returns
-errno. Use it in the error message. It may explain what went
wrong.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: Advertise pcie-to-pci-bridge for use on q35
Andrea Bolognani [Fri, 7 Jun 2019 08:27:43 +0000 (10:27 +0200)]
docs: Advertise pcie-to-pci-bridge for use on q35

We support pcie-to-pci-bridge, and prefer it to
dmi-to-pci-bridge, since libvirt 4.3.0, but we didn't
update all the documentation accordingly at the time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: qapi: Implement support for 'features'
Peter Krempa [Wed, 10 Apr 2019 12:52:48 +0000 (14:52 +0200)]
qemu: qapi: Implement support for 'features'

Starting from version 4.1 qemu allows reporting 'features' for a given
QAPI type object. This allows reporting support of fixes and additions
which are otherwise invisible in the QAPI schema.

Implement a possibility to query 'features' in the QAPI query strings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemucaps: Update 4.1.0 capabilities to a more recent version
Peter Krempa [Thu, 20 Jun 2019 05:47:43 +0000 (07:47 +0200)]
tests: qemucaps: Update 4.1.0 capabilities to a more recent version

Update the capabilities from a non-upstream version (9c70209b63 is not
in qemu.git) to qemu upstream commit 33d6099906 (2019/06/18) so that we
get the QMP schema 'features' field support and are able to detect that
the 'file' block backend supports dynamic auto-read-only.

Note that I've rebuilt this on a machine with a more modern kernel and
microcode which exposes e.g. the recent CPU bug mitigations, thus I
opted to keep the CPU changes rather than trying to do a franken-caps
by updating only the output of query-qmp-schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosyntax check: update header guard check
Jonathon Jongsma [Wed, 19 Jun 2019 19:48:36 +0000 (14:48 -0500)]
syntax check: update header guard check

Internal headers should use #pragma once instead of the standard #ifndef
guard. Public headers still require the existing header guard.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_process: Prefer generic qemuMonitorGetGuestCPU
Jiri Denemark [Mon, 17 Jun 2019 21:38:46 +0000 (23:38 +0200)]
qemu_process: Prefer generic qemuMonitorGetGuestCPU

When updating guest CPU definition according to the vCPU actually
created by QEMU, we want to use the generic qemuMonitorGetGuestCPU to
get both CPUID and MSR features.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Introduce generic qemuMonitorGetGuestCPU
Jiri Denemark [Mon, 17 Jun 2019 21:36:53 +0000 (23:36 +0200)]
qemu: Introduce generic qemuMonitorGetGuestCPU

Unlike the old version (which is now called qemuMonitorGetGuestCPUx86),
this monitor API checks for individual features by their names rather
than processing CPUID bits. Thus we can get the list of enabled and
disabled features for both CPUID and MSR features.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Add type filter to qemuMonitorJSONParsePropsList
Jiri Denemark [Mon, 17 Jun 2019 19:51:20 +0000 (21:51 +0200)]
qemu: Add type filter to qemuMonitorJSONParsePropsList

The function converts a list of QOM properties into a NULL-terminated
array of property names. The new type parameter may be used to limit the
result to properties of a specific type.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu: Introduce virCPUDataAddFeature
Jiri Denemark [Tue, 18 Jun 2019 08:09:31 +0000 (10:09 +0200)]
cpu: Introduce virCPUDataAddFeature

This is a generic replacement for the former virCPUx86DataAddFeature,
which worked on the generic virCPUDataPtr anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Make qemuMonitorGetGuestCPU usable on x86 only
Jiri Denemark [Mon, 17 Jun 2019 14:56:32 +0000 (16:56 +0200)]
qemu: Make qemuMonitorGetGuestCPU usable on x86 only

It was never implemented or used for anything else anyway. Mainly
because it uses CPUID features bits. The function is renamed as
qemuMonitorGetGuestCPUx86 to make this explicit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Don't use full CPU model expansion
Jiri Denemark [Wed, 12 Jun 2019 11:54:27 +0000 (13:54 +0200)]
qemu: Don't use full CPU model expansion

We used type=full expansion on the result of previous type=static
expansion to get all possible spellings of CPU features. Since we can
now translate the QEMU's canonical names to our names, we can drop this
magic and do only type=static CPU model expansion.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Translate feature names from query-cpu-model-expansion
Jiri Denemark [Mon, 17 Jun 2019 11:54:53 +0000 (13:54 +0200)]
qemu: Translate feature names from query-cpu-model-expansion

By default query-cpu-model-expansion only reports canonical names of all
CPU features. We do some magic and call the command twice to get all
possible spellings of the features, but being able to consume canonical
names will allow us to drop this magic.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_command: Use canonical names of CPU features
Jiri Denemark [Fri, 7 Jun 2019 13:00:28 +0000 (15:00 +0200)]
qemu_command: Use canonical names of CPU features

When building QEMU command line, we should use the preferred spelling of
each CPU feature without relying on compatibility aliases (which may be
removed at some point).

The "unavailable-features" CPU property is used as a witness for the
correct names of the features in our translation table.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Probe host CPU after capabilities
Jiri Denemark [Mon, 17 Jun 2019 11:16:51 +0000 (13:16 +0200)]
qemu: Probe host CPU after capabilities

The way we call query-cpu-model-expansion will rely on some capabilities
bits. Let's make sure all capabilities are set before probing host CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Probe for "unavailable-features" CPU property
Jiri Denemark [Mon, 10 Jun 2019 14:49:22 +0000 (16:49 +0200)]
qemu: Probe for "unavailable-features" CPU property

It is similar to "filtered-features" property, which reports CPUID bits
corresponding to disabled features, but more general. The
"unavailable-features" property supports both CPUID and MSR features by
listing their names.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Probe for max-x86_64-cpu type
Jiri Denemark [Mon, 10 Jun 2019 14:46:10 +0000 (16:46 +0200)]
qemu: Probe for max-x86_64-cpu type

We will use it to check whether QEMU supports a specific CPU property.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Add APIs for translating CPU features
Jiri Denemark [Thu, 6 Jun 2019 07:27:18 +0000 (09:27 +0200)]
qemu: Add APIs for translating CPU features

So far we always used libvirt's name of each CPU feature relying on
backward compatible aliases in QEMU. The new translation table can be
used whenever QEMU mandates or prefers canonical feature names.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuxml2argvtest: Add test for CPU features translation
Jiri Denemark [Tue, 11 Jun 2019 15:14:27 +0000 (17:14 +0200)]
qemuxml2argvtest: Add test for CPU features translation

This should cover all CPU features for which QEMU prefers spelling that
differs from the one used by libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuxml2argvtest: Add 4.0.0 cases for kvm features tests
Jiri Denemark [Tue, 11 Jun 2019 14:44:36 +0000 (16:44 +0200)]
qemuxml2argvtest: Add 4.0.0 cases for kvm features tests

Newer QEMU will translate the feature names to their canonical names so
4.0.0 is the last one which produces the results we currently have in
*-latest.args.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Add domain capabilities case for QEMU 4.1.0
Jiri Denemark [Mon, 17 Jun 2019 11:39:41 +0000 (13:39 +0200)]
tests: Add domain capabilities case for QEMU 4.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Add QEMU caps data for future 4.1.0
Jiri Denemark [Tue, 11 Jun 2019 10:52:01 +0000 (12:52 +0200)]
tests: Add QEMU caps data for future 4.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_command: Use consistent syntax for CPU features
Jiri Denemark [Tue, 11 Jun 2019 12:47:46 +0000 (14:47 +0200)]
qemu_command: Use consistent syntax for CPU features

Normal CPU features use modern -cpu ...,feature=on|off syntax when
available, but kvm features kept using the old +feature or -feature.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuxml2argvtest: Switch some tests to DO_TEST_CAPS_*
Jiri Denemark [Wed, 12 Jun 2019 10:08:06 +0000 (12:08 +0200)]
qemuxml2argvtest: Switch some tests to DO_TEST_CAPS_*

These test check all kvm CPU features that could be passed to the -cpu
option by libvirt.

The 2.7.0 version is the last one for which we use +|-feature syntax for
CPU features, while feature=on|off is used with newer versions. This
is visible in the following patch which changes only the *-latest.args
files.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Filter CPU features in active XML
Jiri Denemark [Thu, 6 Jun 2019 12:51:14 +0000 (14:51 +0200)]
qemu: Filter CPU features in active XML

Properly filter features which should not be passed to QEMU because they
were never supported by QEMU or they did nothing and QEMU dropped them.

Currently they are just silently ignored by the command line generator.
Let's make this process more visible and clean by dropping the features
from the domain's active definition in qemuProcessUpdateGuestCPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu_conf: Introduce virCPUDefFilterFeatures
Jiri Denemark [Fri, 7 Jun 2019 12:07:10 +0000 (14:07 +0200)]
cpu_conf: Introduce virCPUDefFilterFeatures

This new internal API can be used for in place filtering of CPU features
in virCPUDef.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_process: Drop cleanup label from qemuProcessUpdateGuestCPU
Jiri Denemark [Thu, 6 Jun 2019 10:33:43 +0000 (12:33 +0200)]
qemu_process: Drop cleanup label from qemuProcessUpdateGuestCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Drop qemuFeatureNoEffect
Jiri Denemark [Thu, 6 Jun 2019 12:39:52 +0000 (14:39 +0200)]
qemu: Drop qemuFeatureNoEffect

We already have virQEMUCapsCPUFilterFeatures for filtering features
which QEMU does not know about. Let's move osxsave and ospke from
qemuFeatureNoEffect there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: use case sensitive javascript
Martin Kletzander [Wed, 19 Jun 2019 14:48:21 +0000 (16:48 +0200)]
docs: use case sensitive javascript

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
5 years agotools: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:15 +0000 (11:13 -0500)]
tools: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:14 +0000 (11:13 -0500)]
tests: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoxen: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:13 +0000 (11:13 -0500)]
xen: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/vz: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:12 +0000 (11:13 -0500)]
src/vz: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/vmx: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:11 +0000 (11:13 -0500)]
src/vmx: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/vmware: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:10 +0000 (11:13 -0500)]
src/vmware: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/vbox: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:09 +0000 (11:13 -0500)]
src/vbox: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: misc: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:08 +0000 (11:13 -0500)]
util: misc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: scsi: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:07 +0000 (11:13 -0500)]
util: scsi: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: xml: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:06 +0000 (11:13 -0500)]
util: xml: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: netlink: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:05 +0000 (11:13 -0500)]
util: netlink: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: sysinfo: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:04 +0000 (11:13 -0500)]
util: sysinfo: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: socketaddr: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:03 +0000 (11:13 -0500)]
util: socketaddr: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: string: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:02 +0000 (11:13 -0500)]
util: string: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: object: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:01 +0000 (11:13 -0500)]
util: object: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: mac: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:13:00 +0000 (11:13 -0500)]
util: mac: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: hash: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:59 +0000 (11:12 -0500)]
util: hash: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: command: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:58 +0000 (11:12 -0500)]
util: command: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: dbus: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:57 +0000 (11:12 -0500)]
util: dbus: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: virprobe.h: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:56 +0000 (11:12 -0500)]
util: virprobe.h: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: error: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:55 +0000 (11:12 -0500)]
util: error: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: cgroup: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:54 +0000 (11:12 -0500)]
util: cgroup: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: log: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:53 +0000 (11:12 -0500)]
util: log: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: host: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:52 +0000 (11:12 -0500)]
util: host: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: firewall: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:51 +0000 (11:12 -0500)]
util: firewall: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: file: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:50 +0000 (11:12 -0500)]
util: file: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: arch.h: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:49 +0000 (11:12 -0500)]
util: arch.h: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: netdev: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:48 +0000 (11:12 -0500)]
util: netdev: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: storage: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:47 +0000 (11:12 -0500)]
util: storage: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: atomic: use #pragma once
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:46 +0000 (11:12 -0500)]
util: atomic: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: alloc: use #pragma once
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:45 +0000 (11:12 -0500)]
util: alloc: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: thread: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:44 +0000 (11:12 -0500)]
util: thread: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/test: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:43 +0000 (11:12 -0500)]
src/test: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/storage: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:42 +0000 (11:12 -0500)]
src/storage: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/security: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:41 +0000 (11:12 -0500)]
src/security: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/secret: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:40 +0000 (11:12 -0500)]
src/secret: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/rpc: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:39 +0000 (11:12 -0500)]
src/rpc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/remote: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:38 +0000 (11:12 -0500)]
src/remote: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/qemu: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:37 +0000 (11:12 -0500)]
src/qemu: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/phyp: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:36 +0000 (11:12 -0500)]
src/phyp: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/openvz: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:35 +0000 (11:12 -0500)]
src/openvz: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/nwfilter: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:34 +0000 (11:12 -0500)]
src/nwfilter: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/network: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:33 +0000 (11:12 -0500)]
src/network: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/lxc: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:32 +0000 (11:12 -0500)]
src/lxc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/locking: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:31 +0000 (11:12 -0500)]
src/locking: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: delete unused QEMUD_CPUMASK_LEN macro
Ján Tomko [Wed, 19 Jun 2019 14:18:11 +0000 (16:18 +0200)]
qemu: delete unused QEMUD_CPUMASK_LEN macro

Unused as of:
commit f136b83139c63f20de0df3285d9e82df2fb97bfc
    qemu: Rework setting process affinity

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agotest_driver: validate @source in testDomainInterfaceAddresses
Ilias Stamatis [Wed, 19 Jun 2019 11:18:15 +0000 (13:18 +0200)]
test_driver: validate @source in testDomainInterfaceAddresses

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotest_driver: implement virDomainSendProcessSignal
Ilias Stamatis [Tue, 4 Jun 2019 13:17:43 +0000 (15:17 +0200)]
test_driver: implement virDomainSendProcessSignal

Only succeed when @pid_value is 1, since according to the docs this is
the minimum requirement for any driver to implement this API.
Since this is test driver, we assume that any signal from the supported
list can be sent to pid 1 and we therefore succeed every time.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoremote: remove obsolete & incorrect comment from libvirtd.conf
Daniel P. Berrangé [Fri, 20 Apr 2018 11:32:44 +0000 (12:32 +0100)]
remote: remove obsolete & incorrect comment from libvirtd.conf

The libvirtd.conf file has a comment pointing people to format.html
which has nothing todo with the configuration file format.

It also has a comment about tests/daemon-conf which no longer exists,
and even if it did exist such comment is not relevant to end users
when this file is installed in /etc/.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoapparmor: Add openGraphicsFD rule for named profile
Christian Ehrhardt [Wed, 19 Jun 2019 07:04:55 +0000 (09:04 +0200)]
apparmor: Add openGraphicsFD rule for named profile

Commit a3ab6d42 changed the libvirtd profile to a named profile
but neglected to accommodate the change in the qemu profile
ptrace and signal rules.
Later on 4ec3cf9a fixed that for ptrace and signal but openGraphicsFD
is still missing.

As a result, libvirtd is unable to open UI on libvirt >=5.1 e.g. with
virt-manager.

Add openGraphicsFD rule that references the libvirtd profile
by name in addition to full binary path.

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1833040
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
5 years agonetwork: add virNetworkPortRef API
Daniel P. Berrangé [Tue, 18 Jun 2019 11:44:39 +0000 (12:44 +0100)]
network: add virNetworkPortRef API

Normal practice is to provide a Ref API for all objects, but this was
forgotten for the virNetworkPortPtr object.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: remove unused class_id variable
Daniel P. Berrangé [Wed, 19 Jun 2019 08:29:55 +0000 (09:29 +0100)]
conf: remove unused class_id variable

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add error checking of UUID generation
Daniel P. Berrangé [Tue, 18 Jun 2019 17:36:52 +0000 (18:36 +0100)]
conf: add error checking of UUID generation

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix NULL deref when exporting ports
Daniel P. Berrangé [Tue, 18 Jun 2019 17:33:04 +0000 (18:33 +0100)]
conf: fix NULL deref when exporting ports

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix leak of directory handle when loading network ports
Daniel P. Berrangé [Tue, 18 Jun 2019 17:31:34 +0000 (18:31 +0100)]
conf: fix leak of directory handle when loading network ports

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix leak when parsing network port XML
Daniel P. Berrangé [Tue, 18 Jun 2019 17:29:26 +0000 (18:29 +0100)]
conf: fix leak when parsing network port XML

Use auto free to avoid leaking the "trustGuestRxFilters" strings

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agostorage: escape ipv6 for ceph mon hosts to librados
Yi Li [Sun, 28 Apr 2019 02:29:53 +0000 (10:29 +0800)]
storage: escape ipv6 for ceph mon hosts to librados

Hosts for rbd are ceph monitor daemons. These have fixed IP addresses,
so they are often referenced by IP rather than hostname for
convenience, or to avoid relying on DNS. Using IPv4 addresses as the
host name works already, but IPv6 addresses require rbd-specific
escaping because the colon is used as an option separator in the
string passed to librados.

Escape these colons, and enclose the IPv6 address in square brackets
so it is distinguished from the port, which is currently mandatory.

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 agodocs: fix some typos in networkport documentation
Ján Tomko [Mon, 17 Jun 2019 15:49:32 +0000 (17:49 +0200)]
docs: fix some typos in networkport documentation

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoProduce more verbose error if cppi not found
Michal Privoznik [Mon, 17 Jun 2019 16:19:03 +0000 (18:19 +0200)]
Produce more verbose error if cppi not found

It's fairly easy (especially for new contributors) to not spot
the 'cppi not installed' line in the syntax-check output. Add a
banner that is shown at the end of syntax-check output if no cppi
was found.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ACKed-by: Andrea Bolognani <abologna@redhat.com>
5 years agovirpcitest: Separate two functions properly
Michal Privoznik [Mon, 17 Jun 2019 15:42:13 +0000 (17:42 +0200)]
virpcitest: Separate two functions properly

There is a missing empty line between two functions since its
introduction in v1.2.0-rc1~150.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: switch over to use network port APIs for virt drivers
Daniel P. Berrangé [Mon, 24 Dec 2018 10:45:00 +0000 (10:45 +0000)]
conf: switch over to use network port APIs for virt drivers

Change the domain conf so invoke the new network port public APIs instead
of the network callbacks.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: record a portid against the domain conf
Daniel P. Berrangé [Fri, 1 Feb 2019 18:07:08 +0000 (18:07 +0000)]
conf: record a portid against the domain conf

The portid will be the UUID of the virNetworkPort object associated
with the network interface when a guest is running.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agolxc, libxl: save domain status after reconnect
Daniel P. Berrangé [Fri, 1 Feb 2019 17:40:41 +0000 (17:40 +0000)]
lxc, libxl: save domain status after reconnect

The various steps involved in reconnecting to a domain may cause updates
to the virDomainObj struct that need to be reflected in the saved status
file.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agolxc, libxl: notify network driver of NICs during reconnect
Daniel P. Berrangé [Fri, 1 Feb 2019 17:11:22 +0000 (17:11 +0000)]
lxc, libxl: notify network driver of NICs during reconnect

When starting up it is important to notify the network driver of any
NICs which are used by running guests so that it can account for any
resources they are using.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: add implementation of network port APIs
Daniel P. Berrangé [Fri, 14 Dec 2018 17:36:45 +0000 (17:36 +0000)]
network: add implementation of network port APIs

This initial implementation just wires up the APIs and does tracking of
the port XML definitions. It is not yet integrated into the resource
allocation logic.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: support recording ports against virNetworkObjPtr
Daniel P. Berrangé [Wed, 19 Dec 2018 14:24:53 +0000 (14:24 +0000)]
conf: support recording ports against virNetworkObjPtr

The virNetworkObjPtr state will need to maintain a record of all
virNetworkPortDefPtr objects associated with the network. Record these
in a hash and add APIs for manipulating them.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirsh: add support for network port APIs
Daniel P. Berrangé [Wed, 12 Dec 2018 16:58:31 +0000 (16:58 +0000)]
virsh: add support for network port APIs

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>