]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
5 years agoremote: add support for new network port APIs
Daniel P. Berrangé [Mon, 10 Dec 2018 17:43:42 +0000 (17:43 +0000)]
remote: add support for new network port APIs

Define the wire protocol for the virNetworkPort APIs and enable the
client/server RPC dispatch.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoaccess: add permissions for network port objects
Daniel P. Berrangé [Fri, 30 Nov 2018 16:34:21 +0000 (16:34 +0000)]
access: add permissions for network port objects

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: add public APIs for network port object
Daniel P. Berrangé [Fri, 30 Nov 2018 14:55:56 +0000 (14:55 +0000)]
network: add public APIs for network port object

Introduce a new virNetworPort object that will present an attachment to
a virtual network from a VM.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkUpdatePortBandwidth
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkUpdatePortBandwidth

Separate network port bandwidth update code from the domain driver
network callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkReleasePort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkReleasePort

Separate network port deletion code from the domain driver network
callback implementation.

Reivewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkNotifyPort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkNotifyPort

Separate network port notification code from the domain driver network
callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkAllocatePort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkAllocatePort

Separate network port allocation code from the domain driver network
callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: remove the virDomainNetBandwidthChangeAllowed callback
Daniel P. Berrangé [Tue, 26 Feb 2019 14:49:35 +0000 (14:49 +0000)]
network: remove the virDomainNetBandwidthChangeAllowed callback

The current qemu driver code for changing bandwidth on a NIC first asks
the network driver if the change is supported, then changes the
bandwidth on the VIF, and then tells the network driver to update the
bandwidth on the bridge.

This is potentially racing if a parallel API call causes the network
driver to allocate bandwidth on the bridge between the check and the
update phases.

Change the code to just try to apply the network bridge update
immediately and rollback at the end if something failed.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert hook script to take a network port XML
Daniel P. Berrangé [Wed, 19 Dec 2018 15:36:04 +0000 (15:36 +0000)]
network: convert hook script to take a network port XML

When (un)plugging an interface into a network, the 'plugged'
and 'unplugged' operations are invoked in the hook script.

The data provided to the script contains the network XML, the
domain XML and the domain interface XML. When we strictly split the
drivers up this will no longer be possible and thus breakage is
unavoidable. The hook scripts are not considered to be covered by the
API guarantee so this is OK.

To avoid existing scripts taking the wrong action, the existing
operations are changed to 'port-created' and 'port-deleted'
instead. These will receive the network XML and the network port
XML.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkReleaseActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 12 Nov 2018 16:32:31 +0000 (16:32 +0000)]
network: convert networkReleaseActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkReleaseActualDevice. This largely decouples
the method impl from the domain object type.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkNotifyActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 12 Nov 2018 16:32:31 +0000 (16:32 +0000)]
network: convert networkNotifyActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkNotifyActualDevice. This largely decouples
the method impl from the domain object type.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkAllocateActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 3 Sep 2018 16:34:22 +0000 (17:34 +0100)]
network: convert networkAllocateActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkAllocateActualDevice. This largely decouples
the method impl from the domain object type.

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