Commit Graph

3055 Commits

Author SHA1 Message Date
Peter Krempa
95f4328e33 tests: schema: Remove useless perf schema data
We have a test case that excercises the parser and formatter now which
takes part in schema checking so remove the schema-only test.
2016-06-17 12:51:08 +02:00
Jiri Denemark
5a9221b9af cpu_x86: Use signature in CPU detection code
Our current detection code uses just the number of CPU features which
need to be added/removed from the CPU model to fully describe the CPUID
data. The smallest number wins. But this may sometimes generate wrong
results as one can see from the fixed test cases. This patch modifies
the algorithm to prefer the CPU model with matching signature even if
this model results in a longer list of additional features.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-17 11:46:31 +02:00
Jiri Denemark
2f3ccdf01b cpu: Add Skylake-Client x86 CPU model
The CPU model was implemented in QEMU by commit f6f949e929.

The change to i7-5600U is wrong since it's a 5th generation CPU, i.e.,
Broadwell rather than Skylake, but that's just the result of our CPU
detection code (which is fixed by the following commit).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-17 11:40:58 +02:00
Peter Krempa
23690e1d74 conf: Fix perf event parser
The parser was totaly broken. Fix it by rewriting it. Add tests so that
it doesn't happen.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1346723
2016-06-17 09:35:14 +02:00
Laine Stump
d5fb8f4564 qemu: don't add pci-bridge to Q35/arm domains unless it's needed
Until now, a Q35 domain (or arm/virt, or any other domain that has a
pcie-root bus) would always have a pci-bridge added, so that there
would be a hotpluggable standard PCI slot available to plug in any PCI
devices that might be added. This patch removes the explicit add,
instead relying on the pci-bridge being auto-added during PCI address
assignment (it will add a pci-bridge if there are no free slots).

This doesn't eliminate the dmi-to-pci-bridge controller that is
explicitly added whether or not a standard PCI slot is required (and
that is almost never used as anything other than a converter between
pcie.0's PCIe slots and standard PCI). That will be done separately.
2016-06-16 13:48:25 -04:00
Jovanka Gulicoska
edc1a27a5a test: implement storage lifecycle event APIs
Also includes unittests for storage pool lifecycle events API
2016-06-16 12:22:11 -04:00
Ján Tomko
b918d76fd6 Rename virAssertCmpInt to testAssertEq
Drop the op parameter, we only use equality.
Drop the vir prefix since it's only used in the tests.
2016-06-15 15:07:47 +02:00
Chunyan Liu
6fcaf4a547 xlconfigtest: add test for USB config conversion
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-06-14 14:34:50 -06:00
John Ferlan
d2e14efb05 caps: Add capability for tls-x509-creds
Add the capability flag and checks for the qemu object 'tls-creds-x509'

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-06-14 08:41:45 -04:00
Jiri Denemark
4ece51ae21 cputest: Get rid of the array of test functions
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-14 09:18:48 +02:00
Martin Kletzander
6445ad488f qemu: Add support for zero-detection writes
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-06-14 08:25:25 +02:00
Martin Kletzander
d3c784999d conf: Add support of zero-detection for disks
This option allows or disallows detection of zero-writes if it is set to
"on" or "off", respectively.  It can be also set to "unmap" in which
case it will try discarding that part of image based on the value of the
"discard" option.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-06-14 08:25:25 +02:00
Martin Kletzander
716314358a Fix build without xen
Commit 11567cf66f introduced an include which will only work when
building with xen (particularly libxl).  However, that file is supposed
to be includable from anywhere (as with other testutils* files.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-06-14 08:25:25 +02:00
Jim Fehlig
53d98ccea7 xenconfig: support bios=ovmf xl.cfg
Add support to xenconfig for conversion of xl.cfg(5) bios config
to/from libvirt domXml <loader> config. SeaBIOS is the default
for HVM guests using upstream QEMU. ROMBIOS is the default when
using the old qemu-dm. This patch allows specifying OVMF as an
alternate firmware.

Example xl.cfg:
  bios = "ovmf"

Example domXML:
  <os>
    ...
    <loader readonly='yes' type='pflash'>/usr/lib/xen/boot/ovmf.bin</loader>
  </os>

Note that currently Xen does not support a separate nvram for
non-volatile variables.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-06-13 14:13:17 -06:00
Jim Fehlig
11567cf66f libxl: implement connectGetDomainCapabilities
Add domain capabilities for PV and HVM domains.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-06-13 14:13:17 -06:00
Jim Fehlig
fda5a98e9e driver config: Introduce virFirmware object
The virQEMUDriverConfig object contains lists of
loader:nvram pairs to advertise firmwares supported by
by the driver, and qemu_conf.c contains code to populate
the lists, all of which is useful for other drivers too.

To avoid code duplication, introduce a virFirmware object
to encapsulate firmware details and switch the qemu driver
to use it.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2016-06-13 14:13:16 -06:00
Wei Liu
148689ec96 tests: fix CPUID detection tests compilation failure
In 3704b9003 ("tests: Add CPU detection tests"), a macro called
DO_TEST_CPUID_JSON is added. But it took only two arguments when QEMU
or YAJL is not set.

Fix it by adding a third argument. Shouldn't have any effect because
that macro compiles to nothing.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2016-06-13 12:19:53 +02:00
Roman Bogorodskiy
de77d34ab1 bhyve: fix bhyvexml2arg test
Don't use duplicating target dev names.
2016-06-12 11:01:50 +03:00
Michal Privoznik
3668526fa6 qemuMonitorJSONAttachCharDev: Teach spicevmc
https://bugzilla.redhat.com/show_bug.cgi?id=1298070

We have the code for attaching redirdevs for ages now.
Unfortunately, our monitor code that handles talking to the qemu
process was missing a little piece of code that actually enabled
the feature.

BTW: it really is called "type" on the monitor, even though it's
called "name" on the cmd line. Don't ask.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-06-10 15:22:07 +02:00
Daniel P. Berrange
eaf18f4c2b nodeinfo: move host CPU APIs out into virhostcpu.c file
Move all APIs with a virHostCPU name prefix out into new
util/virhostcpu.h & util/virhostcpu.c files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-09 18:31:11 +01:00
Daniel P. Berrange
4053350bfe nodeinfo: rename all CPU APIs to have a virHostCPU prefix
In preparation for moving all the CPU related APIs out of
the nodeinfo file, give them a virHostCPU name prefix.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-09 18:08:15 +01:00
Daniel P. Berrange
bfb412a32e nodeinfo: split CPU info retrieval out of nodeGetInfo
Instead of having platform specific code in nodeGetInfo to
fetch CPU topology, split it all out into a new method
nodeGetCPUInfo.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-09 18:05:53 +01:00
Daniel P. Berrange
08ea852c25 nodeinfo: remove sysfs_prefix from all methods
Nearly all the methods in the nodeinfo file are given a
'const char *sysfs_prefix' parameter to override the
default sysfs path (/sys/devices/system). Every single
caller passes in NULL for this, except one use in the
unit tests. Furthermore this parameter is totally
Linux-specific, when the APIs are intended to be cross
platform portable.

This removes the sysfs_prefix parameter and instead gives
a new method linuxNodeInfoSetSysFSSystemPath for use by
the test suite.

For two of the methods this hardcodes use of the constant
SYSFS_SYSTEM_PATH, since the test suite does not need to
override the path for thos methods.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-09 18:00:18 +01:00
Pavel Hrdina
93a2fb230a vnc: add support for listen type none
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:46:45 +02:00
Pavel Hrdina
c34ada0996 spice: introduce listen type none
This new listen type is currently supported only by spice graphics.
It's introduced to make it easier and clearer specify to not listen
anywhere in order to start a guest with OpenGL support.

The old way to do this was set spice graphics autoport='no' and don't
specify any ports.  The new way is to use <listen type='none'/>.  In
order to be able to migrate to old libvirt the migratable XML will be
generated without the listen element and with autoport='no'.  Also the
old configuration will be automatically converted to the this listen
type.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:44:08 +02:00
Pavel Hrdina
ffac505639 spice: introduce spice_auto_unix_socket config option
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:43:39 +02:00
Pavel Hrdina
e0c309b2dc spice: add support for listen type socket
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1335832

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:43:15 +02:00
Pavel Hrdina
61a63abfe8 qemu_capabilites: add QEMU_CAPS_SPICE_UNIX
Add a new capability to detect support of unix sockets for spice
graphics.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:43:09 +02:00
Pavel Hrdina
acc83afe33 vnc: add support for listen type 'socket'
VNC graphics already supports sockets but only via 'socket' attribute.
This patch coverts that attribute into listen type 'socket'.

For backward compatibility we need to handle listen type 'socket' and 'socket'
attribute properly to support old XMLs and new XMLs.  If both are provided they
have to match, if only one of them is provided we need to be able to parse that
configuration too.

To not break migration back to old libvirt if the socket is provided by user we
need to generate migratable XML without the listen element and use only 'socket'
attribute.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-09 14:42:48 +02:00
Martin Kletzander
326e5941cd qemu: Generate channel target paths on hotplug as well
Since commit 7140807917, qemu agent
channel cannot be plugged in because we won't generate its path
automatically.  Let's not only fix that, but also add tests for it so
next time it's checked for.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-06-09 13:27:54 +02:00
Martin Kletzander
f371704708 qemuhotplugtest: Test live data
Until now, the only hot thing in this test was the name.  That's because
we set the id to '-1' before every test.  With this change, we test the
hotplug on live domains as the name suggests and as it should be.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-06-09 13:23:15 +02:00
Jiri Denemark
ee12b78189 cputest: Rename nehalem-force to penryn-force
The actual CPU model in the data files is Penryn which makes the file
name look rather strange. Well, one of them contains Nehalem, but that's
a bug which will be fixed soon.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 12:15:23 +02:00
Jiri Denemark
877c46d8a7 cpu: Add ARAT x86 CPU feature
Implemented in QEMU by commit 28b8e4d0bf93ba176b4b7be819d537383c5a9060.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 10:16:44 +02:00
Jiri Denemark
6dd5910da7 cpu: Add x86 feature flags for CPUID leaf 0xd, sub leaf 1
This was implemented in QEMU by commit 0bb0b2d2fe7f645dda.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 10:16:44 +02:00
Jiri Denemark
4c39a448e8 cpu: Sort CPU map features on eax_in
As a side effect this changes the order of CPU features in XMLs
generated by libvirt, but that's not a big deal since the order there is
insignificant.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 10:16:44 +02:00
Jiri Denemark
f0fd7ae122 cpu_x86: Prepare for ecx_in CPUID parameter
CPUID instruction normally takes its parameter from EAX, but sometimes
ECX is used as an additional parameter. This patch prepares the x86 CPU
driver code for the new 'ecx_in' CPUID parameter.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 10:03:38 +02:00
Jiri Denemark
7b7cc3aaec qemumonitorjsontest: Add getcpu test data
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:50:13 +02:00
Jiri Denemark
c57c2bb53a tests: Add CPU detection test for Intel Xeon X5460
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
3b5dac0d87 tests: Add CPU detection test for Intel Xeon W3520
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
37ae56687e tests: Add CPU detection test for Intel Xeon E7-4820
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
355163fb92 tests: Add CPU detection test for Intel Xeon E5-2650
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
5a58fcccaa tests: Add CPU detection test for Intel Xeon E5-2630
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
c2db8a66d5 tests: Add CPU detection test for Intel Xeon E3-1245
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
d139a2f7fc tests: Add CPU detection test for Intel Xeon 5110
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
40b54ebe14 tests: Add CPU detection test for AMD Phenom II X4 B95
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
f3ebce1466 tests: Add CPU detection test for Intel Pentium P6100
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
40ce319620 tests: Add CPU detection test for AMD Opteron 6282 SE
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
7608508c72 tests: Add CPU detection test for AMD Opteron 6234
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
29461bc019 tests: Add CPU detection test for AMD Opteron 2350
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00
Jiri Denemark
57fab4ff9e tests: Add CPU detection test for AMD Opteron 1352
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-06-09 09:47:56 +02:00