]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agoqemu_capabilities: Add QEMU_CAPS_QUERY_CURRENT_MACHINE
Daniel Henrique Barboza [Wed, 24 Apr 2019 21:16:27 +0000 (18:16 -0300)]
qemu_capabilities: Add QEMU_CAPS_QUERY_CURRENT_MACHINE

QEMU commit 46ea94ca9cf ("qmp: query-current-machine with
wakeup-suspend-support") added a new QMP command called
'query-current-machine' that retrieves guest parameters that
can vary in the same machine model (e.g. ACPI support for x86 VMs
depends on the '--no-acpi' option). Currently, this API has a single
flag, 'wakeup-suspend-support', that indicates whether the guest has
the capability of waking up from suspended state.

Introduce a libvirt capability that reflects whether qemu has the
monitor command.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovircgroup: no need to ifdef virCgroupFree
Pavel Hrdina [Wed, 24 Apr 2019 13:26:12 +0000 (15:26 +0200)]
vircgroup: no need to ifdef virCgroupFree

virCgroup struct is always defined and the free function is not calling
anything that would require OS supporting cgroups.

This fixes an issue if we try to start a VM with QEMU binary that
doesn't support QXL.  The start operation will fail in
qemuProcessStartValidateVideo() which will set correct error message,
but later in one of the cleanup paths we will call
qemuDomainObjPrivateDataClear() which always calls virCgroupFree()
and that will fail on OS that doesn't support cgroups and it will
set a new error which will be eventually reported to user.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoHandle copying bitmaps to larger data buffers
Allen, John [Mon, 15 Apr 2019 14:43:07 +0000 (14:43 +0000)]
Handle copying bitmaps to larger data buffers

If a bitmap of a shorter length than the data buffer is passed to
virBitmapToDataBuf, it will read off the end of the bitmap and copy junk
into the returned buffer. Add a check to only copy the length of the
bitmap to the buffer.

The problem can be observed after setting a vcpu affinity using the vcpupin
command on a system with a large number of cores:
  # virsh vcpupin example_domain 0 0
  # virsh vcpupin example_domain 0
     VCPU   CPU Affinity
    ---------------------------
     0      0,192,197-198,202

Signed-off-by: John Allen <john.allen@amd.com>
6 years agoconf: add cpu check attribute to ABI check
Nikolay Shirokovskiy [Wed, 24 Apr 2019 09:51:18 +0000 (12:51 +0300)]
conf: add cpu check attribute to ABI check

Different check values are not ABI compatible. For example
if on migration we change 'full' to 'partial' then guest cpu
on destination can be different.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
6 years agonetworkStartNetworkVirtual: Don't overwrite error in 'err5'
Michal Privoznik [Tue, 23 Apr 2019 14:04:55 +0000 (16:04 +0200)]
networkStartNetworkVirtual: Don't overwrite error in 'err5'

If there's an error when setting up QoS on a bridge the control
jumps over to 'err5' label. Here, the virNetDevBandwidthClear()
is called to clear out any partially set QoS. This function can
also report an error which would overwrite the actual error that
caused us jumping here. Use virErrorPreserveLast() to preserve
the original error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: monitor: check for common 'Error: ' string
Cole Robinson [Wed, 10 Apr 2019 17:56:54 +0000 (13:56 -0400)]
qemu: monitor: check for common 'Error: ' string

qemu 4.0.0 will prefix most errors with 'Error: ', so consider any
string instance of that an error.

This fixes savevm failure detection when migration is blocked due to
usage of nested VMX

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

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoqemu: monitor cleanup delvm error handling
Cole Robinson [Wed, 10 Apr 2019 17:43:39 +0000 (13:43 -0400)]
qemu: monitor cleanup delvm error handling

Drop redundant NULL checks, and add an error string prefix

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoqemu: monitor: cleanup loadvm error handling
Cole Robinson [Wed, 10 Apr 2019 17:52:29 +0000 (13:52 -0400)]
qemu: monitor: cleanup loadvm error handling

Drop redundant NULL checks, add error string prefixes, consolidate
a few indentical reports.

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agonetwork: Convert to virErrorRestore/virErrorPreserveLast
Syed Humaid [Wed, 17 Apr 2019 04:11:06 +0000 (08:11 +0400)]
network: Convert to virErrorRestore/virErrorPreserveLast

Replaced usage of virSaveLastError and virSetError/virFreeError with
virErrorPreserveLast and virErrorRestore respectively.

Signed-off-by: Syed Humaid <syedhumaidbinharoon@gmail.com>
6 years agovmx: Free @firmware in virVMXParseConfig
Michal Privoznik [Sat, 20 Apr 2019 05:01:04 +0000 (07:01 +0200)]
vmx: Free @firmware in virVMXParseConfig

The @firmware string is allocated, but never freed.

 4 bytes in 1 blocks are definitely lost in loss record 1 of 44
    at 0x483579F: malloc (vg_replace_malloc.c:299)
    by 0x76FB469: strdup (strdup.c:42)
    by 0x497B6DE: virStrdup (virstring.c:966)
    by 0x48F6FD3: virConfGetValueString (virconf.c:908)
    by 0x4B3E9B6: virVMXGetConfigStringHelper (vmx.c:736)
    by 0x4B3EA6B: virVMXGetConfigString (vmx.c:756)
    by 0x4B41AEA: virVMXParseConfig (vmx.c:1832)
    by 0x10B8E4: testCompareFiles (vmx2xmltest.c:79)
    by 0x10BAB8: testCompareHelper (vmx2xmltest.c:124)
    by 0x10D058: virTestRun (testutils.c:174)
    by 0x10CDDA: mymain (vmx2xmltest.c:288)
    by 0x10F11C: virTestMain (testutils.c:1096)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
6 years agolibxlDriverConfigDispose: Free @configBaseDir too
Michal Privoznik [Sat, 20 Apr 2019 05:00:49 +0000 (07:00 +0200)]
libxlDriverConfigDispose: Free @configBaseDir too

Allocated in libxlDriverConfigNew(), the @configBaseDir is never
freed.

 13 bytes in 1 blocks are definitely lost in loss record 36 of 125
    at 0x483579F: malloc (vg_replace_malloc.c:299)
    by 0x8012469: strdup (strdup.c:42)
    by 0x52926DE: virStrdup (virstring.c:966)
    by 0x11D46B: libxlDriverConfigNew (libxl_conf.c:1749)
    by 0x114D78: testCompareXMLToDomConfig (libxlxml2domconfigtest.c:62)
    by 0x1152A3: testCompareXMLToDomConfigHelper (libxlxml2domconfigtest.c:160)
    by 0x115925: virTestRun (testutils.c:174)
    by 0x1154A4: mymain (libxlxml2domconfigtest.c:216)
    by 0x1179E9: virTestMain (testutils.c:1096)
    by 0x1154FD: main (libxlxml2domconfigtest.c:224)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemucaps2xmltest: Don't leak @binary
Michal Privoznik [Sat, 20 Apr 2019 05:00:14 +0000 (07:00 +0200)]
qemucaps2xmltest: Don't leak @binary

There's no need to keep @binary around.
virQEMUCapsInitGuestFromBinary() duplicates the string anyway.

 1,002 bytes in 36 blocks are definitely lost in loss record 54 of 59
    at 0x483579F: malloc (vg_replace_malloc.c:299)
    by 0x796B1C7: vasprintf (vasprintf.c:73)
    by 0x4C3F2C6: virVasprintfInternal (virstring.c:740)
    by 0x4C3F3DC: virAsprintfInternal (virstring.c:761)
    by 0x13AFC9: testGetCaps (qemucaps2xmltest.c:105)
    by 0x13B200: testQemuCapsXML (qemucaps2xmltest.c:157)
    by 0x13B642: virTestRun (testutils.c:174)
    by 0x13B366: doCapsTest (qemucaps2xmltest.c:191)
    by 0x13FF2B: testQemuCapsIterate (testutilsqemu.c:941)
    by 0x13B427: mymain (qemucaps2xmltest.c:215)
    by 0x13D706: virTestMain (testutils.c:1096)
    by 0x13B489: main (qemucaps2xmltest.c:221)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu_cgroup: Remove unused qemuSetupCpusetMems
Michal Privoznik [Mon, 15 Apr 2019 16:28:41 +0000 (18:28 +0200)]
qemu_cgroup: Remove unused qemuSetupCpusetMems

This function is not used anymore. Let's remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoqemu: Set up EMULATOR thread and cpuset.mems before exec()-ing qemu
Michal Privoznik [Wed, 10 Apr 2019 15:14:25 +0000 (17:14 +0200)]
qemu: Set up EMULATOR thread and cpuset.mems before exec()-ing qemu

It's funny how this went unnoticed for such a long time. Long
story short, if a domain is configured with
VIR_DOMAIN_NUMATUNE_MEM_STRICT libvirt doesn't really honour
that. This is because of 7e72ac787848 after which libvirt allowed
qemu to allocate memory just anywhere and only after that it used
some magic involving cpuset.memory_migrate and cpuset.mems to
move the memory to desired NUMA nodes. This was done in order to
work around some KVM bug where KVM would fail if there wasn't a
DMA zone available on the NUMA node. Well, while the work around
might stopped libvirt tickling the KVM bug it also caused a bug
on libvirt side: if there is not enough memory on configured NUMA
node(s) then any attempt to start a domain must fail. Because of
the way we play with guest memory domains can start just happily.

The solution is to move the child we've just forked into emulator
cgroup, set up cpuset.mems and exec() qemu only after that.

This basically reverts 7e72ac787848b7434c9 which was a workaround
for kernel bug. This bug was apparently fixed because I've tested
this successfully with recent kernel.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoRevert "domain_conf: check device address before attach"
Michal Privoznik [Thu, 11 Apr 2019 13:40:51 +0000 (15:40 +0200)]
Revert "domain_conf: check device address before attach"

This reverts commit f1d6585300001c7b23b8796a0faa4411c3531996.

Turns out, this caused a regression. There is this (perhaps less
known) semantic of virDomainAttachDevice() where if the device
the API is trying to attach is a CDROM/floppy that is already in
the domain the attach request is handled as 'change the media in
the drive'.

We have a better fix anyways.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
6 years agoqemu_hotplug: Check for duplicate drive addresses
Michal Privoznik [Thu, 11 Apr 2019 13:45:27 +0000 (15:45 +0200)]
qemu_hotplug: Check for duplicate drive addresses

This tries to fix the same problem as f1d65853000 but it's doing
so in a less invasive way.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
6 years agoqemuhotplugtest: Don't plug a SCSI disk at unit 7
Michal Privoznik [Thu, 11 Apr 2019 14:23:38 +0000 (16:23 +0200)]
qemuhotplugtest: Don't plug a SCSI disk at unit 7

Unit number 7 is kind of special. It's reserved for SCSI
controller. The comment in virDomainSCSIDriveAddressIsUsed()
summarizes that pretty nicely. Libvirt would never generate
such address.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
6 years agoconf: Expose virDomainSCSIDriveAddressIsUsed
Michal Privoznik [Thu, 11 Apr 2019 13:44:14 +0000 (15:44 +0200)]
conf: Expose virDomainSCSIDriveAddressIsUsed

This function checks if given drive address is already present in
passed domain definition. Expose the function as it will be used
shortly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
6 years agonetwork: move re-attach of bridge device out of network driver
Daniel P. Berrangé [Fri, 1 Feb 2019 14:53:12 +0000 (14:53 +0000)]
network: move re-attach of bridge device out of network driver

During initial NIC setup the hypervisor drivers are responsible for
attaching the TAP device to the bridge device. Any fixup after libvirtd
restarts should thus also be their responsibility.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovirt drivers: don't handle type=network after resolving actual network type
Daniel P. Berrangé [Wed, 8 Aug 2018 15:27:53 +0000 (16:27 +0100)]
virt drivers: don't handle type=network after resolving actual network type

The call to resolve the actual network type will turn any NICs with
type=network into one of the other types. Thus there should be no need
to handle type=network in later switch() statements jumping off the
actual type.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: use 'bridge' as actual type instead of 'network'
Daniel P. Berrangé [Mon, 3 Sep 2018 16:48:53 +0000 (17:48 +0100)]
network: use 'bridge' as actual type instead of 'network'

Ports allocated on virtual networks with type=nat|route|open all get
given an actual type of 'network'.

Only ports in networks with type=bridge use an actual type of 'bridge'.

This distinction makes little sense since the virtualization drivers
will treat both actual types in exactly the same way, as they're all
just bridge devices a VM needs to be connected to.

This doesn't affect user visible XML since the "actual" device XML
is internal only, but we need code to convert the data upgrades.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoconf: don't pass interface type into virNetDevBandwidthParse
Daniel P. Berrangé [Tue, 29 Jan 2019 17:26:40 +0000 (17:26 +0000)]
conf: don't pass interface type into virNetDevBandwidthParse

The virNetDevBandwidthParse method uses the interface type to decide
whether to allow use of the "floor" parameter. Using the interface
type is not convenient as callers may not have that available, but
still wish to allow use of "floor". Switch to an explicit boolean
to control its usage.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: explain reason for bandwidth floor rejection
Daniel P. Berrangé [Tue, 16 Apr 2019 16:39:12 +0000 (17:39 +0100)]
network: explain reason for bandwidth floor rejection

Reword error messages to make it clear that the combined floor settings
of all NICs are exceeding the network inbound peak/average
settings. Including the actual values being checked helps to diagnose
what is actually wrong.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: ensure floor sum is reset to zero when starting networks
Daniel P. Berrangé [Tue, 16 Apr 2019 16:36:57 +0000 (17:36 +0100)]
network: ensure floor sum is reset to zero when starting networks

In extreme cases libvirt can get mixed up about what VMs are running and
attached to a network leading to the cached floor sum value being
outdated. When this happens the only option is to destroy the network
and then restart libvirtd. If we set floor sum back to zero when
starting the network, we avoid the need for a libvirtd restart at least.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agolib: domain: Convert to virErrorRestore/virErrorPreserveLast
Syed Humaid [Tue, 16 Apr 2019 18:51:01 +0000 (22:51 +0400)]
lib: domain: Convert to virErrorRestore/virErrorPreserveLast

Replaced all virSaveLastError and virSetError/virFreeError usages to
virErrorPreserveLast and virErrorRestore respectively.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Syed Humaid <syedhumaidbinharoon@gmail.com>
6 years agonetwork: stop passing virDomainNetDefPtr into bandwidth functions
Daniel P. Berrangé [Mon, 3 Sep 2018 11:02:22 +0000 (12:02 +0100)]
network: stop passing virDomainNetDefPtr into bandwidth functions

The networkPlugBandwidth & networkUnplugBandwidth methods currently take
a virDomainNetDefPtr. To remove the dependency on the domain config
struct, pass individual parameters instead.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: unconditionally merge port profiles
Daniel P. Berrangé [Mon, 3 Sep 2018 16:33:22 +0000 (17:33 +0100)]
network: unconditionally merge port profiles

All but one of the network types supports port profiles. Rather than
duplicating the code to merge profiles 3 times, do it once and then
later report an error if used from the wrong place.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoutil: add API for copying virtual port profile data
Daniel P. Berrangé [Mon, 3 Sep 2018 16:02:35 +0000 (17:02 +0100)]
util: add API for copying virtual port profile data

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoqemu: Simplify interface handling in qemuConnectDomainXMLToNative()
Michal Privoznik [Wed, 17 Apr 2019 08:14:59 +0000 (10:14 +0200)]
qemu: Simplify interface handling in qemuConnectDomainXMLToNative()

Firstly, VIR_STRDUP() accepts NULL, so there is no need to check
if the string we want to duplicate is not-NULL. Secondly,
virDomainNetSetModelString() also accepts NULL. Thirdly, we have
VIR_AUTOFREE().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Fix uninitialized variable
Andrea Bolognani [Wed, 17 Apr 2019 07:22:05 +0000 (09:22 +0200)]
qemu: Fix uninitialized variable

It has made Clang very unhappy ever since 6bf7c6769925.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
6 years agovz: fixes: snapshot: Factor out virDomainMomentDef class
Nikolay Shirokovskiy [Fri, 5 Apr 2019 14:50:13 +0000 (17:50 +0300)]
vz: fixes: snapshot: Factor out virDomainMomentDef class

Fix for commit ffc0fbebe refactoring snapshot code.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
ACKed-by: Maxim Nestratov <mnestratov@virtuozzo.com>
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
6 years agovz: fixes: snapshot: Switch type of virDomainSnapshotObj.def
Nikolay Shirokovskiy [Fri, 5 Apr 2019 14:49:25 +0000 (17:49 +0300)]
vz: fixes: snapshot: Switch type of virDomainSnapshotObj.def

Fix for commit 1ab05da22 refactoring snapshot code.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
ACKed-by: Maxim Nestratov <mnestratov@virtuozzo.com>
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
6 years agovz: fix for tracking current snapshot
Nikolay Shirokovskiy [Fri, 5 Apr 2019 14:33:49 +0000 (17:33 +0300)]
vz: fix for tracking current snapshot

f1056279 removed virDomainSnapshotDef.current and leaved
using vm->current_snapshot only. Later 4819f54bd moved current snapshot
tracking to virDomainSnapshotObjList. As vz driver never used
vm->current_snaphot this patch includes fixes after both commits.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
ACKed-by: Maxim Nestratov <mnestratov@virtuozzo.com>
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
6 years agotests: Use TEST_QEMU_CAPS_PATH wherever possible
Andrea Bolognani [Tue, 16 Apr 2019 10:31:00 +0000 (12:31 +0200)]
tests: Use TEST_QEMU_CAPS_PATH wherever possible

After the recent changes, there are only a few places left
where we use the explicit path instead of taking advantage of
the publicly available define; let's get rid of those too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: Drop dirname argument from testQemuCapsIterate()
Andrea Bolognani [Tue, 16 Apr 2019 10:33:14 +0000 (12:33 +0200)]
tests: Drop dirname argument from testQemuCapsIterate()

As evidenced by all existing callers, the only directory it makes
sense to use is TEST_QEMU_CAPS_PATH, so let's just bake that into
the function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: Drop dirname argument from testQemuGetLatestCapsForArch()
Andrea Bolognani [Tue, 16 Apr 2019 10:26:22 +0000 (12:26 +0200)]
tests: Drop dirname argument from testQemuGetLatestCapsForArch()

As evidenced by all existing callers, the only directory it makes
sense to use is TEST_QEMU_CAPS_PATH, so let's just bake that into
the function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: Make TEST_QEMU_CAPS_PATH public
Andrea Bolognani [Tue, 16 Apr 2019 10:22:31 +0000 (12:22 +0200)]
tests: Make TEST_QEMU_CAPS_PATH public

The value (with a slightly different name) is currently private
to testutilsqemu, but since we use this path all over the place
it makes sense to define it publicly and avoid repetition.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agosnapshot: Use post-parse instead of regex in testsuite
Eric Blake [Tue, 16 Apr 2019 13:00:40 +0000 (08:00 -0500)]
snapshot: Use post-parse instead of regex in testsuite

Now that we can override the post-parse handling, let's update the
testsuite to provide the desired timestamp/name rather than ignoring
the non-deterministic one that was previously being generated. A few
output files need timestamps added now that they are no longer
ignored.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agosnapshot: Allow for post-parse override
Eric Blake [Tue, 16 Apr 2019 02:59:44 +0000 (21:59 -0500)]
snapshot: Allow for post-parse override

Wire up the accessor functions necessary for the testsuite to install
an alternative post-parse handler from normal drivers. I could have
modified the signature for virDomainXMLOptionNew() to take another
parameter, but thought it was easier to add a new set function rather
than chase down all existing callers. Until code actually sets the
override, there is no change in behavior.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agosnapshot: Factor out post-parse code
Eric Blake [Mon, 15 Apr 2019 22:25:52 +0000 (17:25 -0500)]
snapshot: Factor out post-parse code

Move the non-deterministic code that sets snapshot properties
independently of what the incoming XML described to instead live in a
default post-parse function common to virDomainMoment (as checkpoints
will also reuse it in later patches). This patch is just code motion,
with no difference to any callers; but the next patch will further
refactor things to allow for a per-driver override, used by the
testsuite to perform deterministic post-parse actions for better
coverage of parser/formatter code.

Note that the post-parse code is intentionally not run during a
snapshot redefine, since that code path already requires a valid
snapshot name and creation time from the XML.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agosnapshot: Don't expose testsuite-only state in snapshot XML
Eric Blake [Tue, 16 Apr 2019 22:44:38 +0000 (17:44 -0500)]
snapshot: Don't expose testsuite-only state in snapshot XML

None of the existing drivers actually use the 0-valued 'nostate'
snapshot state; rather, it was a fluke of implementation. In fact,
some drivers, like qemu, actively reject 'nostate' as invalid during a
snapshot redefine. Normally, a driver computes the state post-parse
from the current domain, and thus virDomainSnapshotGetXMLDesc() will
never expose the state. However, since the testsuite lacks any
associated domain to copy state from, and lacks post-parse processing
that normal drivers have, the testsuite output had several spots with
the state, coupled with a regex filter to ignore the oddity.

It is better to follow the lead of other XML defaults, by not
outputting anything during format if post-parse defaults have not been
applied, and rejecting the default value during parsing. The testsuite
needs a bit of an update, by adding another flag for when to simulate
a post-parse action of setting a snapshot state, but none of the
drivers are impacted other than rejecting XML that was previously
already suspicious in nature.

Similarly, don't expose creation time 0 (for now, only possible if a
user redefined a snapshot to claim creation at the Epoch, but also
happens once setting the creation time is deferred to a post-parse
handler).

This is also a step towards cleaning up snapshot_conf.c to separate
its existing post-parse work (namely, setting the creationTime and
default snapshot name) from the pure parsing work, so that we can get
rid of the testsuite hack of regex filtering of the XML and instead
have more accurate testing of our parser/formatter code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agosnapshot: Refactor snapshotxml2xml test
Eric Blake [Mon, 15 Apr 2019 19:49:30 +0000 (14:49 -0500)]
snapshot: Refactor snapshotxml2xml test

Upcoming changes want to separate out a post-parse massaging of
snapshots separate from parsing the XML, so as not to be dependent on
filtering out an ever-changing timestamp from the testsuite. Along the
way, this means we will want to add yet another conditional to the
snapshot xml2xml tests on whether to perform post-processing steps to
canned values. This will be easier to read if we consolidate all the
decisions into a flags variable, instead of adding yet another
boolean.

While at it, drop the redundant inout test of "noparent" (once is
enough).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agoconf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING
Cole Robinson [Fri, 18 Jan 2019 20:57:32 +0000 (15:57 -0500)]
conf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING

This requires drivers to opt in to handle the raw modelstr
network model, all others will error if a passed in XML value
is not in the model enum.

Enable this feature for libxl/xen/xm and qemu drivers

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agovbox: Convert to net enum model
Cole Robinson [Fri, 18 Jan 2019 19:13:43 +0000 (14:13 -0500)]
vbox: Convert to net enum model

Convert the vbox driver to net model enum, which requires adding
enum values for Am79C970A, Am79C973, 82540EM, 82545EM, 82543GC. We
preserve the same casing that vbox historically used for these model
names.

Remove the now unused virDomainNetStrcaseeqModelString

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agovmx: convert to net model enum
Cole Robinson [Fri, 18 Jan 2019 19:02:07 +0000 (14:02 -0500)]
vmx: convert to net model enum

Convert the vmware/vmx driver to net model enum, which requires
adding enum values for vlance, vmxnet, vmxnet2, and vmxnet3.

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoconf: Make net model enum compare case insensitive
Cole Robinson [Wed, 13 Mar 2019 15:02:41 +0000 (11:02 -0400)]
conf: Make net model enum compare case insensitive

vbox and vmx drivers do net case insensitive net model comparisons,
so for example 'VMXNET3' and 'vmxnet3' and 'VmxNeT3' in the XML will
translate to the same driver configuration. To convert these drivers
to use net model enum, we will need to do case insensitive comparisons
as well.

Essentially we implement virEnumToString, but with case insensitive
comparison. XML will always be formatted with the enum model string
we track internally, but we will accept any case insensitive variant.

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoqemu: Partially convert to net model enum
Cole Robinson [Fri, 18 Jan 2019 14:59:02 +0000 (09:59 -0500)]
qemu: Partially convert to net model enum

This converts the qemu driver to the net model enum, for all
the model values that we have hardcoded for various checks,
which adds e1000e, virtio-transitional, virtio-non-transitional,
usb-net, spapr-vlan, lan9118, smc91c111

Because the qemu driver has historically also allowed the raw
model string onto the qemu command line, this isn't a full
conversion. Unwinding that will require more thought. However
for all new driver code we should be adding explicit enum
values for any model name we have special handling for.

Remove the now unused virDomainNetStreqModelString

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agobhyve: convert to net model enum
Cole Robinson [Fri, 18 Jan 2019 00:59:21 +0000 (19:59 -0500)]
bhyve: convert to net model enum

The bhyve driver only works with the virtio and e1000 models,
which we already have in the enum. Some error reporting is
slightly downgraded to avoid some subtle usage of modelstr

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agovz: convert to net model enum
Cole Robinson [Fri, 18 Jan 2019 00:53:14 +0000 (19:53 -0500)]
vz: convert to net model enum

The vz driver only handles three models: virtio, e1000, and rtl8139.
Add enum values for those models, and convert the vz driver to
handling net->model natively

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoconf: net: Add model enum, and netfront value
Cole Robinson [Fri, 18 Jan 2019 00:12:27 +0000 (19:12 -0500)]
conf: net: Add model enum, and netfront value

This adds a network model enum. The virDomainNetDef property
is named 'model' like most other devices.

When the XML parser or a driver calls NetSetModelString, if
the passed string is in the enum, we will set net->model,
otherwise we copy the string into net->modelstr

Add a single example for the 'netfront' xen model, and wire
that up, just to verify it's all working

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoconf: net: Rename 'model' to 'modelstr'
Cole Robinson [Fri, 18 Jan 2019 21:32:22 +0000 (16:32 -0500)]
conf: net: Rename 'model' to 'modelstr'

We will be adding a 'model' enum in upcoming patches. Rename
the existing value to make the differentiation clear

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agoconf: net: Add wrapper functions for <model> value
Cole Robinson [Thu, 17 Jan 2019 22:06:28 +0000 (17:06 -0500)]
conf: net: Add wrapper functions for <model> value

To ease converting the net->model value to an enum, add
the wrapper functions:

virDomainNetGetModelString
virDomainNetSetModelString
virDomainNetStreqModelString
virDomainNetStrcaseeqModelString

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: Add several net model passthrough tests
Cole Robinson [Fri, 18 Jan 2019 20:46:56 +0000 (15:46 -0500)]
tests: Add several net model passthrough tests

Examples of passing unknown strings through <interface>
<model type=X/>

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Convert aarch64-os-firmware-efi to TEST_CAPS
Cole Robinson [Mon, 15 Apr 2019 22:53:55 +0000 (18:53 -0400)]
tests: qemuxml2xml: Convert aarch64-os-firmware-efi to TEST_CAPS

Demostrate DO_TEST_CAPS_ARCH_LATEST by converting the test case
'aarch64-os-firmware-efi'

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Convert genid* to TEST_CAPS
Cole Robinson [Mon, 15 Apr 2019 23:00:46 +0000 (19:00 -0400)]
tests: qemuxml2xml: Convert genid* to TEST_CAPS

Convert these test cases to use DO_TEST_CAPS_LATEST

* genid
* genid-auto

This ensures the test infrastructure is working as expected for
a test case with explicit -active and -inactive XML test data

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Convert os-firmware* to TEST_CAPS
Cole Robinson [Mon, 15 Apr 2019 22:51:11 +0000 (18:51 -0400)]
tests: qemuxml2xml: Convert os-firmware* to TEST_CAPS

Convert these test cases to use DO_TEST_CAPS_LATEST

* os-firmware-bios
* os-firmware-efi
* os-firmware-efi-secboot

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Convert virtio-*transitional to TEST_CAPS
Cole Robinson [Mon, 15 Apr 2019 22:46:44 +0000 (18:46 -0400)]
tests: qemuxml2xml: Convert virtio-*transitional to TEST_CAPS

Convert these test cases to use DO_TEST_CAPS_LATEST

* virtio-transitional
* virtio-non-transitional

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Add DO_TEST_CAPS*
Cole Robinson [Mon, 15 Apr 2019 22:43:32 +0000 (18:43 -0400)]
tests: qemuxml2xml: Add DO_TEST_CAPS*

Add DO_TEST_CAPS* macros, lifted from qemuxml2argvtest.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agotests: qemuxml2xml: Set name in testQemuInfo
Cole Robinson [Mon, 15 Apr 2019 22:19:19 +0000 (18:19 -0400)]
tests: qemuxml2xml: Set name in testQemuInfo

Use the same pattern that is used in qemuxml2argvtest, setting the
name in a static testQemuInfo instance inside the test macros

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
6 years agonetwork: use virNetDevTapReattachBridge API
Daniel P. Berrangé [Fri, 1 Feb 2019 13:46:33 +0000 (13:46 +0000)]
network: use virNetDevTapReattachBridge API

Switch over to use the new API for re-attaching the bridge device

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoutil: add helper method for re-attaching a tap device to a bridge
Daniel P. Berrangé [Fri, 1 Feb 2019 12:39:25 +0000 (12:39 +0000)]
util: add helper method for re-attaching a tap device to a bridge

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: add missing bandwidth limits for bridge forward type
Daniel P. Berrangé [Tue, 20 Nov 2018 11:30:05 +0000 (11:30 +0000)]
network: add missing bandwidth limits for bridge forward type

In the case of a network with forward=bridge, which has a bridge device
listed, we are capable of setting bandwidth limits but fail to call the
function to register them.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoconf: simplify link from hostdev back to network device
Daniel P. Berrangé [Thu, 26 Jul 2018 16:24:30 +0000 (17:24 +0100)]
conf: simplify link from hostdev back to network device

hostdevs have a link back to the original network device. This is fairly
generic accepting any type of device, however, we don't intend to make
use of this approach in future. It can thus be specialized to network
devices.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: drop back compat code loading actual bridge name
Daniel P. Berrangé [Tue, 2 Apr 2019 17:18:40 +0000 (18:18 +0100)]
network: drop back compat code loading actual bridge name

The actual network def was updated to save the bridge name back
in 1.2.11:

  commit a3609121799d44898a3e0d0bf92b755e55e7b418
  Author: Laine Stump <laine@laine.org>
  Date:   Fri Nov 21 12:20:37 2014 -0500

    network: save bridge name in ActualNetDef when actualType==network too

The chance that someone is running libvirt < 1.2.11 and wants
todo a live upgrade to 5.3.0 without a host reboot is essentially
zero. We can thus reasonably drop the back compat code now.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: pass a virNetworkPtr to port management APIs
Daniel P. Berrangé [Thu, 26 Jul 2018 14:32:04 +0000 (15:32 +0100)]
network: pass a virNetworkPtr to port management APIs

The APIs for allocating/notifying/removing network ports just take
an internal domain interface struct right now. As a step towards
turning these into public facing APIs, add a virNetworkPtr argument
to all of them.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: restrict usage of port management APIs
Daniel P. Berrangé [Thu, 26 Jul 2018 10:37:32 +0000 (11:37 +0100)]
network: restrict usage of port management APIs

The port allocation APIs are currently called unconditionally for all
types of NIC, but (mostly) only do anything for NICs with type=network.

The exception is the port allocate API which does some validation even
for NICs with type!=network. Relying on this validation is flawed,
however, since the network driver may not even be installed. IOW virt
drivers must not delegate validation to the network driver for NICs
with type != network.

This change allows us to report errors when the virtual network driver
is not registered.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agodocs: Add emulatorsched support to news.xml
Martin Kletzander [Mon, 15 Apr 2019 12:41:44 +0000 (14:41 +0200)]
docs: Add emulatorsched support to news.xml

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Add support for emulatorsched
Martin Kletzander [Mon, 15 Apr 2019 11:13:06 +0000 (13:13 +0200)]
qemu: Add support for emulatorsched

This helps in a scenarios where vCPUs run with a priority that is so high they
might starve the emulator thread.  And it also fits with the rest of the
settings.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Add support for emulatorsched
Martin Kletzander [Mon, 15 Apr 2019 08:45:38 +0000 (10:45 +0200)]
conf: Add support for emulatorsched

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agodocs: Mention iothreadsched element in the docs and reword
Martin Kletzander [Mon, 15 Apr 2019 11:17:41 +0000 (13:17 +0200)]
docs: Mention iothreadsched element in the docs and reword

Just one missing occurrence of iothreadsched fixed plus some rewording for this
to make more sense for the readers.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Format thread IDs optionally
Martin Kletzander [Mon, 15 Apr 2019 08:48:07 +0000 (10:48 +0200)]
conf: Format thread IDs optionally

This will be used later when we want to format emulator scheduler parameters
which don't apply for multiple threads.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Parse common scheduler attributes in separate function
Martin Kletzander [Mon, 15 Apr 2019 08:56:03 +0000 (10:56 +0200)]
conf: Parse common scheduler attributes in separate function

This will become useful later when parsing emulatorsched parameters which don't
need the rest of the current function.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: do not set wait:false for client sockets
Marc-André Lureau [Mon, 15 Apr 2019 16:51:48 +0000 (18:51 +0200)]
qemu: do not set wait:false for client sockets

Qemu commit 767abe7 ("chardev: forbid 'wait' option with client
sockets") effectively deprecates usage of "wait" with client sockets
starting with qemu 4.0, and earlier versions ignored the value.

Cc: Daniel P. Berrangé <berrange@redhat.com>
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>
6 years agonews: cleanup in virNetTLSContextNew
Adrian Brzezinski [Mon, 15 Apr 2019 18:29:43 +0000 (20:29 +0200)]
news: cleanup in virNetTLSContextNew

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Adrian Brzezinski <redhat@adrb.pl>
6 years agorpc: cleanup in virNetTLSContextNew
Adrian Brzezinski [Mon, 15 Apr 2019 18:29:42 +0000 (20:29 +0200)]
rpc: cleanup in virNetTLSContextNew

Failed new gnutls context allocations in virNetTLSContextNew function
results in double free and segfault. Occasional memory leaks may also
occur.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Adrian Brzezinski <redhat@adrb.pl>
6 years agonews: Document firmware autoselection exposure in domcaps
Michal Privoznik [Wed, 10 Apr 2019 12:31:33 +0000 (14:31 +0200)]
news: Document firmware autoselection exposure in domcaps

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
6 years agovirSecurityDACRestoreChardevLabel: Restore UNIX sockets too
Michal Privoznik [Mon, 15 Apr 2019 15:16:39 +0000 (17:16 +0200)]
virSecurityDACRestoreChardevLabel: Restore UNIX sockets too

We're setting seclabels on unix sockets but never restoring them.
Surprisingly, we are doing so in SELinux driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agodocs: document firmware attribute for VMware guests
Pino Toscano [Tue, 9 Apr 2019 14:04:33 +0000 (16:04 +0200)]
docs: document firmware attribute for VMware guests

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
6 years agovmx: write firmware back from autoselection
Pino Toscano [Tue, 9 Apr 2019 14:04:32 +0000 (16:04 +0200)]
vmx: write firmware back from autoselection

When writing the VMX file from the domain XML, write the firmware key
according to the firmware autoselection.  Though, at the moment only
'efi' is supported.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
6 years agovmx: convert firmware config for autoselection
Pino Toscano [Tue, 9 Apr 2019 14:04:31 +0000 (16:04 +0200)]
vmx: convert firmware config for autoselection

Convert the firmware key to a type of autoselected firmware.

Only the 'efi' firmware is allowed for now, in case the key is present.
It seems VMware (at least ESXi) does not write the key in VMX files when
setting BIOS as firmware.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
6 years agonetwork: only reload firewall after firewalld is finished restarting
Laine Stump [Fri, 12 Apr 2019 15:23:02 +0000 (11:23 -0400)]
network: only reload firewall after firewalld is finished restarting

The network driver used to reload the firewall rules whenever a dbus
NameOwnerChanged message for org.fedoraproject.FirewallD1 was
received. Presumably at some point in the past this was successful at
reloading our rules after a firewalld restart. Recently though I
noticed that once firewalld was restarted, libvirt's logs would get this
message:

  The name org.fedoraproject.FirewallD1 was not provided by any .service files

After this point, no networks could be started until libvirtd itself
was restarted.

The problem is that the NameOwnerChanged message is sent twice during
a firewalld restart - once when the old firewalld is stopped, and
again when the new firewalld is started. If we try to reload at the
point the old firewalld is stopped, none of the firewalld dbus calls
will succeed.

The solution is to check the new_owner field of the message - we
should reload our firewall rules only if new_owner is non-empty (it is
set to "" when firewalld is stopped, and some sort of epoch number
when it is again started).

Signed-off-by: Laine Stump <laine@laine.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoutil: eliminate duplicate function virDBusMessageRead
Laine Stump [Fri, 12 Apr 2019 16:58:01 +0000 (12:58 -0400)]
util: eliminate duplicate function virDBusMessageRead

When virDBusMessageRead() and virDBusMessageDecode were first added in
commit 834c9c94, they were identical except that virDBusMessageRead()
would unref the message after decoding it.

This difference was eliminated later in commit dc7f3ffc after it
became apparent that unref-ing the message so soon was never the right
thing to do. The two identical functions remained though, with the
tests and virDBus library itself calling the Decode variant, and all
other users calling the Read variant.

This patch eliminates the duplication, switching all users to
virDBusMessageDecode (and moving the nice API documentation comment
from the Read function up to the Decode function).

Signed-off-by: Laine Stump <laine@laine.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.3.4
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.3.4

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.3
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.3

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.2.20
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.2.20

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.2
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.2

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.1
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.1

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop C API definition for release 4.0
Daniel P. Berrangé [Fri, 12 Apr 2019 10:54:26 +0000 (11:54 +0100)]
vbox: drop C API definition for release 4.0

Support for compiling this version was dropped in an earlier commit.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agovbox: drop support for VirtualBox 4.x releases
Daniel P. Berrangé [Fri, 12 Apr 2019 10:51:09 +0000 (11:51 +0100)]
vbox: drop support for VirtualBox 4.x releases

Support for all the 4.x releases was ended by VirtualBox maintainers in
Dec 2015. Even the "newest" 4.3.40 of those is only supported on old
versions of Linux (Ubuntu <= 13.03, RHEL <= 6, SLES <= 11), which are all
discontinued hosts from libvirt's POV.

We can thus reasonably drop all 4.x support from the libvirt VirtualBox
driver.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonetwork: clear cached error if we successfully create firewall chains
Daniel P. Berrangé [Fri, 12 Apr 2019 15:53:50 +0000 (16:53 +0100)]
network: clear cached error if we successfully create firewall chains

Since:

  commit 9f4e35dc73ec9e940aa61bc7c140c2b800218ef3
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Mon Mar 18 17:31:21 2019 +0000

    network: improve error report when firewall chain creation fails

We cache an error when failing to create the top level firewall chains.
This commit failed to account for fact that we may invoke
networkPreReloadFirewallRules() many times while libvirtd is running.
For example when firewalld is restarted.

When this happens the original failure may no longer occurr and we'll
successfully create our top level chains. We failed to clear the cached
error resulting in us failing to start virtual networks.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agotools: Reduce table width in virsh(1)
Andrea Bolognani [Fri, 12 Apr 2019 11:37:21 +0000 (13:37 +0200)]
tools: Reduce table width in virsh(1)

The table included in the sample output for 'list --title' is
unnecessarily wide, which causes man to complain:

  warning [p 8, 0.5i]: can't break line

Make the table narrower.

Spotted by Lintian (manpage-has-errors-from-man tag).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotools: Fix grammar
Andrea Bolognani [Fri, 12 Apr 2019 11:16:20 +0000 (13:16 +0200)]
tools: Fix grammar

Apparently "allow(s) to frobnicate" is not correct English, and
either "allow(s) one to frobnicate" or "allow(s) frobnicating"
should be used instead.

Spotted by Lintian (spelling-error-in-{binary,manpage} tags).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
6 years agoutil: Fix NAME section for virkey{code,name}-*
Andrea Bolognani [Mon, 15 Apr 2019 13:10:06 +0000 (15:10 +0200)]
util: Fix NAME section for virkey{code,name}-*

Spotted by Lintian (manpage-has-bad-whatis-entry tag).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 years agokeycodemapdb: Update submodule
Andrea Bolognani [Mon, 15 Apr 2019 12:48:26 +0000 (14:48 +0200)]
keycodemapdb: Update submodule

We need commit 6280c94f306d in order to fix our generated
man pages.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoDon't hardcode list of git submodules
Andrea Bolognani [Mon, 15 Apr 2019 12:43:44 +0000 (14:43 +0200)]
Don't hardcode list of git submodules

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoqemu: Don't cache microcode version
Jiri Denemark [Fri, 12 Apr 2019 19:21:05 +0000 (21:21 +0200)]
qemu: Don't cache microcode version

My earlier commit be46f61326 was incomplete. It removed caching of
microcode version in the CPU driver, which means the capabilities XML
will see the correct microcode version. But it is also cached in the
QEMU capabilities cache where it is used to detect whether we need to
reprobe QEMU. By missing the second place, the original commit
be46f61326 made the situation even worse since libvirt would report
correct microcode version while still using the old host CPU model
(visible in domain capabilities XML).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoDelete QEMU_CAPS_KQEMU and QEMU_CAPS_ENABLE_KQEMU
Ján Tomko [Wed, 3 Apr 2019 07:13:21 +0000 (09:13 +0200)]
Delete QEMU_CAPS_KQEMU and QEMU_CAPS_ENABLE_KQEMU

Support for kqemu was dropped in libvirt by commit 8e91a400c and even
back then we never set these capabilities when doing QMP probing.

Since no QEMU we aim to support has these, drop them completely.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoexamples: Initialize @pos in domtop.c
Martin Kletzander [Mon, 15 Apr 2019 09:19:31 +0000 (11:19 +0200)]
examples: Initialize @pos in domtop.c

This is a zero-cost workaround for a bug in GCC 8.3.0 which causes the
compilation to fail, because the compiler thinks that the value might be used
uninitialized even though it clearly cannot be.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoFix spelling for macOS
Andrea Bolognani [Tue, 2 Apr 2019 09:04:46 +0000 (11:04 +0200)]
Fix spelling for macOS

Though it used to be called "Mac OS X" and "OS X" in the past,
it was never "MacOS X" nor "OS-X", and it's just "macOS" now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
6 years agonews: Drop empty sections
Andrea Bolognani [Mon, 1 Apr 2019 09:53:16 +0000 (11:53 +0200)]
news: Drop empty sections

We have occasionally failed to document certain categories
of changes in the release notes, yet still left the
corresponding sections in the file even though they were
completely empty.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>