]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
8 years agocpu: Introduce virCPUTranslate
Jiri Denemark [Fri, 17 Jun 2016 07:45:48 +0000 (09:45 +0200)]
cpu: Introduce virCPUTranslate

The API is supposed to make sure the provided CPU definition does not
use a CPU model which is not supported by the hypervisor (if at all
possible, of course).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Set nfeatures_max correctly in x86Decode
Jiri Denemark [Thu, 4 Aug 2016 22:01:42 +0000 (00:01 +0200)]
cpu: Set nfeatures_max correctly in x86Decode

Keeping nfeatures_max set to 0 while nfeatures > 0 and some features are
already stored in features array is just asking for problems once we
want to add a new feature into the array.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Rework cpuUpdate
Jiri Denemark [Thu, 23 Jun 2016 13:27:07 +0000 (15:27 +0200)]
cpu: Rework cpuUpdate

The reworked API is now called virCPUUpdate and it should change the
provided CPU definition into a one which can be consumed by the QEMU
command line builder:

    - host-passthrough remains unchanged
    - host-model is turned into custom CPU with a model and features
      copied from host
    - custom CPU with minimum match is converted similarly to host-model
    - optional features are updated according to host's CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Add x86FeatureInData
Jiri Denemark [Tue, 28 Jun 2016 10:23:48 +0000 (12:23 +0200)]
cpu: Add x86FeatureInData

The function checks CPUID data for a given feature.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Report error for unknown features in x86HasFeature
Jiri Denemark [Tue, 28 Jun 2016 09:50:50 +0000 (11:50 +0200)]
cpu: Report error for unknown features in x86HasFeature

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Make x86ModelFromCPU a bit smarter
Jiri Denemark [Sat, 18 Jun 2016 09:19:17 +0000 (11:19 +0200)]
cpu: Make x86ModelFromCPU a bit smarter

x86ModelFromCPU is used to provide CPUID data for features matching
@policy. This patch allows callers to set @policy to -1 to get combined
CPUID for all CPU features (including those implicitly provided a CPU
model) specified in CPU def.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Make x86ModelFromCPU easier to read
Jiri Denemark [Sat, 18 Jun 2016 08:54:50 +0000 (10:54 +0200)]
cpu: Make x86ModelFromCPU easier to read

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Introduce virQEMUCapsIsCPUModeSupported
Jiri Denemark [Wed, 3 Aug 2016 14:22:30 +0000 (16:22 +0200)]
qemu: Introduce virQEMUCapsIsCPUModeSupported

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Introduce virQEMUCapsGetHostModel
Jiri Denemark [Wed, 22 Jun 2016 10:34:07 +0000 (12:34 +0200)]
qemu: Introduce virQEMUCapsGetHostModel

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoShow host model in domain capabilities
Jiri Denemark [Wed, 15 Jun 2016 14:45:47 +0000 (16:45 +0200)]
Show host model in domain capabilities

The domain capabilities XML is capable of showing whether each guest CPU
mode is supported or not with a possibility to provide additional
details. This patch enhances host-model capability to advertise the
exact CPU model which will be used as a host-model:

    <cpu>
        ...
        <mode name='host-model' supported='yes'>
            <model fallback='allow'>Broadwell</model>
            <vendor>Intel</vendor>
            <feature policy='disable' name='aes'/>
            <feature policy='require' name='vmx'/>
        </mode>
        ...
    </cpu>

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Drop false support for ARM cpu-model
Jiri Denemark [Tue, 21 Jun 2016 14:02:07 +0000 (16:02 +0200)]
cpu: Drop false support for ARM cpu-model

The ARM CPU driver wrongly reported host CPU model as "host", which made
host-model to be just an alias for host-passthrough. Let's drop this
insanity.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Store host-model CPU in qemu capabilities
Jiri Denemark [Wed, 15 Jun 2016 12:35:18 +0000 (14:35 +0200)]
qemu: Store host-model CPU in qemu capabilities

Host capabilities provide libvirt's view of the host CPU, but for a
useful support for host-model CPUs we really need a hypervisor's view of
the CPU. And since the view can be differ with emulator, qemu
capabilities is the best place to store the host CPU model.

This patch just copies the CPU model from host capabilities, but this
will change in the future.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoconf: Introduce virCPUDefCopyModelFilter
Jiri Denemark [Tue, 28 Jun 2016 08:44:20 +0000 (10:44 +0200)]
conf: Introduce virCPUDefCopyModelFilter

The function filters all CPU features through a given callback while
copying CPU model related parts of a CPU definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoconf: Introduce virCPUDefStealModel
Jiri Denemark [Thu, 23 Jun 2016 10:54:19 +0000 (12:54 +0200)]
conf: Introduce virCPUDefStealModel

The function moves CPU model related parts from one CPU definition to
another. It can be used to avoid unnecessary copies from a temporary CPU
definitions which will be freed anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoconf: Introduce virCPUDefCopyWithoutModel
Jiri Denemark [Fri, 17 Jun 2016 07:44:43 +0000 (09:44 +0200)]
conf: Introduce virCPUDefCopyWithoutModel

Useful for copying a CPU definition without model related parts (i.e.,
without model name, feature list, vendor).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Propagate virCapsPtr to virQEMUCapsNewForBinaryInternal
Jiri Denemark [Wed, 15 Jun 2016 11:48:19 +0000 (13:48 +0200)]
qemu: Propagate virCapsPtr to virQEMUCapsNewForBinaryInternal

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoschema: Separate CPU related definitions into cputypes.rng
Jiri Denemark [Tue, 10 May 2016 14:17:08 +0000 (16:17 +0200)]
schema: Separate CPU related definitions into cputypes.rng

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agodomcaps: Add CPU usable flag
Jiri Denemark [Wed, 15 Jun 2016 14:15:44 +0000 (16:15 +0200)]
domcaps: Add CPU usable flag

In case a hypervisor is able to tell us a list of supported CPU models
and whether each CPU models can be used on the current host, we can
propagate this to domain capabilities. This is a better alternative
to calling virConnectCompareCPU for each supported CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agodomcaps: Show only CPU models supported by libvirt
Jiri Denemark [Fri, 29 Apr 2016 08:42:56 +0000 (10:42 +0200)]
domcaps: Show only CPU models supported by libvirt

Listing all CPU models supported by QEMU in domain capabilities makes
little sense when libvirt will refuse any model it doesn't know about.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Don't overwrite errors in cpuGetModels
Jiri Denemark [Thu, 16 Jun 2016 14:08:30 +0000 (16:08 +0200)]
cpu: Don't overwrite errors in cpuGetModels

cpuGetSubDriver already reports a useful error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpu: Special case models == NULL in cpuGetModels
Jiri Denemark [Tue, 14 Jun 2016 09:12:49 +0000 (11:12 +0200)]
cpu: Special case models == NULL in cpuGetModels

Some CPU drivers (such as arm) do not provide list of CPUs libvirt
supports and just pass any CPU model from domain XML directly to QEMU.
Such driver need to return models == NULL and success from cpuGetModels.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Fill in CPU domain capabilities
Jiri Denemark [Fri, 22 Apr 2016 20:22:30 +0000 (22:22 +0200)]
qemu: Fill in CPU domain capabilities

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Introduce virQEMUCapsGuestIsNative
Jiri Denemark [Tue, 14 Jun 2016 15:25:58 +0000 (17:25 +0200)]
qemu: Introduce virQEMUCapsGuestIsNative

To have a single place where we decide whether a guest can run natively
on a host.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Reorder CPU features
Jiri Denemark [Fri, 5 Aug 2016 12:42:15 +0000 (14:42 +0200)]
qemuxml2argvtest: Reorder CPU features

The x86 CPU driver translated each CPU definition from domain XML into
CPUID data and then back to CPU definition. This effectively sorted the
list of CPU features according to their CPUID values. Since this is
going to change, we need to reorder CPU features in a few test files to
make sure the generated QEMU command lines will not change.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Set correct architecture for KVM guests
Jiri Denemark [Thu, 4 Aug 2016 11:19:39 +0000 (13:19 +0200)]
qemuxml2argvtest: Set correct architecture for KVM guests

Testing PPC64/AArch64 KVM domains on x86_64 host only works because we
have a lot of bugs in our code. Since this series is going to fix them,
we need to make sure the host architecture matches guest for KVM
domains.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Properly setup CPU models in qemuCaps
Jiri Denemark [Thu, 4 Aug 2016 11:25:02 +0000 (13:25 +0200)]
qemuxml2argvtest: Properly setup CPU models in qemuCaps

Adding x86 CPU models into a list of supported CPUs for non-x86
architectures is not a very good idea. Each architecture we test needs
to maintain its own list of supported CPU models.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Separate guest CPU validation from command line creation
Jiri Denemark [Thu, 4 Aug 2016 06:25:55 +0000 (08:25 +0200)]
qemu: Separate guest CPU validation from command line creation

qemu_command.c should deal with translating our domain definition into a
QEMU command line and nothing else.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotestutilsqemu: Add default CPU for PPC64 architectures
Jiri Denemark [Tue, 13 Sep 2016 20:27:09 +0000 (22:27 +0200)]
testutilsqemu: Add default CPU for PPC64 architectures

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agotestutilsqemu: Helpers for changing host CPU and arch
Jiri Denemark [Thu, 4 Aug 2016 11:16:55 +0000 (13:16 +0200)]
testutilsqemu: Helpers for changing host CPU and arch

Changing a host architecture or a CPU is not as easy as assigning a new
value to the appropriate element in virCaps since there is a relation
between the CPU and host architecture (we don't really want to test
anything on an AArch64 host with core2duo CPU). This patch introduces
qemuTestSetHostArch and qemuTestSetHostCPU helpers which will make sure
the host architecture matches the host CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Properly initialize qemuCaps->arch
Jiri Denemark [Wed, 3 Aug 2016 10:26:41 +0000 (12:26 +0200)]
qemuxml2argvtest: Properly initialize qemuCaps->arch

qemuCaps->arch should match the guest architecture from domain XML.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Update qemuCaps after parsing domain XML
Jiri Denemark [Wed, 3 Aug 2016 10:21:19 +0000 (12:21 +0200)]
qemuxml2argvtest: Update qemuCaps after parsing domain XML

Some parts of qemuCaps depend on guest architecture, machine type, and
possibly other things that we know only once the domain XML has been
parsed. Let's move all these updates into a dedicated function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Reorder functions
Jiri Denemark [Wed, 3 Aug 2016 08:47:00 +0000 (10:47 +0200)]
qemuxml2argvtest: Reorder functions

testCompareXMLToArgv will soon need to call a few function which are
defined further in the code. Let's move them up a bit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Get rid of testCompareXMLToArgvHelper
Jiri Denemark [Wed, 3 Aug 2016 08:42:08 +0000 (10:42 +0200)]
qemuxml2argvtest: Get rid of testCompareXMLToArgvHelper

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Rename "out" labels as "cleanup"
Jiri Denemark [Wed, 3 Aug 2016 08:19:10 +0000 (10:19 +0200)]
qemuxml2argvtest: Rename "out" labels as "cleanup"

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemuxml2argvtest: Rename extraFlags as qemuCaps
Jiri Denemark [Wed, 3 Aug 2016 07:49:42 +0000 (09:49 +0200)]
qemuxml2argvtest: Rename extraFlags as qemuCaps

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agoqemu: Use virDomainCapsCPUModels for cpuDefinitions
Jiri Denemark [Thu, 21 Apr 2016 10:51:01 +0000 (12:51 +0200)]
qemu: Use virDomainCapsCPUModels for cpuDefinitions

The list of supported CPU models in domain capabilities is stored in
virDomainCapsCPUModels. Let's use the same object for storing CPU models
in QEMU capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agodomcaps: Add support for listing supported CPU models
Jiri Denemark [Fri, 22 Apr 2016 09:08:57 +0000 (11:08 +0200)]
domcaps: Add support for listing supported CPU models

The patch adds <cpu> element to domain capabilities XML:

    <cpu>
        <mode name='host-passthrough' supported='yes'/>
        <mode name='host-model' supported='yes'/>
        <mode name='custom' supported='yes'>
            <model>Broadwell</model>
            <model>Broadwell-noTSX</model>
            ...
        </mode>
    </cpu>

Applications can use it to inspect what CPU configuration modes are
supported for a specific combination of domain type, emulator binary,
guest architecture and machine type.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
8 years agocpuGetModels: Switch to virArch
Jiri Denemark [Fri, 29 Apr 2016 08:38:03 +0000 (10:38 +0200)]
cpuGetModels: Switch to virArch

Our internal APIs mostly use virArch rather than strings. Switching
cpuGetModels to virArch will save us from unnecessary conversions in the
future.

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