John Ferlan [Fri, 24 Jun 2016 14:16:18 +0000 (10:16 -0400)]
docs: Fix whitespace in output
Many moons ago, commit id '8d7800a55' adjusted the format of the output
to add a space on the HEADER and the DATA... the docs weren't updated to
reflect that... This makes that adjustment.
qemu: Check for VFIO too where legacy passthrough is checked
On PPC the legacy passthrough is not supported and only
VFIO is supported. So, the checks at places to confirm if the
host is passthrough capable checks only legacy, fix it. This
is seen at only one place now.
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Andrea Bolognani [Thu, 23 Jun 2016 08:24:43 +0000 (10:24 +0200)]
qemu: Use stricter checks in virQEMUCapsFillDomainDeviceDiskCaps()
Unfortunately, we can't just call qemuDomainMachineIsPSeries()
here, because we don't have a virDomainDef instance; that said,
the open-coded check should match said function as closely as
possible.
It changed the default format of socket address from the one SASL
requires, but did not adjust all the callers.
It also removed the test coverage for it.
Revert most of the changes except the virSocketAddrFormatFull support
for URI-formatted strings.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1345743 while
reverting the format used by virt-admin's client-info command from
the URI one to the SASL one.
Ján Tomko [Tue, 21 Jun 2016 15:29:47 +0000 (17:29 +0200)]
Do not ignore hidden files in /sys and /proc
The directories we iterate over are unlikely to contain any entries
starting with a dot, other than '.' and '..' which is already skipped
by virDirRead.
Peter Krempa [Thu, 23 Jun 2016 13:22:06 +0000 (15:22 +0200)]
tests: utils: Fail XML file comparison if input file doesn't exist
In cases where we expect parse failure of the test input file the
testsuite can't differentiate if the parser failed when parsing or when
opening the file. Add a call to virFileExists and error out on missing
input files.
Missing output files are partially expected when regenerating test
output.
John Ferlan [Sat, 28 May 2016 12:43:23 +0000 (08:43 -0400)]
secret: Move virStorageSecretType and rename
Move the enum into a new src/util/virsecret.h, rename it to be
virSecretLookupType. Add a src/util/virsecret.h in order to perform
a couple of simple operations on the secret XML and virSecretLookupTypeDef
for clearing and copying.
This includes quite a bit of collateral damage, but the goal is to remove
the "virStorage*" and replace with the virSecretLookupType so that it's
easier to to add new lookups that aren't necessarily storage pool related.
Cole Robinson [Thu, 23 Jun 2016 00:28:09 +0000 (20:28 -0400)]
storage: Remove redundant refreshPool check
Every driver provides a refreshPool impl, and many other critical
places in the code unconditionally call it without checking if
it exists, so this check is pointless
qemu: make monitor command API available during async jobs
One can not issue monitor commands manually during async calls thru
designated API while this could be useful for testing/debugging purposes.
qemuDomainQemuMonitorCommand uses job of type QEMU_JOB_MODIFY and any async
call disable parallel execution of this type of job. The only state that is
changed is taint variable. AFAIU the only place we can mess is resetting
taint flag in qemuProcessStop routine under some async job. But this can not
happen thanx to both virDomainObjIsActive check in qemuDomainQemuMonitorCommand
and resetting active status in qemuProcessStop before taint flag.
Change job type to QEMU_JOB_QUERY and thus make the API call available for
most of async jobs.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Cole Robinson [Wed, 22 Jun 2016 18:07:03 +0000 (14:07 -0400)]
conf: Remove dead console compat formatting
This code was attempting to handle some implicit <console> XML
formatting for manually assembled DomainDef, since previously the
console<->serial compat copying was only done at XML parse time.
Nowadays it's done via virDomainDefPostParse ->
virDomainDefAddConsoleCompat, which all manual DomainDef builders
already call, so we can drop this workaround.
Jim Fehlig [Wed, 22 Jun 2016 02:25:23 +0000 (20:25 -0600)]
libxl: use serial device for console when targetType is serial
When domXML contains only <console type='pty'> and no corresponding
<serial>, the console is "stolen" [1] and used as the first <serial>
device. When this "stolen" console is accessed from the libxl driver
(in libxlConsoleCallback and libxlDomainOpenConsole), check if the
targetType is VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL, and use the
"stolen" device in def->serials[0] instead. Prior to this change,
creating a domain with input XML containing only a <console> device
and subsequently attempting to access its console with
'virsh console' would fail
error: internal error: character device <null> is not using a PTY
[1] See comments associated with virDomainDefAddConsoleCompat() in
$LIBVIRT-SRC/src/conf/domain_conf.c:
Jiri Denemark [Mon, 20 Jun 2016 13:47:46 +0000 (15:47 +0200)]
qemu: Rename qemuMonitorMigrationCompression
qemuMonitorMigrationParams is a better name for a structure which
contains various migration parameters. While doing that, we should use
full names for individual parameters.
Peter Krempa [Mon, 20 Jun 2016 08:56:36 +0000 (10:56 +0200)]
qemu: Implement virDomainGetGuestVcpus
Allow gathering available vcpu ids, their state and offlinability via
the qemu guest agent. The maximum id was chosen arbitrarily and ought
to be enough for everybody.
Peter Krempa [Mon, 20 Jun 2016 12:15:50 +0000 (14:15 +0200)]
qemu: agent: Make setting of vcpus more robust
Documentation for the "guest-set-vcpus" command describes a proper
algorithm how to set vcpus. This patch makes the following changes:
- state of cpus that has not changed is not updated
- if the command was partially successful the command is re-tried with
the rest of the arguments to get a proper error message
- code is more robust against malicious guest agent
- fix testsuite to the new semantics
Peter Krempa [Thu, 16 Jun 2016 17:15:45 +0000 (19:15 +0200)]
lib: Add API to query guest vcpu info using guest agent
Add a rather universal API implemented via typed params that will allow
to query the guest agent for the state and possibly other aspects of
guest vcpus.
Peter Krempa [Sun, 19 Jun 2016 19:30:59 +0000 (21:30 +0200)]
rpcgen: Add support for generating funcs returning alloc'd typed params
Since it's rather tedious to write the dispatchers for functions that
return an array of typed parameters (which are rather common) let's add
some rpcgen code to generate them.
John Ferlan [Mon, 6 Jun 2016 12:57:38 +0000 (08:57 -0400)]
tests: Adjust tests for encrypted storage
Make them work again... The xml2xml had been working, but the xml2argv
were not working. Making the xml2argv work required a few adjustments to
the xml to update to more recent times.
John Ferlan [Tue, 31 May 2016 14:53:18 +0000 (10:53 -0400)]
storage: Adjust qemu-img switches check
Since we support QEMU 0.12 and later, checking for support of specific flags
added prior to that isn't necessary.
Thus start with the base of having the "-o options" available for the
qemu-img create option and then determine whether we have the compat
option for qcow2 files (which would be necessary up through qemu 2.0
where the default changes to compat 0.11).
Adjust test to no long check for NONE and FLAG options as well was removing
results of tests that would use that option.
Ján Tomko [Wed, 15 Jun 2016 12:18:17 +0000 (14:18 +0200)]
test-wrap-argv: add --check parameter
This script can already operate on a list of files.
Add a --check parameter to check if multiple files are wrapped
correctly with a single invocation of the script.
Ján Tomko [Mon, 30 May 2016 16:59:42 +0000 (18:59 +0200)]
test-wrap-argv: use map and join instead of a for cycle
We have a list of parameters in @args, that need to be rewrapped
and separated by a space and escaped newline: " \\\n", with the
exception of the last one, which only needs a newline.
Instead of a for cycle, rewrap the individual arguments using map,
and interleave them with escaped newlines by using join.