]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agoqemu: monitor: Properly configure backend for UDP chardevs
Peter Krempa [Tue, 27 Sep 2016 14:01:55 +0000 (16:01 +0200)]
qemu: monitor: Properly configure backend for UDP chardevs

Since introduction of chardev hotplug the code was wrong for the UDP
case and basically created a TCP socket instead. Use proper objects and
type for UDP.

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

8 years agoqemu: monitor: Simplify construction of chardev backends
Peter Krempa [Mon, 26 Sep 2016 15:19:43 +0000 (17:19 +0200)]
qemu: monitor: Simplify construction of chardev backends

8 years agotests: qemumonitorjsontest: Do some actual testing in qemuMonitorJSONTestAttachChardev
Peter Krempa [Tue, 27 Sep 2016 07:52:50 +0000 (09:52 +0200)]
tests: qemumonitorjsontest: Do some actual testing in qemuMonitorJSONTestAttachChardev

Until now the test was rather useless since it didn't check the
arguments formatted and didn't use properly configured chardev objects.

Add the expected arguments and instrument the test to validate them.
Modify some test cases to actually add valid data.

Note that the UDP test data is currently wrong due to a bug.

8 years agotests: qemumonitorjson: Don't do multiple tests in one virTestRun
Peter Krempa [Tue, 27 Sep 2016 13:49:05 +0000 (15:49 +0200)]
tests: qemumonitorjson: Don't do multiple tests in one virTestRun

The chardev attach test would do all the tests in one virTestRun
instance. If one sub-test failed then the test would report failure
improperly and the error would be hard to debug since the error pointer
was overwritten.

8 years agotests: qemu: Add support for testing aguments on monitor verbatim
Peter Krempa [Tue, 27 Sep 2016 15:11:55 +0000 (17:11 +0200)]
tests: qemu: Add support for testing aguments on monitor verbatim

Add code that takes a string and matches it against the data passed as
arguments from qemu. This is a simpler version of
qemuMonitorTestAddItemParams.

8 years agoconf: Sanitize formatting of UDP chardev source
Peter Krempa [Mon, 26 Sep 2016 15:15:00 +0000 (17:15 +0200)]
conf: Sanitize formatting of UDP chardev source

Use much simpler logic to determine parts of the code to print.

8 years agoconf: Add a formatting macro for all the blkiotune values
John Ferlan [Mon, 19 Sep 2016 12:27:24 +0000 (08:27 -0400)]
conf: Add a formatting macro for all the blkiotune values

Rather than copy-paste - use a macro

Unfortunately due to how the RNG schema was written keeping the 'value'
and 'value'_max next to each other in the XML causes a schema failure,
so the FORMAT has to write out singly rather than optimizing to write
out both values at once

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Adjust how supportMaxOptions is used.
John Ferlan [Mon, 19 Sep 2016 21:46:07 +0000 (17:46 -0400)]
qemu: Adjust how supportMaxOptions is used.

We're about to add more options, let's avoid having multiple if-then-else
which each try to set up the qemuMonitorJSONMakeCommand call with all the
parameters it knows about.

Instead, use the fact that when a NULL is found in the argument list that
processing of the remaining arguments stops and just have call.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Convert from shorthand to longer throttling names
John Ferlan [Fri, 23 Sep 2016 12:07:53 +0000 (08:07 -0400)]
qemu: Convert from shorthand to longer throttling names

We're about to add 6 new options and it appears (from testing) one cannot
utilize both the shorthand (alias) and (much) longer names for the arguments.
So modify the command builder to use the longer name and of course alter the
test output .args to have the similarly innocuous long name.

Also utilize a macro to build that name makes it so much more visually
appealing and saves a few characters or potential cut-n-paste issues.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agotests: Add blkdeviotune-max xml2xmltest
John Ferlan [Mon, 19 Sep 2016 13:52:10 +0000 (09:52 -0400)]
tests: Add blkdeviotune-max xml2xmltest

It was missing... Also since I'm using the soft link from qemuxml2xmloutdata
to the qemuxml2argvdata file, modify the output file to have the necessary
<address> elements plus the mouse and keyboard.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoinclude: Update description for <iotune> max params
John Ferlan [Mon, 19 Sep 2016 20:49:09 +0000 (16:49 -0400)]
include: Update description for <iotune> max params

The upstream qemu commit 'dce13204' changed the wording just slightly
to add 'in bursts' essentially.  Just following that model here.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agodocs: Fix typo in libvirt-domain.h parameter description
John Ferlan [Mon, 19 Sep 2016 11:15:27 +0000 (07:15 -0400)]
docs: Fix typo in libvirt-domain.h parameter description

Change Marco to Macro

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: allow 32 slots on pcie-expander-bus, not just 1
Laine Stump [Wed, 5 Oct 2016 15:26:07 +0000 (11:26 -0400)]
qemu: allow 32 slots on pcie-expander-bus, not just 1

When I added support for the pcie-expander-bus controller in commit
bc07251f, I incorrectly thought that it only had a single slot
available. Actually it has 32 slots, just like the root complex aka
pcie-root (the part that I *did* get correct is that unlike pcie-root
a pcie-expander-bus doesn't allow any integrated endpoint devices -
only pcie-root-ports and dmi-to-pci-controllers are allowed).

8 years agovsh: Fix warnings in command line completer
Jiri Denemark [Wed, 5 Oct 2016 07:19:19 +0000 (09:19 +0200)]
vsh: Fix warnings in command line completer

GCC complained that

vsh.c: In function 'vshReadlineOptionsGenerator':
vsh.c:2622:29: warning: unused variable 'opt' [-Wunused-variable]
         const vshCmdOptDef *opt = &cmd->opts[list_index];
                             ^
vsh.c: In function 'vshReadlineParse':
vsh.c:2830:44: warning: 'opt' may be used uninitialized in this function
[-Wmaybe-uninitialized]
             completed_list = opt->completer(autoCompleteOpaque,

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Create helper qemuMonitorJSONGetBlockDevDevice
John Ferlan [Mon, 3 Oct 2016 19:04:32 +0000 (15:04 -0400)]
qemu: Create helper qemuMonitorJSONGetBlockDevDevice

This will fetch "this device" from the recently returned 'dev' and perform
common error checking for the paths that call it.

8 years agoqemu: Create helper qemuMonitorJSONGetBlockDev
John Ferlan [Mon, 3 Oct 2016 18:58:59 +0000 (14:58 -0400)]
qemu: Create helper qemuMonitorJSONGetBlockDev

This will grab the 'dev' from devices and do the common validation checks.

8 years agoqemu: Create common code for JSON "query-block" call
John Ferlan [Tue, 27 Sep 2016 13:39:21 +0000 (09:39 -0400)]
qemu: Create common code for JSON "query-block" call

Reduce some cut-n-paste code by creating common helper. Make use of the
recently added virJSONValueObjectStealArray to grab the devices list as
part of the common code (we we can Free the reply) and return devices for
each of the callers to continue to parse.

NB: This also adds error checking to qemuMonitorJSONDiskNameLookup

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoutil: Introduce virJSONValueObjectStealArray
John Ferlan [Mon, 3 Oct 2016 18:45:13 +0000 (14:45 -0400)]
util: Introduce virJSONValueObjectStealArray

Provide the Steal API for any code paths that will desire to grab the
object array and then free it afterwards rather than relying to freeing
the whole chain from the reply.

8 years agorbd: Move the encryption check in build
John Ferlan [Fri, 16 Sep 2016 12:05:10 +0000 (08:05 -0400)]
rbd: Move the encryption check in build

No sense opening a connection only to fail because we don't support the
type of build being attempted.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agorbd: Change to using heap allocated state contexts
John Ferlan [Wed, 14 Sep 2016 17:56:31 +0000 (13:56 -0400)]
rbd: Change to using heap allocated state contexts

Rather than use stack allocated state context pointers, let's allocate and
free the state context pointer.  In doing so, we'll shrink the code a bit
since many routines perform the same initialization sequence.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agorbd: Change virStorageBackendRBDCloseRADOSConn to be static void
John Ferlan [Wed, 14 Sep 2016 18:01:34 +0000 (14:01 -0400)]
rbd: Change virStorageBackendRBDCloseRADOSConn to be static void

Since none of the callers check the status, let's just alter it to
a static void.

While we're at it - scrap the local runtime variable and just do the
math in the VIR_DEBUG directly.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoqemu: Allow making vcpus hotpluggable with virDomainSetVcpusFlags
Peter Krempa [Wed, 21 Sep 2016 05:57:43 +0000 (07:57 +0200)]
qemu: Allow making vcpus hotpluggable with virDomainSetVcpusFlags

Implement support for VIR_DOMAIN_VCPU_HOTPLUGGABLE so that users can
choose to make vcpus added by the API removable.

8 years agolib: Introduce VIR_DOMAIN_VCPU_HOTPLUGGABLE for virDomainSetVcpusFlags
Peter Krempa [Tue, 20 Sep 2016 12:08:55 +0000 (14:08 +0200)]
lib: Introduce VIR_DOMAIN_VCPU_HOTPLUGGABLE for virDomainSetVcpusFlags

For compatibility reasons virDomainSetVcpus needs to add vcpus as non
hotpluggable which means that the users will not be able to unplug it
after the VM has started. Add a flag that will allow to tell the API
that the unpluggable vcpus are okay.

8 years agoqemu: attach: Close monitor socket on connection failure
Peter Krempa [Mon, 3 Oct 2016 11:11:47 +0000 (13:11 +0200)]
qemu: attach: Close monitor socket on connection failure

If attaching to a qemu process fails after opening the monitor socket
libvirt does not clean up the monitor. As the monitor also holds a
reference to the domain object the qemu attach API basically leaks it.

QEMU also does not interact on a second monitor connection and thus a
further attempt to attach to it would lock up.

Prevent libvirt from leaking the monitor by explicitly closing it.

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

8 years agoqemu: Don't strictly require JSON monitor for vCPU detection
Peter Krempa [Fri, 30 Sep 2016 10:45:59 +0000 (12:45 +0200)]
qemu: Don't strictly require JSON monitor for vCPU detection

Attaching to a existing qemu process allows to get us into a situation
when qemu is new enough to have JSON monitor and new vCPU hotplug but
the json monitor is not used. The vCPU detection code would require it
though. This broke attaching to qemu processes.

Make the condition less strict and just skip the vCPU hotplug detection
if JSON monitor is not available.

Resolves one of the symptoms in:
https://bugzilla.redhat.com/show_bug.cgi?id=1378401

8 years agoDon't drop expired lease while reading custom leases file
Nehal J Wani [Fri, 30 Sep 2016 15:11:39 +0000 (15:11 +0000)]
Don't drop expired lease while reading custom leases file

Libvirt, on its own, shouldn't decide whether an expired lease should
stay in the custom leases database or not. It should rather rely on
the 'DEL' event from dnsmasq.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoNSS: Add explicit check to not report expired lease
Nehal J Wani [Fri, 30 Sep 2016 15:11:38 +0000 (15:11 +0000)]
NSS: Add explicit check to not report expired lease

The NSS module shouldn't rely on custom leases database to not have
entries for leases which have expired.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoremote: Increase bound limit for virDomainGetBlockIoTune
John Ferlan [Tue, 4 Oct 2016 11:07:20 +0000 (07:07 -0400)]
remote: Increase bound limit for virDomainGetBlockIoTune

We are about to add 6 new values to fetch. This will put us over the
current limit of 16 (we're at 13 now).

Once there are more than 16 parameters, this will affect existing clients
that attempt to fetch blockiotune config values for the domain from the
remote host since the server side has no mechanism to determine whether
the capability for the emulator exists and thus would attempt to return
all known values from the persistentDef. If attempting to fetch the
blockiotune values from a running domain, the code will check the emulator
capabilities and set maxparams (in qemuDomainGetBlockIoTune) appropriately.

On the client side of the remote connection, it uses this constant in
xdr_remote_domain_get_block_io_tune_ret and virTypedParamsDeserialize
calls, so if a remote server returns more than 16 parameters, then the
client will fail with "Unable to decode message payload".

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoremote: Fix erroneous usage of constant
John Ferlan [Tue, 4 Oct 2016 11:05:20 +0000 (07:05 -0400)]
remote: Fix erroneous usage of constant

The REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX was erroneously used in the
remoteDomainBlockStatsFlags and remoteDomainGetBlockIoTune calls. Change
the constant to be the right one.

Fortunately, all 3 are defined as 16.

Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agoPost-release version bump to 2.4.0
John Ferlan [Tue, 4 Oct 2016 18:28:35 +0000 (14:28 -0400)]
Post-release version bump to 2.4.0

8 years agoRelease of libvirt-2.3.0
Daniel Veillard [Tue, 4 Oct 2016 16:33:26 +0000 (18:33 +0200)]
Release of libvirt-2.3.0

* docs/news.html.in: updated for release
* po/*.po*: regenerated

8 years agoRevert "conf: Skip post parse callbacks when creating copy"
Michal Privoznik [Tue, 4 Oct 2016 16:00:02 +0000 (18:00 +0200)]
Revert "conf: Skip post parse callbacks when creating copy"

This breaks vCPU hotplug, because when starting a domain, we
create a copy of domain definition (which becomes live XML) and
during the post parse callbacks we might adjust some tunings so
that vCPU hotplug is possible.

This reverts commit 581b7756af18dcf84b57d9947978725d2dfbfc18.

8 years agoRevert "domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE"
Michal Privoznik [Tue, 4 Oct 2016 15:58:21 +0000 (17:58 +0200)]
Revert "domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE"

This breaks vCPU hotplug, because when starting a domain, we
create a copy of domain definition (which becomes live XML) and
during the post parse callbacks we might adjust some tunings so
that vCPU hotplug is possible.

This reverts commit c0f90799bc7fa4b690ead6a592806378a243873c.

8 years agoqemu: vcpu: Clear vcpu order information rather than making it invalid
Peter Krempa [Wed, 21 Sep 2016 05:59:57 +0000 (07:59 +0200)]
qemu: vcpu: Clear vcpu order information rather than making it invalid

Certain operations may make the vcpu order information invalid. Since
the order is primarily used to ensure migration compatibility and has
basically no other user benefits, clear the order prior to certain
operations and document that it may be cleared.

All the operations that would clear the order can still be properly
executed by defining a new domain configuration rather than using the
helper APIs.

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

8 years agoqemu: Fix coldplug of vcpus
Peter Krempa [Wed, 21 Sep 2016 05:46:25 +0000 (07:46 +0200)]
qemu: Fix coldplug of vcpus

virDomainDefSetVcpus was not designed to handle coldplug of vcpus now
that we can set state of vcpus individually.

Introduce qemuDomainSetVcpusConfig that properly handles state changes
of vcpus when coldplugging so that invalid configurations are not
created.

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

8 years agoqemu: process: Enforce 'vcpu' order range to <1,maxvcpus>
Peter Krempa [Fri, 16 Sep 2016 13:51:14 +0000 (15:51 +0200)]
qemu: process: Enforce 'vcpu' order range to <1,maxvcpus>

The current code that validates duplicate vcpu order would not work
properly if the order would exceed def->maxvcpus. Limit the order to the
interval described.

8 years agoqemu: process: Don't use shifted indexes for vcpu order verification
Peter Krempa [Wed, 14 Sep 2016 04:50:00 +0000 (06:50 +0200)]
qemu: process: Don't use shifted indexes for vcpu order verification

Allocate a one larger bitmap rather than shifting the indexes back to
zero.

8 years agoqemu: process: Fix off-by-one in vcpu order duplicate error message
Peter Krempa [Wed, 14 Sep 2016 03:58:33 +0000 (05:58 +0200)]
qemu: process: Fix off-by-one in vcpu order duplicate error message

The bitmap indexes for the order duplicate check are shifted to 0 since
vcpu order 0 is not allowed. The error message doesn't need such
treating though.

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

8 years agodocs: correct version requirements for <kvm><hidden='on'/></kvm>
Laine Stump [Thu, 29 Sep 2016 17:38:07 +0000 (13:38 -0400)]
docs: correct version requirements for <kvm><hidden='on'/></kvm>

When support was added for the kvm hidden='on' attribute in commit
d07116, the version requirement was listed as "2.1.0 (QEMU
only)". However, this was added when libvirt was at version 1.2.8 - it
is *QEMU* that must be at version 2.1.0 or later.

This went unnoticed for a very long time (over 2 years). Then a week
or two ago a new Windows convert in the #virt channel on OFTC was told
he needed to use this feature (to prevent nvidia drivers in a guest
from refusing to work due to being run in a virtual machine). There
was some problem with it being recognized and "someone" (it may have
been me, or may have been someone else, I don't remember) pointed out
that the documentation at

  http://www.libvirt.org/formatdomain.html

says that it requires libvirt 2.1.0. The next several days were filled
with agony as a new convert to Linux first tried to upgrade a Linux
Mint host running their "LTS" version to something newer, then tried
to install a libvirt build built for Ubuntu onto this, and later back
to the old LTS Linux Mint. After this he tried building his own
libvirt from source (with all the expected problems), and finally
switched to Fedora. In the end it was hours and hours of everybody's
lives that they will never get back. To now learn that he didn't need
to do this (his original libvirt version was 1.3.3, so whatever his
problem was, it was elsewhere) makes the pain all that much worse.

To prevent this from happening again, this simple patch changes the
version requirement for the kvm hidden attribute from "2.1.0 (QEMU
only)" to "1.2.8 (QEMU 2.1.0)".

8 years agosanlock: Properly init io_timeout
Michal Privoznik [Thu, 15 Sep 2016 11:05:34 +0000 (13:05 +0200)]
sanlock: Properly init io_timeout

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

Hold on to your hats, because this is gonna be wild.

In bd3e16a3 I've tried to expose sanlock io_timeout. What I had
not realized (because there is like no documentation for sanlock
at all) was very unusual way their APIs work. Basically, what we
do currently is:

    sanlock_add_lockspace_timeout(&ls, io_timeout);

which adds a lockspace to sanlock daemon. One would expect that
io_timeout sets the io_timeout for it. Nah! That's where you are
completely off the tracks. It sets timeout for next lockspace you
will probably add later. Therefore:

   sanlock_add_lockspace_timeout(&ls, io_timeout = 10);
   /* adds new lockspace with default io_timeout */

   sanlock_add_lockspace_timeout(&ls, io_timeout = 20);
   /* adds new lockspace with io_timeout = 10 */

   sanlock_add_lockspace_timeout(&ls, io_timeout = 40);
   /* adds new lockspace with io_timeout = 20 */

And so on. You get the picture.
Fortunately, we don't allow setting io_timeout per domain or per
domain disk. So we just need to set the default used in the very
first step and hope for the best (as all the io_timeout-s used
later will have the same value).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agom4: Check for sanlock_write_lockspace
Michal Privoznik [Thu, 15 Sep 2016 08:45:26 +0000 (10:45 +0200)]
m4: Check for sanlock_write_lockspace

Currently, we are checking for sanlock_add_lockspace_timeout
which is good for now. But in a subsequent patch we are going to
use sanlock_write_lockspace (which sets an initial value for io
timeout for sanlock). Now, there is no reason to check for both
functions in sanlock library as the sanlock_write_lockspace was
introduced in 2.7 release and the one we are currently checking
for in the 2.5 release. Therefore it is safe to assume presence
of sanlock_add_lockspace_timeout when sanlock_write_lockspace
is detected.

Moreover, the macro for conditional compilation is renamed to
HAVE_SANLOCK_IO_TIMEOUT (as it now encapsulates two functions).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolock_driver_sanlock: Avoid global driver variable whenever possible
Michal Privoznik [Thu, 15 Sep 2016 11:18:13 +0000 (13:18 +0200)]
lock_driver_sanlock: Avoid global driver variable whenever possible

Global variables are bad, we should avoid using them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Only use memory-backend-file with NUMA if needed
Martin Kletzander [Fri, 23 Sep 2016 09:31:30 +0000 (11:31 +0200)]
qemu: Only use memory-backend-file with NUMA if needed

If this reminds you of a commit message from around a year ago, it's
41c2aa729f0af084ede95ee9a06219a2dd5fb5df and yes, we're dealing with
"the same thing" again.  Or f309db1f4d51009bad0d32e12efc75530b66836b and
it's similar.

There is a logic in place that if there is no real need for
memory-backend-file, qemuBuildMemoryBackendStr() returns 0.  However
that wasn't the case with hugepage backing.  The reason for that was
that we abused the 'pagesize' variable for storing that information, but
we should rather have a separate one that specifies whether we really
need the new object for hugepage backing.  And that variable should be
set only if this particular NUMA cell needs special treatment WRT
hugepages.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agovsh: Write out history on "quit" or "exit" in interactive mode
John Ferlan [Wed, 28 Sep 2016 19:01:55 +0000 (15:01 -0400)]
vsh: Write out history on "quit" or "exit" in interactive mode

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

Introduced by commit id '834c5720'.

During the code motion and creation of vsh.c, the function 'vshDeinit()'
in the (new) vsh.c was altered from whence it came in virsh.c such that
calling 'vshReadlineDeinit(ctl)' was conditional on "ctl->imode".

This causes a problem for the interactive running if the "quit" and "exit"
commands are used because 'cmdQuit' will clear ctl->imode, thus when the
interactive loop in main() of virsh.c exits because ctl->mode is clear and
virshDeinit is called which calls vshDeinit, the history file is now not
written. Conversely, if one had exited the interactive loop via pressing
<ctrl>D the file would be created because loop control is broken on EOF
and ctl->imode is not set to false.

This patch will remove the conditional call to vshReadlineDeinit and
restore the former behaviour.

8 years agobhyve: chase cpuCompareXML rename
Roman Bogorodskiy [Thu, 29 Sep 2016 05:10:33 +0000 (08:10 +0300)]
bhyve: chase cpuCompareXML rename

In commit 7f127de cpuCompareXML was renamed to virCPUCompareXML,
so change the bhyve driver to use the new function and thus
fix the build.

8 years agodoc: fix note about Xen credit scheduler
Jim Fehlig [Wed, 28 Sep 2016 04:43:51 +0000 (22:43 -0600)]
doc: fix note about Xen credit scheduler

Commit 6c504d6a added a note to the virsh man page about the
deprecation of 'cap' and 'weight' settings for the credit
scheduler. To this day, the default scheduler in Xen is credit
and it supports setting 'cap' and 'weight'. Remove the deprecation
notice from the note on the Xen credit scheduler.

Reported-by: Volo M. <vm@vovs.net>
8 years agolibxl: fix param assignment in domainGetSchedulerParameters
Jim Fehlig [Wed, 28 Sep 2016 04:18:50 +0000 (22:18 -0600)]
libxl: fix param assignment in domainGetSchedulerParameters

Due to a copy and paste error, the scheduler 'cap' parameter
was over-writing the 'weight' parameter when preparing the
return parameters in libxlDomainGetSchedulerParametersFlags.
As a result, the scheduler weight was never shown when getting
schedinfo and setting the weight failed as well

virsh  schedinfo testvm
Scheduler      : credit
cap            : 0

virsh  schedinfo testvm --cap 50 --weight 500
Scheduler      : credit
error: invalid scheduler option: weight

The obvious fix is to assign the 'caps' parameter to the correct
item in the parameter list.

Reported-by: Volo M. <vm@vovs.net>
8 years agoxlconfigtest: add test for channel conversion
Joao Martins [Mon, 26 Sep 2016 17:33:18 +0000 (18:33 +0100)]
xlconfigtest: add test for channel conversion

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Acked-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
8 years agoxenconfig: channels conversion support
Joao Martins [Mon, 26 Sep 2016 17:33:17 +0000 (18:33 +0100)]
xenconfig: channels conversion support

Add support for formating/parsing libxl channels.

Syntax on xen libxl goes as following:
channel=["connection=pty|socket,path=/path/to/socket,name=XXX",...]

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Acked-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
8 years agolibxl: channels support
Joao Martins [Mon, 26 Sep 2016 17:33:16 +0000 (18:33 +0100)]
libxl: channels support

And allow libxl to handle channel element which creates a Xen
console visible to the guest as a low-bandwitdh communication
channel. If type is PTY we also fetch the tty after boot using
libxl_channel_getinfo to fetch the tty path. On socket case,
we autogenerate a path if not specified in the XML. Path autogenerated
is slightly different from qemu driver: qemu stores also on
"channels/target" but it creates then a directory per domain with
each channel target name. libxl doesn't appear to have a clear
definition of private files associated with each domain, so for
simplicity we do it slightly different. On qemu each autogenerated
channel goes like:

channels/target/<domain-name>/<target name>

Whereas for libxl:

channels/target/<domain-name>-<target name>

Should note that if path is not specified it won't persist,
existing only on live XML, unless user had initially specified it.
Since support for libxl channels only came on Xen >= 4.5 we therefore
need to conditionally compile it with LIBXL_HAVE_DEVICE_CHANNEL.

After this patch and having a qemu guest agent:
 $ cat domain.xml | grep -a1 channel | head -n 5 | tail -n 4
 <channel type='unix'>
   <source mode='bind' path='/tmp/channel'/>
   <target type='xen' name='org.qemu.guest_agent.0'/>
 </channel>

 $ virsh create domain.xml
 $ echo '{"execute":"guest-network-get-interfaces"}' | socat
 stdio,ignoreeof  unix-connect:/tmp/channel

 {"execute":"guest-network-get-interfaces"}
 {"return": [{"name": "lo", "ip-addresses": [{"ip-address-type": "ipv4",
 "ip-address": "127.0.0.1", "prefix": 8}, {"ip-address-type": "ipv6",
 "ip-address": "::1", "prefix": 128}], "hardware-address":
 "00:00:00:00:00:00"}, {"name": "eth0", "ip-addresses":
 [{"ip-address-type": "ipv4", "ip-address": "10.100.0.6", "prefix": 24},
 {"ip-address-type": "ipv6", "ip-address": "fe80::216:3eff:fe40:88eb",
 "prefix": 64}], "hardware-address": "00:16:3e:40:88:eb"}, {"name":
 "sit0"}]}

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
8 years agoconf: add xen type for channels
Joao Martins [Mon, 26 Sep 2016 17:33:15 +0000 (18:33 +0100)]
conf: add xen type for channels

So far only guestfwd and virtio were supported. Add an additional
for Xen as libxl channels create a Xen console visible to the guest.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
8 years agoqemu: Fix crash in qemucapsprobe
Jiri Denemark [Tue, 27 Sep 2016 11:39:51 +0000 (13:39 +0200)]
qemu: Fix crash in qemucapsprobe

The qemucapsprobe helper calls virQEMUCapsNewForBinaryInternal with
caps == NULL, causing the following crash:

    Program received signal SIGSEGV, Segmentation fault.
    #0  0x00007ffff788775f in virQEMUCapsInitHostCPUModel
        (qemuCaps=qemuCaps@entry=0x649680, host=host@entry=0x10) at
        src/qemu/qemu_capabilities.c:2969
    #1  0x00007ffff7889dbf in virQEMUCapsNewForBinaryInternal
        (caps=caps@entry=0x0, binary=<optimized out>,
        libDir=libDir@entry=0x4033f6 "/tmp", cacheDir=cacheDir@entry=0x0,
        runUid=runUid@entry=4294967295, runGid=runGid@entry=4294967295,
        qmpOnly=true) at src/qemu/qemu_capabilities.c:4039
    #2  0x0000000000401702 in main (argc=2, argv=0x7fffffffd968) at
        tests/qemucapsprobe.c:73

Caused by v2.2.0-182-g68c7011.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuDomainUpdateDeviceConfig: Allow full disk update
Michal Privoznik [Wed, 31 Aug 2016 09:09:58 +0000 (11:09 +0200)]
qemuDomainUpdateDeviceConfig: Allow full disk update

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

So far, when it comes to 'virsh update-device --config' of disks
we are limiting ourselves for just the disk source update and
just for CDROMs and floppies. This makes no sense. Especially if
you look around and see that we already allow full update to
graphics and net devices. So let's just take whatever XML user
wants to have there and replace our internal definition with it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolibxl: find virDomainObj in libxlDomainShutdownThread
Jim Fehlig [Wed, 21 Sep 2016 21:02:34 +0000 (15:02 -0600)]
libxl: find virDomainObj in libxlDomainShutdownThread

libxl events are delivered to libvirt via the libxlDomainEventHandler
callback registered with libxl. Documenation in
$xensrc/tools/libxl/libxl_event.h states that the callback "may occur
on any thread in which the application calls libxl". This can result
in deadlock since many of the libvirt callees of libxl hold a lock on
the virDomainObj they are working on. When the callback is invoked, it
attempts to find a virDomainObj corresponding to the domain ID provided
by libxl. Searching the domain obj list results in locking each obj
before checking if it is active, and its ID equals the requested ID.
Deadlock is possible when attempting to lock an obj that is already
locked further up the call stack. Indeed, Max Ustermann reported an
instance of this deadlock

https://www.redhat.com/archives/libvir-list/2015-November/msg00130.html

Guido Rossmueller also recently stumbled across it

https://www.redhat.com/archives/libvir-list/2016-September/msg00287.html

Fix the deadlock by moving the lookup of virDomainObj to the
libxlDomainShutdownThread. After this patch, libxl events are
enqueued on the libvirt side and processed by dedicated thread,
avoiding the described deadlock.

Reported-by: Max Ustermann <ustermann78@web.de>
Reported-by: Guido Rossmueller <Guido.Rossmueller@gdata.de>
8 years agomingw: Package cputypes.rng for mingw32 too
Jiri Denemark [Tue, 27 Sep 2016 13:40:24 +0000 (15:40 +0200)]
mingw: Package cputypes.rng for mingw32 too

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agomingw: Package cputypes.rng
Jiri Denemark [Tue, 27 Sep 2016 12:45:40 +0000 (14:45 +0200)]
mingw: Package cputypes.rng

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agospec: Package cputypes.rng
Jiri Denemark [Tue, 27 Sep 2016 11:27:52 +0000 (13:27 +0200)]
spec: Package cputypes.rng

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: make qemuGetCompressionProgram return int not an enum
Daniel P. Berrange [Tue, 27 Sep 2016 08:49:20 +0000 (09:49 +0100)]
qemu: make qemuGetCompressionProgram return int not an enum

enum types are unsigned and the qemuGetCompressionProgram
function can return -1 on error. It is therefore inappropriate
to return an enum type. This fixes a build error where the
internal 'ret' variable was used in a comparison with -1

../../src/qemu/qemu_driver.c: In function 'qemuGetCompressionProgram':
../../src/qemu/qemu_driver.c:3280:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
../../src/qemu/qemu_driver.c:3289:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1: all warnings being treated as errors

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoFix coding style issues.
Nitesh Konkar [Mon, 26 Sep 2016 19:01:27 +0000 (00:31 +0530)]
Fix coding style issues.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agoconf: Skip post parse callbacks when creating copy
Michal Privoznik [Tue, 20 Sep 2016 12:21:26 +0000 (14:21 +0200)]
conf: Skip post parse callbacks when creating copy

When creating a copy of virDomainDef we save ourselves the
trouble of writing deep-copy functions and just format and parse
back domain/device XML. However, the XML we are parsing was
already fully formatted - there is no reason to run post parse
callbacks (which fill in blanks - there are none!).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodomain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE
Michal Privoznik [Tue, 20 Sep 2016 11:59:52 +0000 (13:59 +0200)]
domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE

This is an internal flag that prevents our two entry points to
XML parsing (virDomainDefParse and virDomainDeviceDefParse) from
running post parse callbacks. This is expected to be used in
cases when we already have full domain/device XML and we are just
parsing it back (i.e. virDomainDefCopy or virDomainDeviceDefCopy)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainDefAssignAddresses: Fetch caps from domain object
Michal Privoznik [Sat, 17 Sep 2016 05:05:03 +0000 (07:05 +0200)]
qemuDomainDefAssignAddresses: Fetch caps from domain object

Just like we did two commits ago, don't try to fetch capabilities
for non-existing binary. Re-use the ones we have for running
domain.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainDeviceDefPostParse: Fetch caps from domain object
Michal Privoznik [Fri, 16 Sep 2016 14:40:22 +0000 (16:40 +0200)]
qemuDomainDeviceDefPostParse: Fetch caps from domain object

Just like we did two commits ago, don't try to fetch capabilities
for non-existing binary. Re-use the ones we have for running
domain.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainDefPostParse: Fetch qemuCaps from domain object
Michal Privoznik [Fri, 16 Sep 2016 14:29:41 +0000 (16:29 +0200)]
qemuDomainDefPostParse: Fetch qemuCaps from domain object

We can't rely on def->emulator path. It may be provided by user
as we give them opportunity to provide their own XML for
migration. Therefore the path may point to just whatever binary
(or even to a non-existent file). Moreover, this path is meant
for destination, but the capabilities lookup is done on source.
What we can do is to assume same capabilities for post parse
callbacks as the running domain has. They will be used just to
add some default models/controllers/devices/... anyway.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoconf: Extend virDomainDefAssignAddressesCallback for parseOpaque
Michal Privoznik [Fri, 23 Sep 2016 09:04:39 +0000 (11:04 +0200)]
conf: Extend virDomainDefAssignAddressesCallback for parseOpaque

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoconf: Extend virDomainDeviceDefPostParse for parseOpaque
Michal Privoznik [Fri, 23 Sep 2016 08:53:38 +0000 (10:53 +0200)]
conf: Extend virDomainDeviceDefPostParse for parseOpaque

Just like virDomainDefPostParseCallback has gained new
parseOpaque argument, we need to follow the logic with
virDomainDeviceDefPostParse.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirDomainDefCopy: Introduce @parseOpaque argument
Michal Privoznik [Thu, 22 Sep 2016 15:23:03 +0000 (17:23 +0200)]
virDomainDefCopy: Introduce @parseOpaque argument

We want to pass the proper opaque pointer instead of NULL to
virDomainDefParseString.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirDomainDefParse{File,String}: Introduce @parseOpaque argument
Michal Privoznik [Thu, 22 Sep 2016 15:14:17 +0000 (17:14 +0200)]
virDomainDefParse{File,String}: Introduce @parseOpaque argument

We want to pass the proper opaque pointer instead of NULL to
virDomainDefParse and subsequently virDomainDefParseNode too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirDomainDefParseNode: Introduce @parseOpaque argument
Michal Privoznik [Thu, 22 Sep 2016 14:56:26 +0000 (16:56 +0200)]
virDomainDefParseNode: Introduce @parseOpaque argument

We want to pass the proper opaque pointer instead of NULL to
virDomainDefParseXML and subsequently virDomainDefPostParse too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agovirDomainDefPostParse: Introduce @parseOpaque argument
Michal Privoznik [Thu, 22 Sep 2016 14:41:33 +0000 (16:41 +0200)]
virDomainDefPostParse: Introduce @parseOpaque argument

Some callers might want to pass yet another pointer to opaque
data to post parse callbacks. The driver generic one is not
enough because two threads executing post parse callback might
want to see different data (e.g. domain object pointer that
domain def belongs to).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agostorage_backend_rbd: remove unnessary translated message marker
Chen Hanxiao [Sat, 24 Sep 2016 03:37:02 +0000 (11:37 +0800)]
storage_backend_rbd: remove unnessary translated message marker

Remove unnessary translated message marker _()
for the VIR_WARN messages.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
8 years agoFix various code comment typos
Nitesh Konkar [Sat, 24 Sep 2016 18:43:25 +0000 (00:13 +0530)]
Fix various code comment typos

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agoqemu: Get/return compressedpath program
John Ferlan [Tue, 13 Sep 2016 16:05:39 +0000 (12:05 -0400)]
qemu: Get/return compressedpath program

Based upon a patch from Chen Hanxiao <chenhanxiao@gmail.com>, rather than
need to call virFindFileInPath twice, let's just save the path and pass it
along with the compressed type. (NB: the second call would be in virExec as
called from virCommandRunAsync which is called from qemuMigrationToFile
using the argument 'compressor' which up to this point would be the string
from the cfg file that isn't the fully qualified path).

Since we now have the path, we can remove qemuCompressProgramName which
would return NULL or the string representation of the compress type.

8 years agoqemu: Remove qemuCompressProgramAvailable
John Ferlan [Tue, 13 Sep 2016 15:51:54 +0000 (11:51 -0400)]
qemu: Remove qemuCompressProgramAvailable

There's only one caller and the code is duplicitous just converting the
recently converted cfg image name back into it's string value in order to
get/find the path to the image.  A subsequent patch can return this path.

8 years agoqemu: Use qemuGetCompressionProgram for error paths
John Ferlan [Tue, 13 Sep 2016 14:11:00 +0000 (10:11 -0400)]
qemu: Use qemuGetCompressionProgram for error paths

Let's do some more code reuse - there are 3 other callers that care to
check/get the compress program. Each of those though cares whether the
requested cfg image is valid and exists. So, add a parameter to handle
those cases.

NB: We won't need to initialize the returned value in the case where
the cfg image doesn't exist since the called program will handle that.

8 years agoqemu: Alter qemuGetCompressionProgram warning message
John Ferlan [Fri, 23 Sep 2016 11:09:03 +0000 (07:09 -0400)]
qemu: Alter qemuGetCompressionProgram warning message

Add a new parameter 'styleFormat' to be used when printing the
warning message so that it's "clearer" what style of compression
call caused the error. Add that style to both messages as a paremter.

Also a VIR_WARN error message doesn't need to be translated
 (e.g. inside _()), so remove the need for the translation.

8 years agoqemu: Remove getCompressionType
John Ferlan [Tue, 13 Sep 2016 14:31:37 +0000 (10:31 -0400)]
qemu: Remove getCompressionType

There's only one caller now anyway... Besides it's just a shell for
getting the compress type.  Subsequent patches will return the path
to the compression program.

8 years agoqemu: Introduce helper qemuGetCompressionProgram
John Ferlan [Tue, 13 Sep 2016 14:01:47 +0000 (10:01 -0400)]
qemu: Introduce helper qemuGetCompressionProgram

Split out the guts of getCompressionType to perform the same functionality
in the new helper program with a subsequent patch goal to be reusable for
other callers making similar checks/calls to ensure the compression type
is valid and that the compression program cannot be found.

8 years agoqemu: Adjust doCoreDump to call getCompressionType
John Ferlan [Tue, 13 Sep 2016 13:24:48 +0000 (09:24 -0400)]
qemu: Adjust doCoreDump to call getCompressionType

Rather than calling getCompressionType from each of the callers, just call
it from doCoreDump.  A subsequent patch will be adjust the code even more.

8 years agoqemu: Move getCompressionType
John Ferlan [Tue, 13 Sep 2016 13:26:15 +0000 (09:26 -0400)]
qemu: Move getCompressionType

A subsequent patch will adjust the 3 callers to just call from doCoreDump.

8 years agoapparmor: move qemu-bridge-helper to libvirtd profile
Cédric Bosdonnat [Fri, 5 Aug 2016 07:32:54 +0000 (09:32 +0200)]
apparmor: move qemu-bridge-helper to libvirtd profile

qemu-bridge-helper is only called from libvirtd, it has to be moved
from the qemu domain abstraction to the usr.sbin.libvirtd profile.

8 years agolibxl: increase usbdevice list only when finding such an input device
Cédric Bosdonnat [Fri, 23 Sep 2016 12:11:50 +0000 (14:11 +0200)]
libxl: increase usbdevice list only when finding such an input device

If passing an empty usbdevice_list to libxl, qemu will always get an
-usb parameter for HVM guests with only non-USB input devices. This
causes qemu to crash when passing pvusb device on HVM guests.

The solution is to allocate the list only when an item to put in it
is found.

8 years agoqemuBuildHostNetStr: Realign
Michal Privoznik [Tue, 16 Aug 2016 06:51:38 +0000 (08:51 +0200)]
qemuBuildHostNetStr: Realign

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-kvm-1.2.0
Pavel Hrdina [Thu, 22 Sep 2016 14:38:43 +0000 (16:38 +0200)]
qemuhelptest: regenerate data for qemu-kvm-1.2.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-kvm-0.13.0
Pavel Hrdina [Thu, 22 Sep 2016 14:38:08 +0000 (16:38 +0200)]
qemuhelptest: regenerate data for qemu-kvm-0.13.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-kvm-0.12.3
Pavel Hrdina [Thu, 22 Sep 2016 14:37:28 +0000 (16:37 +0200)]
qemuhelptest: regenerate data for qemu-kvm-0.12.3

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-1.2.0
Pavel Hrdina [Thu, 22 Sep 2016 14:36:33 +0000 (16:36 +0200)]
qemuhelptest: regenerate data for qemu-1.2.0

This patch also removes device data for qemu-1.2.0 as it was removed for
qemu-kvm-1.2.0 by commit ae3e29e6e.  They are not required because we
parse only version from help output and return with error that this qemu
is too new to use help parsing.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-1.1.0
Pavel Hrdina [Thu, 22 Sep 2016 14:36:22 +0000 (16:36 +0200)]
qemuhelptest: regenerate data for qemu-1.1.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-1.0
Pavel Hrdina [Thu, 22 Sep 2016 14:35:54 +0000 (16:35 +0200)]
qemuhelptest: regenerate data for qemu-1.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: regenerate data for qemu-0.12.1
Pavel Hrdina [Thu, 22 Sep 2016 14:32:08 +0000 (16:32 +0200)]
qemuhelptest: regenerate data for qemu-0.12.1

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuhelptest: remove downstream test data
Pavel Hrdina [Wed, 21 Sep 2016 08:56:15 +0000 (10:56 +0200)]
qemuhelptest: remove downstream test data

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemu: Fix improper indention
John Ferlan [Thu, 22 Sep 2016 20:49:25 +0000 (16:49 -0400)]
qemu: Fix improper indention

Commit id 'ce61c164' indented wrong - not sure how I did that...

8 years agoFix Multiple Typos
Nitesh Konkar [Thu, 22 Sep 2016 10:33:24 +0000 (16:03 +0530)]
Fix Multiple Typos

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
8 years agoMove CMT feature filtering to QEMU driver
Jiri Denemark [Thu, 21 Jul 2016 15:02:37 +0000 (17:02 +0200)]
Move CMT feature filtering to QEMU driver

It really doesn't belong to the generic CPU driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Update guest CPU def in live XML
Jiri Denemark [Wed, 22 Jun 2016 13:53:48 +0000 (15:53 +0200)]
qemu: Update guest CPU def in live XML

Storing the updated CPU definition in the live domain definition saves
us from having to update it over and over when we need it. Not to
mention that we will soon further update the CPU definition according to
QEMU once it's started.

A highly wanted side effect of this patch, libvirt will pass all CPU
features explicitly specified in domain XML to QEMU, even those that are
already included in the host model.

This patch should fix the following bugs:
    https://bugzilla.redhat.com/show_bug.cgi?id=1207095
    https://bugzilla.redhat.com/show_bug.cgi?id=1339680
    https://bugzilla.redhat.com/show_bug.cgi?id=1371039
    https://bugzilla.redhat.com/show_bug.cgi?id=1373849
    https://bugzilla.redhat.com/show_bug.cgi?id=1375524
    https://bugzilla.redhat.com/show_bug.cgi?id=1377913

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Rework cpuCompare* APIs
Jiri Denemark [Tue, 9 Aug 2016 11:26:53 +0000 (13:26 +0200)]
cpu: Rework cpuCompare* APIs

Both cpuCompare* APIs are renamed to virCPUCompare*. And they should now
work for any guest CPU definition, i.e., even for host-passthrough
(trivial) and host-model CPUs. The implementation in x86 driver is
enhanced to provide a hint about -noTSX Broadwell and Haswell models
when appropriate.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Document missing parameters for cpuCompare*
Jiri Denemark [Fri, 16 Sep 2016 09:45:54 +0000 (11:45 +0200)]
cpu: Document missing parameters for cpuCompare*

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Introduce virCPUCheckFeature
Jiri Denemark [Fri, 16 Sep 2016 12:13:09 +0000 (14:13 +0200)]
cpu: Introduce virCPUCheckFeature

The function is similar to virCPUDataCheckFeature, but it works directly
on CPU definition rather than requiring it to be transformed into CPU
data first.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Rework virCPUDataCheckFeature
Jiri Denemark [Fri, 16 Sep 2016 12:12:15 +0000 (14:12 +0200)]
cpu: Rework virCPUDataCheckFeature

To match our coding style and to provide better debug and error
messages.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Rename cpuHasFeature to virCPUDataCheckFeature
Jiri Denemark [Mon, 8 Aug 2016 13:48:15 +0000 (15:48 +0200)]
cpu: Rename cpuHasFeature to virCPUDataCheckFeature

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>