]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agonodeinfo: move host CPU APIs out into virhostcpu.c file
Daniel P. Berrange [Wed, 13 Apr 2016 17:53:02 +0000 (18:53 +0100)]
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>
8 years agonodeinfo: rename all CPU APIs to have a virHostCPU prefix
Daniel P. Berrange [Wed, 13 Apr 2016 17:16:16 +0000 (18:16 +0100)]
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>
8 years agonodeinfo: rename all memory APIs to have a virHostMem prefix
Daniel P. Berrange [Wed, 13 Apr 2016 17:16:16 +0000 (18:16 +0100)]
nodeinfo: rename all memory APIs to have a virHostMem prefix

In preparation for moving all the memory related APIs out of
the nodeinfo file, give them a virHostMem name prefix.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agonodeinfo: split CPU info retrieval out of nodeGetInfo
Daniel P. Berrange [Wed, 13 Apr 2016 16:45:22 +0000 (17:45 +0100)]
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>
8 years agonodeinfo: remove FreeBSD specific code for getting memory
Daniel P. Berrange [Wed, 27 Apr 2016 15:30:21 +0000 (16:30 +0100)]
nodeinfo: remove FreeBSD specific code for getting memory

The GNULIB physmem module already provides support for
the FreeBSD platform, so there's no reason to re-implement
FreeBSD portability code in libvirt. If there are bugs in
the GNULIB code, we should fix GNULIB rather than workaround
it in libvirt.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agonodeinfo: make nodeGetInfo() call nodeGetMemory for memory size
Daniel P. Berrange [Wed, 13 Apr 2016 16:28:10 +0000 (17:28 +0100)]
nodeinfo: make nodeGetInfo() call nodeGetMemory for memory size

The nodeGetInfo() method currently has its own code for getting
memory size in KB, that basically just re-invents what nodeGetMemory
already does. Remove it and just call nodeGetMemory, converting its
result from bytes to KB, allowing removal of more platform specific
conditional code.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agonodeinfo: remove sysfs_prefix from all methods
Daniel P. Berrange [Wed, 13 Apr 2016 14:28:55 +0000 (15:28 +0100)]
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>
8 years agoqemu: Yet another check for blkdeviotune values
Martin Kletzander [Tue, 7 Jun 2016 13:24:13 +0000 (15:24 +0200)]
qemu: Yet another check for blkdeviotune values

If you want to set block device I/O tuning values that end with '_max'
and there is nothing else set, libvirt emits an error.  In particular:

  error: internal error: Unexpected error

That's an unknown error.  That is because *_max values depend on their
respective non-_max values.  QEMU even says that in the error message
sent as a response to the monitor command:

  "error": {"class": "GenericError", "desc": "bps_max/iops_max require
  corresponding bps/iops values"}

the problem was that we didn't know that and there was no check for it.
Adding such check makes sure that there will be less confused users.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agovnc: add support for listen type none
Pavel Hrdina [Wed, 8 Jun 2016 13:15:54 +0000 (15:15 +0200)]
vnc: add support for listen type none

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agospice: introduce listen type none
Pavel Hrdina [Wed, 18 May 2016 06:33:28 +0000 (08:33 +0200)]
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>
8 years agospice: introduce spice_auto_unix_socket config option
Pavel Hrdina [Wed, 18 May 2016 12:11:20 +0000 (14:11 +0200)]
spice: introduce spice_auto_unix_socket config option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agospice: add support for listen type socket
Pavel Hrdina [Wed, 8 Jun 2016 13:18:59 +0000 (15:18 +0200)]
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>
8 years agoqemu_capabilites: add QEMU_CAPS_SPICE_UNIX
Pavel Hrdina [Tue, 7 Jun 2016 22:21:29 +0000 (00:21 +0200)]
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>
8 years agovnc: add support for listen type 'socket'
Pavel Hrdina [Wed, 8 Jun 2016 13:18:25 +0000 (15:18 +0200)]
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>
8 years agographics: introduce new listen type 'socket'
Pavel Hrdina [Wed, 8 Jun 2016 08:35:37 +0000 (10:35 +0200)]
graphics: introduce new listen type 'socket'

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agovnc: move generation of socket path to qemuProcessGraphicsSetupListen
Pavel Hrdina [Wed, 8 Jun 2016 11:30:20 +0000 (13:30 +0200)]
vnc: move generation of socket path to qemuProcessGraphicsSetupListen

This moves the socket generation if "vnc_auto_unix_socket" is set.

It also fixes a bug with this config option that we should auto-generate
socket path only if listen type is address and there is no address
specified.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agovnc: rename socketAutogenerated to socketFromConfig
Pavel Hrdina [Wed, 8 Jun 2016 11:24:52 +0000 (13:24 +0200)]
vnc: rename socketAutogenerated to socketFromConfig

Even though it's auto-generated it's based on qemu.conf option and listen type
address already uses "fromConfig" to carry this information.  Following commits
will convert the socket to listen element so this rename is required because
there will be also an option to get socket auto-generated independently on the
qemu.conf option.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemu_command: move websocket code into else part for address listen
Pavel Hrdina [Tue, 7 Jun 2016 22:14:24 +0000 (00:14 +0200)]
qemu_command: move websocket code into else part for address listen

There is no need to check again for vnc socket.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemu: Generate channel target paths on hotplug as well
Martin Kletzander [Wed, 30 Mar 2016 14:43:28 +0000 (16:43 +0200)]
qemu: Generate channel target paths on hotplug as well

Since commit 714080791778e3dfbd484ccb3953bffd820b8ba9, 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>
8 years agoqemuhotplugtest: Test live data
Martin Kletzander [Wed, 30 Mar 2016 07:01:11 +0000 (09:01 +0200)]
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>
8 years agoqemu: Move channel path generation out of command creation
Martin Kletzander [Wed, 30 Mar 2016 14:34:17 +0000 (16:34 +0200)]
qemu: Move channel path generation out of command creation

Put it into separate function called qemuDomainPrepareChannel() and call
it from the new qemuProcessPrepareDomain().

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agocputest: Rename nehalem-force to penryn-force
Jiri Denemark [Thu, 2 Jun 2016 08:17:22 +0000 (10:17 +0200)]
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>
8 years agocpu: Add ARAT x86 CPU feature
Jiri Denemark [Wed, 1 Jun 2016 13:50:32 +0000 (15:50 +0200)]
cpu: Add ARAT x86 CPU feature

Implemented in QEMU by commit 28b8e4d0bf93ba176b4b7be819d537383c5a9060.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Add x86 feature flags for CPUID leaf 0xd, sub leaf 1
Jiri Denemark [Mon, 23 May 2016 15:57:39 +0000 (17:57 +0200)]
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>
8 years agocpu: Sort CPU map features on eax_in
Jiri Denemark [Wed, 1 Jun 2016 13:40:09 +0000 (15:40 +0200)]
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>
8 years agocpu: Shorten eax_in values in CPU map
Jiri Denemark [Wed, 1 Jun 2016 13:38:09 +0000 (15:38 +0200)]
cpu: Shorten eax_in values in CPU map

For two reasons:
- 0x00000001 is very similar to 0x80000001, but 0x01 is visually
  different
- 0x01 format is consistent with CPUID manual

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Add full support for ecx_in CPUID parameter
Jiri Denemark [Mon, 23 May 2016 15:45:40 +0000 (17:45 +0200)]
cpu_x86: Add full support for ecx_in CPUID parameter

This patch makes our CPUID handling code up-to-date with the current
specification found in

Intel® 64 and IA-32 Architectures Developer's Manual: Vol. 2A
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Prepare for ecx_in CPUID parameter
Jiri Denemark [Fri, 20 May 2016 08:59:13 +0000 (10:59 +0200)]
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>
8 years agoqemumonitorjsontest: Add getcpu test data
Jiri Denemark [Fri, 20 May 2016 09:17:11 +0000 (11:17 +0200)]
qemumonitorjsontest: Add getcpu test data

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon X5460
Jiri Denemark [Wed, 1 Jun 2016 15:52:56 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon X5460

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon W3520
Jiri Denemark [Wed, 1 Jun 2016 15:52:55 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon W3520

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon E7-4820
Jiri Denemark [Wed, 1 Jun 2016 15:52:55 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon E7-4820

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon E5-2650
Jiri Denemark [Wed, 1 Jun 2016 15:52:55 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon E5-2650

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon E5-2630
Jiri Denemark [Wed, 1 Jun 2016 15:52:55 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon E5-2630

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon E3-1245
Jiri Denemark [Wed, 1 Jun 2016 15:52:55 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon E3-1245

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Xeon 5110
Jiri Denemark [Wed, 1 Jun 2016 15:52:54 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Xeon 5110

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD Phenom II X4 B95
Jiri Denemark [Wed, 1 Jun 2016 15:52:54 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD Phenom II X4 B95

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Pentium P6100
Jiri Denemark [Wed, 1 Jun 2016 15:52:54 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Pentium P6100

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD Opteron 6282 SE
Jiri Denemark [Wed, 1 Jun 2016 15:52:54 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD Opteron 6282 SE

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD Opteron 6234
Jiri Denemark [Wed, 1 Jun 2016 15:52:54 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD Opteron 6234

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD Opteron 2350
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD Opteron 2350

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD Opteron 1352
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD Opteron 1352

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD FX 8150
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for AMD FX 8150

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core2 Quad Q9500
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core2 Quad Q9500

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core2 Duo E6850
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core2 Duo E6850

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-5600U
Jiri Denemark [Wed, 1 Jun 2016 15:52:53 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-5600U

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-4600U
Jiri Denemark [Wed, 1 Jun 2016 15:52:52 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-4600U

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-3770
Jiri Denemark [Wed, 1 Jun 2016 15:52:52 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-3770

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-3740QM
Jiri Denemark [Wed, 1 Jun 2016 15:52:52 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-3740QM

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-3520M
Jiri Denemark [Wed, 1 Jun 2016 15:52:52 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-3520M

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i7-2600
Jiri Denemark [Wed, 1 Jun 2016 15:52:52 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i7-2600

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i5-6600
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i5-6600

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i5-4670T
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i5-4670T

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i5-2540M
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i5-2540M

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Core i5-2500
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Core i5-2500

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Atom N450
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Atom N450

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for Intel Atom D510
Jiri Denemark [Wed, 1 Jun 2016 15:52:51 +0000 (17:52 +0200)]
tests: Add CPU detection test for Intel Atom D510

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection test for AMD A10-5800K
Jiri Denemark [Mon, 6 Jun 2016 12:43:07 +0000 (14:43 +0200)]
tests: Add CPU detection test for AMD A10-5800K

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Add CPU detection tests
Jiri Denemark [Wed, 1 Jun 2016 13:57:00 +0000 (15:57 +0200)]
tests: Add CPU detection tests

So far we only test CPUID -> CPU def conversion on artificial CPUID data
computed from another CPU def. This patch adds the infrastructure to
test this conversion on real data gathered from a host CPU and two
helper scripts for adding new test data:

- cpu-gather.sh runs cpuid tool and qemu-system-x86_64 to get CPUID data
  from the host CPU; this is what users can be asked to run if they run
  into an issue with host CPU detection in libvirt

- cpu-parse.sh takes the data generated by cpu-gather.sh and creates
  data files for CPU detection tests

The CPUID data queried from QEMU will eventually switch to the format
used by query-host-cpu QMP command once QEMU implements it. Until then
we just spawn QEMU with -cpu host and query the guest CPU in QOM. They
should both provide the same CPUID results, but query-host-cpu does not
require any guest CPU to be created by QEMU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Refactor internal KVM features
Jiri Denemark [Tue, 7 Jun 2016 10:09:41 +0000 (12:09 +0200)]
cpu_x86: Refactor internal KVM features

The internal features are only used in explicit checks with
cpuHasFeature. Loading them into the CPU map is dangerous since the
features may accidentally be reported to users when decoding CPUID data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_ppc64: Avoid unnecessary pointer to virCPUppc64Data
Jiri Denemark [Tue, 7 Jun 2016 10:04:13 +0000 (12:04 +0200)]
cpu_ppc64: Avoid unnecessary pointer to virCPUppc64Data

virCPUData and struct ppc64_model structures contained a pointer to
virCPUppc64Data, which was not very nice since the real data were
accessible by yet another level of pointers from virCPUppc64Data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Avoid unnecessary pointers to virCPUx86Data
Jiri Denemark [Tue, 7 Jun 2016 07:38:53 +0000 (09:38 +0200)]
cpu_x86: Avoid unnecessary pointers to virCPUx86Data

virCPUData, virCPUx86Feature, and virCPUx86Model all contained a pointer
to virCPUx86Data, which was not very nice since the real CPUID data were
accessible by yet another pointer from virCPUx86Data. Moreover, using
virCPUx86Data directly will make static definitions of internal CPU
features a bit easier.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Create simple monitor in qemuMonitorTestNewFromFile
Jiri Denemark [Mon, 6 Jun 2016 14:55:05 +0000 (16:55 +0200)]
tests: Create simple monitor in qemuMonitorTestNewFromFile

The current version uses the first JSON reply from the file as monitor
greeting. With the new parameter the caller can now request a simple
test monitor to be created, which uses an artificial greeting and uses
all JSON strings from the file as regular replies.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Fix "Reponse" typo
Jiri Denemark [Tue, 7 Jun 2016 11:46:01 +0000 (13:46 +0200)]
tests: Fix "Reponse" typo

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotests: Introduce qemuMonitorTestNewFromFile
Jiri Denemark [Mon, 6 Jun 2016 11:46:41 +0000 (13:46 +0200)]
tests: Introduce qemuMonitorTestNewFromFile

It's a convenient wrapper around qemuMonitorTestNew which feeds the test
monitor with QMP replies from a specified file.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Refactor qemuMonitorJSONGetCPUx86Data
Jiri Denemark [Fri, 3 Jun 2016 14:59:59 +0000 (16:59 +0200)]
qemu: Refactor qemuMonitorJSONGetCPUx86Data

This patch splits qemuMonitorJSONGetCPUx86Data in three functions:

- qemuMonitorJSONCheckCPUx86 checks if QEMU supports reporting CPUID
  features for a guest CPU

- qemuMonitorJSONParseCPUx86Features parses CPUID features from a JSON
  array

- qemuMonitorJSONGetCPUx86Data gets the requested guest CPU property
  from QOM and uses qemuMonitorJSONParseCPUx86Features to parse it

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Rename CPUID function to eax_in
Jiri Denemark [Fri, 20 May 2016 07:48:21 +0000 (09:48 +0200)]
cpu_x86: Rename CPUID function to eax_in

CPUID instruction normally takes its parameter from EAX, but sometimes
ECX is used as an additional parameter. Let's rename 'function' to
'eax_in' in preparation for adding 'ecx_in'.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Detect arch when parsing CPU data
Jiri Denemark [Mon, 29 Jun 2015 09:08:30 +0000 (11:08 +0200)]
cpu: Detect arch when parsing CPU data

A CPU data XML file already contains the architecture, let the parser
use it to detect which CPU driver should be used to parse the rest of
the file.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Fix CPU data parser
Jiri Denemark [Mon, 29 Jun 2015 09:07:25 +0000 (11:07 +0200)]
cpu_x86: Fix CPU data parser

The formatter uses /cpudata/cpuid elements and the parser should really
do the same.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu_x86: Propagate vendor to guest's virCPUData
Jiri Denemark [Wed, 1 Jun 2016 08:55:36 +0000 (10:55 +0200)]
cpu_x86: Propagate vendor to guest's virCPUData

When computing CPU data for a given guest CPU we should set CPUID vendor
bits appropriately so that we don't lose the vendor when transforming
CPU data back to XML description.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agovirsh-domain: fix memory leak in cmdDomDisplay
Pavel Hrdina [Thu, 9 Jun 2016 07:05:35 +0000 (09:05 +0200)]
virsh-domain: fix memory leak in cmdDomDisplay

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoFix typo in virNetDevGetEthtoolGFeatures stub
Ján Tomko [Thu, 9 Jun 2016 06:35:32 +0000 (08:35 +0200)]
Fix typo in virNetDevGetEthtoolGFeatures stub

s/ATTRIBUGE/ATTRIBUTE/

Reported-by: Olaf Hering <olaf@aepfle.de>
8 years agotests: Rename virtTestMain to virTestMain. osstest/frozen/xen-4.7-testing
Tomáš Ryšavý [Thu, 26 May 2016 15:02:08 +0000 (17:02 +0200)]
tests: Rename virtTestMain to virTestMain.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestErrorFuncQuiet to virTestErrorFuncQuiet.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:07 +0000 (17:02 +0200)]
tests: Rename virtTestErrorFuncQuiet to virTestErrorFuncQuiet.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestCounterNext to virTestCounterNext.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:06 +0000 (17:02 +0200)]
tests: Rename virtTestCounterNext to virTestCounterNext.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestCaptureProgramOutput to virTestCaptureProgramOutput.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:05 +0000 (17:02 +0200)]
tests: Rename virtTestCaptureProgramOutput to virTestCaptureProgramOutput.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestDifferenceBin to virTestDifferenceBin.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:04 +0000 (17:02 +0200)]
tests: Rename virtTestDifferenceBin to virTestDifferenceBin.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestCaptureProgramExecChild to virTestCaptureProgramExecChild.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:03 +0000 (17:02 +0200)]
tests: Rename virtTestCaptureProgramExecChild to virTestCaptureProgramExecChild.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestDifferenceFullInternal to virTestDifferenceFullInternal.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:02 +0000 (17:02 +0200)]
tests: Rename virtTestDifferenceFullInternal to virTestDifferenceFullInternal.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestDifferenceFullNoRegenerate.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:01 +0000 (17:02 +0200)]
tests: Rename virtTestDifferenceFullNoRegenerate.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestQuiesceLibvirtErrors to virTestQuiesceLibvirtErrors.
Tomáš Ryšavý [Thu, 26 May 2016 15:02:00 +0000 (17:02 +0200)]
tests: Rename virtTestQuiesceLibvirtErrors to virTestQuiesceLibvirtErrors.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestUseTerminalColors to virTestUseTerminalColors.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:59 +0000 (17:01 +0200)]
tests: Rename virtTestUseTerminalColors to virTestUseTerminalColors.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestLogContentAndReset to virTestLogContentAndReset.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:58 +0000 (17:01 +0200)]
tests: Rename virtTestLogContentAndReset to virTestLogContentAndReset.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestCounterReset to virTestCounterReset.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:57 +0000 (17:01 +0200)]
tests: Rename virtTestCounterReset to virTestCounterReset.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTest00MActive to virTest00MActive.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:56 +0000 (17:01 +0200)]
tests: Rename virtTest00MActive to virTest00MActive.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestClearCommandPath to virTestClearCommandPath.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:55 +0000 (17:01 +0200)]
tests: Rename virtTestClearCommandPath to virTestClearCommandPath.

This function doesn't follow our convention of naming functions.

8 years agoRename virtTestDifferenceFull to virTestDifferenceFull.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:54 +0000 (17:01 +0200)]
Rename virtTestDifferenceFull to virTestDifferenceFull.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestCompareToFile to virTestCompareToFile.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:53 +0000 (17:01 +0200)]
tests: Rename virtTestCompareToFile to virTestCompareToFile.

This function doesn't follow our convention of naming functions.

8 years agoRename virtTestLoadFile to virTestLoadFile.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:52 +0000 (17:01 +0200)]
Rename virtTestLoadFile to virTestLoadFile.

This function doesn't follow our convention of naming functions.

8 years agoRename virtTestDifference to virTestDifference.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:51 +0000 (17:01 +0200)]
Rename virtTestDifference to virTestDifference.

This function doesn't follow our convention of naming functions.

8 years agotests: Rename virtTestRun to virTestRun.
Tomáš Ryšavý [Thu, 26 May 2016 15:01:50 +0000 (17:01 +0200)]
tests: Rename virtTestRun to virTestRun.

This function doesn't follow our convention of naming functions.

8 years agovirschematest: call va_end even on OOM
Ján Tomko [Wed, 8 Jun 2016 14:33:26 +0000 (16:33 +0200)]
virschematest: call va_end even on OOM

Jump to cleanup if virAsprintf fails.

8 years agonode_device: Replace VIR_ERROR with standard vir*Error in state driver init
Jovanka Gulicoska [Wed, 8 Jun 2016 13:20:27 +0000 (15:20 +0200)]
node_device: Replace VIR_ERROR with standard vir*Error in state driver init

8 years agovirsh-network: Avoid possible NULL deref in cmdNetworkDHCPLeases
Michal Privoznik [Wed, 8 Jun 2016 09:32:09 +0000 (11:32 +0200)]
virsh-network: Avoid possible NULL deref in cmdNetworkDHCPLeases

Problem is, localtime_r() returns a pointer to converted time or
NULL in case of an error. But checking the glibc sources, error
will occur iff a NULL has been passed as an either of arguments
the function takes. But GCC fails to see that:

../../tools/virsh-network.c: In function 'cmdNetworkDHCPLeases':
../../tools/virsh-network.c:1370:12: error: potential null pointer dereference [-Werror=null-dereference]
         ts = *localtime_r(&expirytime_tmp, &ts);
         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolxc: simplify lxcDomainGetBlkioParameters
Ján Tomko [Mon, 30 May 2016 13:33:29 +0000 (15:33 +0200)]
lxc: simplify lxcDomainGetBlkioParameters

Replace all the repetitive code by using
virDomainGetBlkioParametersAssignFromDef, similar to what commit 9f50f6e
did in the qemu driver.

8 years agoExport virDomainGetBlkioParametersAssignFromDef
Ján Tomko [Mon, 30 May 2016 13:15:23 +0000 (15:15 +0200)]
Export virDomainGetBlkioParametersAssignFromDef

Move qemuDomainGetBlkioParametersAssignFromDef into domain_conf
and export it, to allow reuse in the LXC driver.

8 years agoUse virDomainObjGetDefs in lxcDomainGetBlkioParameters
Ján Tomko [Mon, 30 May 2016 11:19:36 +0000 (13:19 +0200)]
Use virDomainObjGetDefs in lxcDomainGetBlkioParameters

8 years agoUse virDomainObjGetDefs in lxcDomainSetBlkioParameters
Ján Tomko [Mon, 30 May 2016 11:08:30 +0000 (13:08 +0200)]
Use virDomainObjGetDefs in lxcDomainSetBlkioParameters

Remove yet another usage of virDomainLiveConfigHelperMethod
along with an sa_assert that helped clang understand the code flow.

8 years agoUse virDomainObjGetDefs in lxcDomainGetMemoryParameters
Ján Tomko [Sat, 28 May 2016 11:24:50 +0000 (13:24 +0200)]
Use virDomainObjGetDefs in lxcDomainGetMemoryParameters

Instead of virDomainLiveConfigHelperMethod.

8 years agoUse virDomainObjGetDefs in lxcDomainGetSchedulerParametersFlags
Ján Tomko [Thu, 26 May 2016 12:29:33 +0000 (14:29 +0200)]
Use virDomainObjGetDefs in lxcDomainGetSchedulerParametersFlags

On LXC domain startup we have already called virDomainObjSetDefTransient
to fill vm->newDef.

There is no need to call virDomainLiveConfigHelperMethod which has the
ability to fill newDef if it's NULL.