]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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.

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

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.

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

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.

8 years agolxc: rename vmdef to persistentDef
Ján Tomko [Sat, 28 May 2016 11:45:18 +0000 (13:45 +0200)]
lxc: rename vmdef to persistentDef

A few functions using virDomainLiveConfigHelperMethod use the generic
name 'vmdef' to point to the persistent definition.

Use persistentDef and/or persistentDefCopy to make its purpose obvious.

8 years agoUse @SYSTEM priority for TLS on Fedora >= 21
Daniel P. Berrange [Mon, 6 Jun 2016 15:02:22 +0000 (16:02 +0100)]
Use @SYSTEM priority for TLS on Fedora >= 21

In Fedora >= 21, there is a new crypto priority framework
that sets TLS policies globally for all apps. To activate
this with GNUTLS we must request "@SYSTEM" instead of
the traditional "NORMAL" string. The '@' causes gnutls todo
a lookup in its config file for the 'SYSTEM' keyword entry.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoremote: allow TLS priority to be customized
Daniel P. Berrange [Fri, 3 Jun 2016 17:20:27 +0000 (18:20 +0100)]
remote: allow TLS priority to be customized

Support reading the TLS priority from the client configuration
file via the "tls_priority" config option, eg

 $ cat $HOME/.config/libvirt/libvirt.conf
 tls_priority="NORMAL:-VERS-SSL3.0"

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoPass config file object through to driver open methods
Daniel P. Berrange [Fri, 3 Jun 2016 17:01:27 +0000 (18:01 +0100)]
Pass config file object through to driver open methods

The virConnectOpenInternal method opens the libvirt client
config file and uses it to resolve things like URI aliases.

There may be driver specific things that are useful to
store in the config file too, so rather than have them
re-parse the same file, pass the virConfPtr down to the
drivers.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoremote: allow TLS protocol/cipher priority override in URI
Daniel P. Berrange [Mon, 6 Jun 2016 14:41:01 +0000 (15:41 +0100)]
remote: allow TLS protocol/cipher priority override in URI

Add support for a "tls_priority" URI parameter in remote
driver URIs. eg

 qemu+tls://localhost/session?tls_priority=NORMAL:-VERS-SSL3.0

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibvirtd: add config option for TLS priority
Daniel P. Berrange [Fri, 3 Jun 2016 16:53:18 +0000 (17:53 +0100)]
libvirtd: add config option for TLS priority

Add a "tls_priority" config option to /etc/libvirt/libvirtd.conf
to allow the administrator to override the built-in default
setting. This only affects the server side configuration.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agorpc: allow priority string to be passed to TLS context
Daniel P. Berrange [Fri, 3 Jun 2016 16:44:55 +0000 (17:44 +0100)]
rpc: allow priority string to be passed to TLS context

Extend the virNetTLSContextNew* constructors to allow
the TLS priority string to be passed in, overriding the
compile time default.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoconfigure: allow setting default TLS priority string
Daniel P. Berrange [Fri, 3 Jun 2016 16:31:48 +0000 (17:31 +0100)]
configure: allow setting default TLS priority string

Currently libvirt calls gnutls_set_default_priority()
which on old systems resolves to "NORMAL" while new
systems it resolves to "@SYSTEM". Either way, this
is a global default that is identical across all apps.

We want to allow distros to flexibility to define a
custom default string for libvirt priority, so add
a --tls-priority=STRING  flag to configure to enable
this to be set.

It is expected that distros would use this when creating
RPM/Deb/etc packages, according to their preferred crypto
handling policies.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agorpc: set gnutls log function at global init time
Daniel P. Berrange [Fri, 3 Jun 2016 16:20:19 +0000 (17:20 +0100)]
rpc: set gnutls log function at global init time

Currently we set the gnutls log function when creating a
TLS context, however, the setting is in fact global, not
per context. So we should be setting it when we first call
gnutls_global_init() instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agotls: remove support for gnutls 1.x.x, require 2.2.0
Daniel P. Berrange [Mon, 6 Jun 2016 09:17:25 +0000 (10:17 +0100)]
tls: remove support for gnutls 1.x.x, require 2.2.0

We need to use the gnutls_priority_set_direct method which
was not introduced until 2.1.7, so bump version to 2.2.0
which is the first stable release with it included. This
release dates from Dec 2007 so it is reasonable to ditch
support for the 1.x.x series for gnutls releases entirely.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>