]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
9 years agoqemu: Fix access to auto-generated socket paths
Martin Kletzander [Fri, 7 Aug 2015 12:42:31 +0000 (14:42 +0200)]
qemu: Fix access to auto-generated socket paths

We are automatically generating some socket paths for domains, but all
those paths end up in a directory that's the same for multiple domains.
The problem is that multiple domains can each run with different
seclabels (users, selinux contexts, etc.).  The idea here is to create a
per-domain directory labelled in a way that each domain can access its
own unix sockets.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity_dac: Add SetDirLabel support
Martin Kletzander [Mon, 17 Aug 2015 18:15:58 +0000 (11:15 -0700)]
security_dac: Add SetDirLabel support

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity_selinux: Add SetDirLabel support
Martin Kletzander [Mon, 17 Aug 2015 18:07:07 +0000 (11:07 -0700)]
security_selinux: Add SetDirLabel support

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity_stack: Add SetDirLabel support
Martin Kletzander [Mon, 17 Aug 2015 18:01:12 +0000 (11:01 -0700)]
security_stack: Add SetDirLabel support

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity: Add virSecurityDomainSetDirLabel
Martin Kletzander [Mon, 17 Aug 2015 17:43:43 +0000 (10:43 -0700)]
security: Add virSecurityDomainSetDirLabel

That function can be used for setting security labels on arbitrary
directories.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity_dac: Label non-listening sockets
Martin Kletzander [Thu, 13 Aug 2015 05:36:30 +0000 (07:36 +0200)]
security_dac: Label non-listening sockets

SELinux security driver already does that, but DAC driver somehow missed
the memo.  Let's fix it so it works the same way.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agosecurity_selinux: Use proper structure to access socket data
Martin Kletzander [Thu, 13 Aug 2015 05:35:10 +0000 (07:35 +0200)]
security_selinux: Use proper structure to access socket data

In virSecuritySELinuxSetSecurityChardevLabel() we are labelling unix
socket path, but accessing another structure of the union.  This does
not pose a problem currently as both paths are at the same offset, but
this should be fixed for the future.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agolocking: Remove redundant 'srv' element from virLockDaemon
Erik Skultety [Thu, 20 Aug 2015 14:56:32 +0000 (16:56 +0200)]
locking: Remove redundant 'srv' element from virLockDaemon

Now that we have virNetDaemon object holding all the data and being
capable of referencing multiple servers, having a duplicate reference to
a single server stored in virLockDaemon isn't necessary anymore. This
patch removes the above described element.

9 years agotest: Replace tabs with spaces in virnetdaemondata json files
Erik Skultety [Thu, 6 Aug 2015 13:33:58 +0000 (15:33 +0200)]
test: Replace tabs with spaces in virnetdaemondata json files

JSON data that are used to initialize tests in virnetdaemontest should
be in a consistent format, i.e. not using tabs for indentation, those
should be replaced by spaces.

9 years agotests: Add some compatibility-related cases to the CPU tests
Andrea Bolognani [Fri, 14 Aug 2015 14:45:18 +0000 (16:45 +0200)]
tests: Add some compatibility-related cases to the CPU tests

9 years agocpu: Move check for NULL CPU model inside the driver
Andrea Bolognani [Fri, 14 Aug 2015 14:04:18 +0000 (16:04 +0200)]
cpu: Move check for NULL CPU model inside the driver

While the check is appropriate for eg. the x86 and generic drivers,
there are some valid ppc64 guest configurations where the CPU
model is supposed to be NULL.

Moving this check from the generic code to the drivers makes it
possible to accomodate both use cases.

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

9 years agocpu: Better support for ppc64 compatibility modes
Andrea Bolognani [Thu, 13 Aug 2015 15:50:37 +0000 (17:50 +0200)]
cpu: Better support for ppc64 compatibility modes

Not all combinations of host CPU models and compatibility modes
are valid, so we need to make sure we don't try to do something
that QEMU will reject.

Moreover, we need to apply a different logic to guests using
host-model and host-passthrough modes when testing them for host
compatibility.

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

9 years agocpu: Don't update host-model guest CPUs on ppc64
Andrea Bolognani [Thu, 13 Aug 2015 11:40:12 +0000 (13:40 +0200)]
cpu: Don't update host-model guest CPUs on ppc64

If a guest CPU is defined using

  <cpu mode='host-model'/>

the <model> sub-element will contain the compatibility mode to use.
That means we can't just copy the host CPU model on cpuUpdate(),
otherwise we'll overwrite that information and migration of such
guests will fail.

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

9 years agoAdd generated libvirt_admin.syms into .gitignore
Martin Kletzander [Thu, 20 Aug 2015 18:03:12 +0000 (11:03 -0700)]
Add generated libvirt_admin.syms into .gitignore

Commit a2c5d16a70a6161449c687be74db2813b362cf5e switched to generating
libvirt_admin.syms, but forgot to add the generated file into
.gitignore, hence causing tree pollution post-build.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoconf: Check for attach disk usage of iothread=0
John Ferlan [Wed, 12 Aug 2015 19:02:47 +0000 (15:02 -0400)]
conf: Check for attach disk usage of iothread=0

Since iothreadid = 0 is invalid, we need to check for it when attempting
to add a disk; otherwise, someone would think/believe their attempt to
add an IOThread to the disk would succeed. Luckily other code ignored
things when ->iothread == 0...

9 years agodocs: Drop unused rule for internals/%.html.tmp target
Guido Günther [Wed, 19 Aug 2015 10:35:31 +0000 (12:35 +0200)]
docs: Drop unused rule for internals/%.html.tmp target

We're using the %.html.tmp for all html files now so drop the unused one
and rather make sure the needed directory exists.

This fixes build failures as described in

    https://www.redhat.com/archives/libvir-list/2015-August/msg00603.html

9 years agolibvirt-admin: Generate symbols file
Guido Günther [Wed, 19 Aug 2015 08:38:31 +0000 (10:38 +0200)]
libvirt-admin: Generate symbols file

Since we're linking this into libvirtd we need some symbols to be public
but not part of the public API so mark them as
LIBVIRT_ADMIN_PRIVATE_<VERSION> as we do with libvirt.

Making all other symbols local makes sure we don't accidentally leak
unwanted ones.

9 years agodaemon: Use $(NULL) for libvird_admin's flags
Guido Günther [Wed, 19 Aug 2015 08:27:25 +0000 (10:27 +0200)]
daemon: Use $(NULL) for libvird_admin's flags

This makes it consistent with the other FLAGS in this file and reduced
clutter in the diff when adding new entries.

9 years agoutil: fix build without cgroup
Roman Bogorodskiy [Thu, 20 Aug 2015 06:42:56 +0000 (09:42 +0300)]
util: fix build without cgroup

Commit 89c509a0 added getters for cgroup block device I/O throttling,
however stub versions of these functions have not matching function
prototypes that result in compilation fail on platforms not supporting
cgroup.

Fix build by correcting prototypes of the stubbed functions.

Pushing under build-breaker rule.

9 years agovirconf: correct code formatting
Cao jin [Mon, 17 Aug 2015 12:42:03 +0000 (20:42 +0800)]
virconf: correct code formatting

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9 years agovirConfWalk: fix the inconsistent name
Cao jin [Wed, 19 Aug 2015 02:36:28 +0000 (10:36 +0800)]
virConfWalk: fix the inconsistent name

Fix inconsistency between function description and actual
parameter name.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
9 years agoqemu: Report better error message when renaming to existing domain name
Martin Kletzander [Tue, 18 Aug 2015 18:22:02 +0000 (11:22 -0700)]
qemu: Report better error message when renaming to existing domain name

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Sync BlkioDevice values when setting them in cgroups
Martin Kletzander [Mon, 3 Aug 2015 13:56:20 +0000 (15:56 +0200)]
qemu: Sync BlkioDevice values when setting them in cgroups

The problem here is that there are some values that kernel accepts, but
does not set them, for example 18446744073709551615 which acts the same
way as zero.  Let's do the same thing we do with other tuning options
and re-read them right after they are set in order to keep our internal
structures up-to-date.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agolxc: Sync BlkioDevice values when setting them in cgroups
Martin Kletzander [Mon, 3 Aug 2015 13:56:08 +0000 (15:56 +0200)]
lxc: Sync BlkioDevice values when setting them in cgroups

The problem here is that there are some values that kernel accepts, but
does not set them, for example 18446744073709551615 which acts the same
way as zero.  Let's do the same thing we do with other tuning options
and re-read them right after they are set in order to keep our internal
structures up-to-date.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoutil: Add getters for cgroup block device I/O throttling
Martin Kletzander [Mon, 3 Aug 2015 13:10:20 +0000 (15:10 +0200)]
util: Add getters for cgroup block device I/O throttling

Since now they were not needed, but I sense they will be in a short
while.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoutil: Add virCgroupGetBlockDevString
Martin Kletzander [Mon, 3 Aug 2015 12:44:14 +0000 (14:44 +0200)]
util: Add virCgroupGetBlockDevString

This function translates device paths to "major:minor " string, and all
virCgroupSetBlkioDevice* functions are modified to use it.  It's a
cleanup with no functional change.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoutil: Add virStringGetFirstWithPrefix
Martin Kletzander [Mon, 3 Aug 2015 12:03:23 +0000 (14:03 +0200)]
util: Add virStringGetFirstWithPrefix

That function takes string list and returns first string in that list
that starts with the @prefix parameter with that prefix being skipped as
the caller knows what it starts with (also for easier manipulation in
future).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemuDomainRename: Don't leave a domain locked uppon fail
Michal Privoznik [Tue, 18 Aug 2015 18:40:56 +0000 (20:40 +0200)]
qemuDomainRename: Don't leave a domain locked uppon fail

Well, yet again one case of 'goto cleanup' while 'goto endjob'
was needed. Sorry.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: Add check for invalid iothread_id in qemuDomainChgIOThread
John Ferlan [Thu, 13 Aug 2015 13:19:01 +0000 (09:19 -0400)]
qemu: Add check for invalid iothread_id in qemuDomainChgIOThread

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

Since iothread_id == 0 is an invalid value for QEMU let's point
that out specifically.  For the IOThreadDel code, the failure would
have ended up being a failure to find the IOThread ID; however, for
the IOThreadAdd code - an IOThread 0 was added and that isn't good.

It seems during many reviews/edits to the code the check for
iothread_id = 0 being invalid was lost - it could have originally
been in the API code, but requested to be moved - I cannot remember.

9 years agoapi: Adjust comment for virDomainAddIOThread
John Ferlan [Thu, 13 Aug 2015 13:18:48 +0000 (09:18 -0400)]
api: Adjust comment for virDomainAddIOThread

The comment for the function indicated that iothread_id had to be
a positive non-zero value; however, that wasn't checked - that is
a value of 0 is/was allowed by the API and was left up to the
hypervisor to reject the value.

More than likely this nuance was missed during the many "adjustments"
to the API in the review phase.

9 years agoapi: Remove check on iothread_id arg in virDomainPinIOThread
John Ferlan [Thu, 13 Aug 2015 12:44:32 +0000 (08:44 -0400)]
api: Remove check on iothread_id arg in virDomainPinIOThread

Allow 0 as an iothread_id and force the hypervisor to handle.
The qemuDomainPinIOThread API will look up the iothread_id of
0 and not find it and message that anyway.

9 years agoqemuDomainAddCgroupForThread: Don't overwrite the error
Luyao Huang [Fri, 14 Aug 2015 06:59:54 +0000 (14:59 +0800)]
qemuDomainAddCgroupForThread: Don't overwrite the error

Just like in commit 704cf06, if virCgroup*() fails, the error is
already reported. There's no need to overwrite the error with a
generic one and possibly hiding the true root cause of the error.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovirconf: fix the inconsistent name
Cao jin [Tue, 18 Aug 2015 12:38:07 +0000 (20:38 +0800)]
virconf: fix the inconsistent name

Fix inconsistency between function description and actual
parameter name in virConfGetValue/virConfSetValue.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
9 years agovirsh: Reset global error after successfull domain lookup
Luyao Huang [Mon, 17 Aug 2015 09:56:48 +0000 (17:56 +0800)]
virsh: Reset global error after successfull domain lookup

When looking up a domain, we try to look up by ID, UUID and NAME
consequently while not really caring which of those lookups succeeds.
The problem is that if any of them fails, we dispatch the error from the
driver and that means setting both threadlocal and global error. Let's
say the last lookup (by NAME) succeeds and resets the threadlocal error as any
other API does, however leaving the global error unchanged. If the underlying
virsh command does not succeed afterwards, our cleanup routine in
vshCommandRun ensures that no libvirt error will be forgotten and that's
exactly where this global error comes in incorrectly.

 # virsh domif-setlink 123 vnet1 up
 error: interface (target: vnet1) not found
 error: Domain not found: no domain with matching id 123

This patch also resets the global error which would otherwise cause some
minor confusion in reported error messages.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
9 years agobuild: fix mingw build
Eric Blake [Mon, 17 Aug 2015 23:03:40 +0000 (16:03 -0700)]
build: fix mingw build

Ever since commit e44b0269, 64-bit mingw compilation fails with:

../../src/util/virprocess.c: In function 'virProcessGetPids':
../../src/util/virprocess.c:628:50: error: passing argument 4 of 'virStrToLong_i' from incompatible pointer type [-Werror=incompatible-pointer-types]
         if (virStrToLong_i(ent->d_name, NULL, 10, &tmp_pid) < 0)
                                                  ^
In file included from ../../src/util/virprocess.c:59:0:
../../src/util/virstring.h:53:5: note: expected 'int *' but argument is of type 'pid_t * {aka long long int *}'
 int virStrToLong_i(char const *s,
     ^
cc1: all warnings being treated as errors

Although mingw won't be using this function, it does compile the
file, and the fix is relatively simple.

* src/util/virprocess.c (virProcessGetPids): Don't assume pid_t
fits in int.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agoqemuDomainRename: Explicitly check if domain is renaming to itself
Michal Privoznik [Fri, 14 Aug 2015 13:36:05 +0000 (15:36 +0200)]
qemuDomainRename: Explicitly check if domain is renaming to itself

It may happen that user (mistakenly) wants to rename a domain to
itself. Which is no renaming at all. We should reject that with
some meaningful error message.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirHashAddEntry: Report error on duplicate key
Michal Privoznik [Mon, 17 Aug 2015 19:01:07 +0000 (21:01 +0200)]
virHashAddEntry: Report error on duplicate key

If this function fails, the error message is reported only in
some cases (e.g. OOM), but in some it's not (e.g. duplicate key).
This fact is painful and we should either not report error at all
or report the error in all possible cases. I vote for the latter.
Unfortunately, since the key may be an arbitrary value (not
necessarily a string) we can't report it in the error message.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirHashAddOrUpdateEntry: Turn @new_name into void *
Michal Privoznik [Mon, 17 Aug 2015 19:07:40 +0000 (21:07 +0200)]
virHashAddOrUpdateEntry: Turn @new_name into void *

In 9190f0b0 we've tried to fix an OOM. And boy, was that fix
successful. But back then, the hash table implementation worked
strictly over string keys, which is not the case anymore. Hash
table have this function keyCopy() which returns void *.
Therefore a local variable that is temporarily holding the
intermediate return value from that function should be void *
too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agolibvirt-domain: forbid use virDomainRename in readonly connection
Luyao Huang [Mon, 17 Aug 2015 05:22:00 +0000 (13:22 +0800)]
libvirt-domain: forbid use virDomainRename in readonly connection

This function will change the guest name, we shouldn't
allow the readonly user do this.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovirsh: fix always return false in domrename
Luyao Huang [Mon, 17 Aug 2015 05:21:59 +0000 (13:21 +0800)]
virsh: fix always return false in domrename

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Resolve Coverity UNINIT
John Ferlan [Sat, 15 Aug 2015 13:15:42 +0000 (09:15 -0400)]
qemu: Resolve Coverity UNINIT

Coverity complained that 'vm' wasn't initialized before jumping to
cleanup: and calling virDomainObjEndAPI if the VIR_STRDUP fails.
So I initialized vm = NULL and also moved the VIR_STRDUP closer to
usage and used endjob for goto. Lots of other reasons for failures.

9 years agoprotocol: Don't use rename as a variable name
Martin Kletzander [Sat, 15 Aug 2015 14:44:38 +0000 (16:44 +0200)]
protocol: Don't use rename as a variable name

That causes shadowing errors on older compilers.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoRemove static keyword from vshReadline when readline does not exist
Moshe Levi [Sat, 15 Aug 2015 07:59:41 +0000 (10:59 +0300)]
Remove static keyword from vshReadline when readline does not exist

This patch removes the static keyword from the vshReadline which was
introduced in commit 834c5720e4434f0bcc807bb1cf20855af63e24a3. With
readline the vshReadline function is not static but when compiling
without readline it was defined as static which caused compilation
error.

9 years agotools: Introduce new client generic module vsh
Erik Skultety [Mon, 15 Jun 2015 16:53:58 +0000 (18:53 +0200)]
tools: Introduce new client generic module vsh

In order to share as much virsh' logic as possible with upcomming
virt-admin client we need to split virsh logic into virsh specific and
client generic features.

Since majority of virsh methods should be generic enough to be used by
other clients, it's much easier to rename virsh specific data to virshX
than doing this vice versa. It moved generic virsh commands (including info
and opts structures) to generic module vsh.c.

Besides renaming methods and structures, this patch also involves introduction
of a client specific control structure being referenced as private data in the
original control structure, introduction of a new global vsh Initializer,
which currently doesn't do much, but there is a potential for added
functionality in the future.
Lastly it introduced client hooks which are especially necessary during
client connecting phase.

9 years agoqemu: Implement virDomainRename
Tomas Meszaros [Mon, 10 Aug 2015 19:59:18 +0000 (21:59 +0200)]
qemu: Implement virDomainRename

Currently supports only renaming inactive domains without snapshots.

Signed-off-by: Tomas Meszaros <exo@tty.sk>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoIntroduce new VIR_DOMAIN_EVENT_DEFINED_RENAMED event
Tomas Meszaros [Mon, 10 Aug 2015 19:59:17 +0000 (21:59 +0200)]
Introduce new VIR_DOMAIN_EVENT_DEFINED_RENAMED event

This should be emitted whenever a domain is renamed.

Signed-off-by: Tomas Meszaros <exo@tty.sk>
9 years agodomain_conf: Introducde virDomainObjListRenameAddNew() & virDomainObjListRenameRemove()
Tomas Meszaros [Mon, 10 Aug 2015 19:59:16 +0000 (21:59 +0200)]
domain_conf: Introducde virDomainObjListRenameAddNew() & virDomainObjListRenameRemove()

We just need to update the entry in the second hash table. Since commit 8728a56
we have two hash tables for the domain list so that we can do O(1) lookup
regardless of looking up by UUID or name. Since with renaming a domain UUID does
not change, we only need to update the second hash table, where domains are
referenced by their name.

We will call both functions from the qemuDomainRename().

Signed-off-by: Tomas Meszaros <exo@tty.sk>
9 years agovirsh: Implement "domrename" command
Tomas Meszaros [Mon, 10 Aug 2015 19:59:15 +0000 (21:59 +0200)]
virsh: Implement "domrename" command

This patch implements new virsh command, domrename.

Using domrename, it will be possible to rename domain from the virsh shell by
calling virRenameDomain API.

It takes two arguments, current domain name and new domain name.

Example:

virsh # list --all
 Id    Name                           State
 ----------------------------------------------------
  -     bar                            shut off

virsh # domrename bar foo
Domain successfully renamed

virsh # list --all
 Id    Name                           State
 ----------------------------------------------------
  -     foo                            shut off

virsh #

Signed-off-by: Tomas Meszaros <exo@tty.sk>
9 years agoIntroduce virDomainRename API
Tomas Meszaros [Mon, 10 Aug 2015 19:59:14 +0000 (21:59 +0200)]
Introduce virDomainRename API

Also, among with this new API new ACL that restricts rename
capability is invented too.

Signed-off-by: Tomas Meszaros <exo@tty.sk>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoDetect location of qemu-bridge-helper
Guido Günther [Thu, 13 Aug 2015 10:20:29 +0000 (12:20 +0200)]
Detect location of qemu-bridge-helper

RedHat and Debian based distros use different locations

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790935

9 years agoCheck if qemu-bridge-helper exists and is executable
Guido Günther [Thu, 13 Aug 2015 12:19:50 +0000 (14:19 +0200)]
Check if qemu-bridge-helper exists and is executable

Otherwise the error is just

    error: Failed to create domain from test1.xml
    error: failed to retrieve file descriptor for interface: Transport endpoint is not connected

since we don't get a sensible error after the fork.

9 years agoconf: Remove 'vmdef' from virDomainHostdevDefParseXML
John Ferlan [Fri, 19 Jun 2015 19:03:50 +0000 (15:03 -0400)]
conf: Remove 'vmdef' from virDomainHostdevDefParseXML

Since it's not used, let's remove it to avoid any future usage.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Use numad information when getting pin information
Martin Kletzander [Sun, 26 Jul 2015 16:49:02 +0000 (18:49 +0200)]
qemu: Use numad information when getting pin information

Pinning information returned for emulatorpin and vcpupin calls is being
returned from our data without querying cgroups for some time.  However,
not all the data were utilized.  When automatic placement is used the
information is not returned for the calls mentioned above.  Since the
numad hint in private data is properly saved/restored, we can safely use
it to return true information.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Keep numad hint after daemon restart
Martin Kletzander [Fri, 24 Jul 2015 14:06:33 +0000 (16:06 +0200)]
qemu: Keep numad hint after daemon restart

The numad hint stored in priv->autoNodeset is information that gets lost
during daemon restart.  And because we would like to use that
information in the future, we also need to save it in the status XML.
For the sake of tests, we need to initialize nnumaCell_max to some
value, so that the restoration doesn't fail in our test suite.  There is
no need to fill in the actual numa cell data since the recalculating
function virCapabilitiesGetCpusForNodemask() will not fail, it will just
skip filling the data in the bitmap which we don't use in tests anyway.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoconf: Pass private data to Parse function of XML options
Martin Kletzander [Fri, 24 Jul 2015 17:35:00 +0000 (19:35 +0200)]
conf: Pass private data to Parse function of XML options

This needs a reorder of XML option definitions.  It might come in handy
one day.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Fix segfault when parsing private domain data
Martin Kletzander [Thu, 13 Aug 2015 08:03:12 +0000 (10:03 +0200)]
qemu: Fix segfault when parsing private domain data

When parsing private domain data, there are two paths that are flawed.
They are both error paths, just from different parts of the function.
One of them can call free() on an uninitialized pointer.  Initialization
to NULL is enough here.  The other one is a bit trickier to explain, but
as easy as the first one to fix.  We create capabilities, parse them and
then assign them into the private data pointer inside the domain object.
If, however, we get to fail from now on, the error path calls unrefs the
capabilities and then, when the domain object is being cleaned,
qemuDomainObjPrivateFree() tries to unref them as well.  That causes a
segfault.  Settin the pointer to NULL upon successful addition to the
private data is enough.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoconf: Check for hostdev conflicts when assign default disk address
John Ferlan [Mon, 22 Jun 2015 19:13:39 +0000 (15:13 -0400)]
conf: Check for hostdev conflicts when assign default disk address

https://bugzilla.redhat.com/show_bug.cgi?id=1210587  (completed)

When generating the default drive address for a SCSI <disk> device,
check the generated address to ensure it doesn't conflict with a SCSI
<hostdev> address. The <disk> address generation algorithm uses the
<target> "dev" name in order to determine which controller and unit
in order to place the device. Since a SCSI <hostdev> device doesn't
require a target device name, its placement on the guest SCSI address
"could" conflict.  For instance, if a SCSI <hostdev> exists at
controller=0 unit=0 and an attempt to hotplug 'sda' into the guest
made, there would be a conflict if the <hostdev> is already using
/dev/sda.

9 years agoconf: Create locals for virDomainDiskDefAssignAddress
John Ferlan [Thu, 16 Jul 2015 15:29:03 +0000 (11:29 -0400)]
conf: Create locals for virDomainDiskDefAssignAddress

Create local controller/bus variables to be used by a future patch

9 years agoconf: Add SCSI hostdev check for disk drive address already in use
John Ferlan [Wed, 12 Aug 2015 19:30:45 +0000 (15:30 -0400)]
conf: Add SCSI hostdev check for disk drive address already in use

https://bugzilla.redhat.com/show_bug.cgi?id=1210587  (partial)

If a SCSI subsystem <hostdev> element address is provided, we need to
make sure the address provided doesn't conflict with an existing or
libvirt generated address for a SCSI <disk> element. We can handle
this condition in device post processing since we're not generating an
address based on some target name - rather it's either generated based
on space or provided from the user. If the user provides one that conflicts,
then we need to disallow the change.

This will fix the issue where the domain XML provided an <address> for
the <hostdev>, but not the <disk> element where the address provided
ends up being the same address used for the <disk>. A <disk> address
is generated using it's assigned <target> 'dev' name prior to the
check/validation of the <hostdev> address value.

9 years agoDrive hot-unplug: reliable parsing of HMP results
Frank Schreuder [Mon, 10 Aug 2015 15:37:30 +0000 (17:37 +0200)]
Drive hot-unplug: reliable parsing of HMP results

Hot-unplugging a disk from a guest that supports hot-unplugging generates an error
in the libvirt log when running QEMU with the "-msg timestamp=on" flag.

2015-08-06 10:48:59.945+0000: 11662: error : qemuMonitorTextDriveDel:2594 :
operation failed: deleting drive-virtio-disk4 drive failed:
2015-08-06T10:48:59.945058Z Device 'drive-virtio-disk4' not found

This error is caused because the HMP results are getting prefixed with a timestamp.
Parsing the output is not reliable with STRPREFIX as the results can be prefixed with a timestamp.

Using strstr ensures that parsing the output works whether the results are prefixed or not.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Frank Schreuder <fschreuder@transip.nl>
9 years agoRevert "qemu: Allow to plug virtio-net-pci into PCIe slot"
Laine Stump [Tue, 11 Aug 2015 23:07:53 +0000 (19:07 -0400)]
Revert "qemu: Allow to plug virtio-net-pci into PCIe slot"

This reverts commit ede34470fde19c0f326cdb0dfca39fa86fd9ec16, which
was apparently written based on testing performed before commits
1e15be1 and 9a12b6 were pushed upstream. Once those two patches are in
place, commit ede34470 is redundant, and can even cause
incorrect/unexpected behavior when auto-assigning addresses for
virtio-net devices.

9 years agocmdAttachInterface: Fully implement @floor support
Michal Privoznik [Wed, 12 Aug 2015 08:38:12 +0000 (10:38 +0200)]
cmdAttachInterface: Fully implement @floor support

In my previous commit d7f5c88961b52 I tried to introduce support
for inbound.floor. But the code change was incomplete. This is
the change needed to fully enable the feature.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agonetworkBandwidthGenericChecks: Drop useless check
Michal Privoznik [Wed, 12 Aug 2015 08:34:39 +0000 (10:34 +0200)]
networkBandwidthGenericChecks: Drop useless check

There's a check right at the beginning of the function that
shortcuts if the function was called over all NULL arguments.
However, this was meant just as a fool-proof check so that we
don't crash if function is used in a bad manner. Anyway, it makes
Coverity unhappy as it then thinks any of the arguments could be
NULL. Well, with the current state of the code it can't.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agonetworkBandwidthUpdate: Don't blindly dereference pointers
Michal Privoznik [Wed, 12 Aug 2015 08:25:48 +0000 (10:25 +0200)]
networkBandwidthUpdate: Don't blindly dereference pointers

It may happen that an interface don't have any bandwidth set and
a new one is to be set. In that case, @ifaceBand will be NULL.
This will cause troubles later in the code when deciding what to
do.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirsh: Refactor parseRateStr to avoid false-positive uninitialized variable
Peter Krempa [Wed, 12 Aug 2015 05:31:33 +0000 (07:31 +0200)]
virsh: Refactor parseRateStr to avoid false-positive uninitialized variable

Commit 6983d6d2 tried to improve parseRateStr but broke the build
instead for compilers that were not able to properly introspect the for
loop indexed by the enum resulting into the following error:

virsh-domain.c: In function 'parseRateStr':
virsh-domain.c:916:13: error: 'field_name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             vshError(ctl, _("malformed %s field"), field_name);
             ^
virsh-domain.c:915:13: error: 'tmp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         if (virStrToLong_ullp(token, NULL, 10, tmp) < 0) {
             ^
Rather than trying to fix the code, refactor the function again by
reusing virStringSplit.

9 years agodomain: Fix crash if trying to live update disk <serial>
Cole Robinson [Mon, 10 Aug 2015 23:01:43 +0000 (19:01 -0400)]
domain: Fix crash if trying to live update disk <serial>

If you pass <disk><serial> XML to UpdateDevice, and the original device
didn't have a <serial> block, libvirtd crashes trying to read the original
NULL serial string.

Use _NULLABLE string comparisons to avoid the crash. A couple other
properties needed the change too.

9 years agoqemu: fix qemuDomainSupportsPCI() for ARM machines of "virt" machinetype
Laine Stump [Tue, 11 Aug 2015 18:56:21 +0000 (14:56 -0400)]
qemu: fix qemuDomainSupportsPCI() for ARM machines of "virt" machinetype

Commit e8d5517 updated the domain post-parse to automatically add
pcie-root et al for certain ARM "virt" machinetypes, but didn't update
the function qemuDomainSupportsPCI() which is called later on when we
are auto-assigning PCI addresses and default settings for the PCI
controller <model> and <target> attributes. The result was that PCI
addresses weren't assigned, and the controllers didn't have their
attribute default values set, leading to an error when the domain was
started, e.g.:

  internal error: autogenerated dmi-to-pci-bridge options not set

This patch adds the same check made in the earlier patch to
qemuDomainSupportsPCI(), so that PCI address auto-assignment and
target/model default values will be set.

9 years agovirNetSocketCheckProtocols: handle EAI_NONAME as IPv6 unavailable
Guido Günther [Tue, 11 Aug 2015 09:49:18 +0000 (11:49 +0200)]
virNetSocketCheckProtocols: handle EAI_NONAME as IPv6 unavailable

When running the test suite using "unshare -n" we might have IPv6 but no
configured addresses. Due to AI_ADDRCONFIG getaddrinfo then fails with
EAI_NONAME which we should then treat as IPv6 unavailable.

9 years agoutil: don't overwrite stack when getting ethtool gfeatures
Laine Stump [Tue, 11 Aug 2015 17:45:46 +0000 (13:45 -0400)]
util: don't overwrite stack when getting ethtool gfeatures

This fixes the crash described here:

 https://www.redhat.com/archives/libvir-list/2015-August/msg00162.html

In short, we were calling ioctl(SIOCETHTOOL) pointing to a too-short
object that was a local on the stack, resulting in the memory past the
end of the object being overwritten. This was because the struct used
by the ETHTOOL_GFEATURES command of SIOCETHTOOL ends with a 0-length
array, but we were telling ethtool that it could use 2 elements on the
array.

The fix is to allocate the necessary memory with VIR_ALLOC_VAR(),
including the extra length needed for a 2 element array at the end.

9 years agocpu: Fix segfault in the ppc64 driver
Andrea Bolognani [Tue, 11 Aug 2015 15:51:28 +0000 (17:51 +0200)]
cpu: Fix segfault in the ppc64 driver

Commit adb865d introduced some changes in ppc64DriverNodeData()
that cause libvirtd to crash on startup unless this patch is
applied as well.

9 years agoqemu: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR
Michal Privoznik [Sat, 1 Aug 2015 07:47:46 +0000 (09:47 +0200)]
qemu: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR

Well, there are just two places that needs adjustment:

qemuDomainGetInterfaceParameters - to report the @floor
qemuDomainSetInterfaceParameters - now that the function has been
fixed, we can allow updating @floor too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirsh: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR
Michal Privoznik [Sat, 1 Aug 2015 07:48:04 +0000 (09:48 +0200)]
virsh: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR

We have a function parseRateStr() that parses --inbound and
--outbound arguments to both attach-interface and domiftune.
Now that we have all virTypedParams macros needed for QoS,
lets parse even floor attribute. The extended format for the
arguments looks like this then:

  --inbound average[,peak[,burst[,floor]]]

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoIntroduce VIR_DOMAIN_BANDWIDTH_IN_FLOOR
Michal Privoznik [Sat, 1 Aug 2015 07:47:07 +0000 (09:47 +0200)]
Introduce VIR_DOMAIN_BANDWIDTH_IN_FLOOR

This macro represents the single missing field we don't expose
yet within QoS: inbound.floor.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirsh: Rework parseRateStr
Michal Privoznik [Sat, 1 Aug 2015 06:13:54 +0000 (08:13 +0200)]
virsh: Rework parseRateStr

The function is used to parse a tuple delimited by commas into
virNetDevBandwidth structure. So far only three out of fore
fields are supported: average, peak and burst. The single missing
field is floor. Well, the parsing works, but I think we can do
better. Especially when we will need to parse floor too in very
close future.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemuDomainSetInterfaceParameters: Use new functions to update bandwidth
Michal Privoznik [Fri, 31 Jul 2015 15:31:39 +0000 (17:31 +0200)]
qemuDomainSetInterfaceParameters: Use new functions to update bandwidth

As sketched in previous commits, imagine the following scenario:

  virsh # domiftune gentoo vnet0
  inbound.average: 100
  inbound.peak   : 0
  inbound.burst  : 0
  outbound.average: 100
  outbound.peak  : 0
  outbound.burst : 0

  virsh # domiftune gentoo vnet0 --inbound 0

  virsh # shutdown gentoo
  Domain gentoo is being shutdown

  virsh # list --all
  error: Failed to list domains
  error: Cannot recv data: Connection reset by peer

  Program received signal SIGSEGV, Segmentation fault.
  0x00007fffe80ea221 in networkUnplugBandwidth (net=0x7fff9400c1a0, iface=0x7fff940ea3e0) at network/bridge_driver.c:4881
  4881            net->floor_sum -= ifaceBand->in->floor;

This is rather unfortunate. We should not SIGSEGV here. The
problem is, that while in the second step the inbound QoS was
cleared out, the network part of it was not updated (moreover, we
don't report that vnet0 had inbound.floor set). Internal
structure therefore still had some fragments left (e.g.
class_id). So when qemuProcessStop() started to clean up the
environment it got to networkUnplugBandwidth(). Here, class_id is
set therefore function assumes that there is an inbound QoS. This
actually is a fair assumption to make, there's no need for a
special QoS box in network's QoS when there's no QoS to set.
Anyway, the problem is not the networkUnplugBandwidth() rather
than qemuDomainSetInterfaceParameters() which completely forgot
about QoS being disperse (some parts are set directly on
interface itself, some on bridge the interface is plugged into).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agobridge_driver: Introduce networkBandwidthUpdate
Michal Privoznik [Fri, 31 Jul 2015 15:31:20 +0000 (17:31 +0200)]
bridge_driver: Introduce networkBandwidthUpdate

So, if a domain vNIC's bandwidth has been successfully set, it's
possible that because @floor is set on network's bridge, this
part may need updating too. And that's exactly what this function
does. While the previous commit introduced a function to check if
@floor can be satisfied, this does all the hard work. In general,
there may be three, well four possibilities:

  1) No change in @floor value (either it remain unset, or its
  value hasn't changed)

  2) The @floor value has changed from a non-zero to a non-zero
  value

  3) New @floor is to be set

  4) Old @floor must be cleared out

The difference between 2), 3) and 4) is, that while in 2) the QoS
tree on the network's bridge already has a special class for the
vNIC, in 3) the class must be created from scratch. In 4) it must
be removed. Fortunately, we have helpers for all three
interesting cases.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agobridge_driver: Introduce networkBandwidthChangeAllowed
Michal Privoznik [Fri, 31 Jul 2015 15:02:10 +0000 (17:02 +0200)]
bridge_driver: Introduce networkBandwidthChangeAllowed

When a domain vNIC's bandwidth is to be changed (at runtime) it is
possible that guaranteed minimal bandwidth (@floor) will change too.
Well, so far it is, because we still don't have an implementation that
allows setting it dynamically, so it's effectively erased on:

    #virsh domiftune $dom vnet0 --inbound 0

However, that's slightly unfortunate. We do some checks on domain
startup to see if @floor can be guaranteed. We ought do the same if
QoS is changed at runtime.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirNetDevBandwidthUpdateRate: turn class_id into integer
Michal Privoznik [Fri, 31 Jul 2015 15:44:13 +0000 (17:44 +0200)]
virNetDevBandwidthUpdateRate: turn class_id into integer

This is no functional change. It's just that later in the series we
will need to pass class_id as an integer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirNetDevParseMcast: Avoid magic constant
Michal Privoznik [Sat, 1 Aug 2015 05:43:58 +0000 (07:43 +0200)]
virNetDevParseMcast: Avoid magic constant

There is no guarantee that an enum start it mapped onto a value
of zero. However, we are guaranteed that enum items are
consecutive integers. Moreover, it's a pity to define an enum to
avoid using magical constants but then using them anyway.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoconf: Don't try formating non-existing addresses
Martin Kletzander [Tue, 11 Aug 2015 13:09:29 +0000 (15:09 +0200)]
conf: Don't try formating non-existing addresses

Commit a6f9af8292b6 added checking for address colisions between
starting and ending addresses of forwarding addresses, but forgot that
there might be no addresses set at all.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agotests: Add a bunch of cpu test case for ppc64
Andrea Bolognani [Fri, 7 Aug 2015 15:39:21 +0000 (17:39 +0200)]
tests: Add a bunch of cpu test case for ppc64

The test cases cover the cpuCompare(), cpuBaseline() and
cpuNodeData() implementation.

9 years agotests: Re-enable ppc64 cpu tests
Andrea Bolognani [Fri, 7 Aug 2015 15:39:20 +0000 (17:39 +0200)]
tests: Re-enable ppc64 cpu tests

Now that all the changes have been implemented we can run the
test cases once again, after updating them to reflect the new
behaviour.

9 years agocpu: Forbid model fallback in the ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:19 +0000 (17:39 +0200)]
cpu: Forbid model fallback in the ppc64 driver

Unlike what happens on x86, on ppc64 you can't mix and match CPU
features to obtain the guest CPU you want regardless of the host
CPU, so the concept of model fallback doesn't apply.

Make sure CPU definitions emitted by the driver, eg. as output of
the cpuBaseline() and cpuUpdate() calls, reflect this fact.

9 years agocpu: Implement backwards compatibility in the ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:18 +0000 (17:39 +0200)]
cpu: Implement backwards compatibility in the ppc64 driver

All previously recognized CPU models (POWER7_v2.1, POWER7_v2.3,
POWER7+_v2.1 and POWER8_v1.0) are internally converted to the
corrisponding generation name so that existing guests don't stop
working.

9 years agocpu: Add POWER8NVL information to CPU map XML
Andrea Bolognani [Fri, 7 Aug 2015 15:39:17 +0000 (17:39 +0200)]
cpu: Add POWER8NVL information to CPU map XML

This is yet another variation of POWER8. The PVR information comes
from arch/powerpc/kernel/cputable.c in the Linux kernel tree.

9 years agocpu: Parse and use PVR masks in the ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:16 +0000 (17:39 +0200)]
cpu: Parse and use PVR masks in the ppc64 driver

Instead of relying on a hard-coded mask value, read it from the CPU
map XML and use it when looking up models by PVR.

9 years agocpu: Simplify ppc64 part of CPU map XML
Andrea Bolognani [Fri, 7 Aug 2015 15:39:15 +0000 (17:39 +0200)]
cpu: Simplify ppc64 part of CPU map XML

Use multiple PVRs per CPU model to reduce the number of models we
need to keep track of.

Remove specific CPU models (eg. POWER7+_v2.1): the corresponding
generic CPU model (eg. POWER7) should be used instead to ensure
the guest can be booted on any compatible host.

Get rid of all the entries that did not match any of the CPU
models supported by QEMU, like power8 and power8e.

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

9 years agocpu: Support multiple PVRs in the ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:14 +0000 (17:39 +0200)]
cpu: Support multiple PVRs in the ppc64 driver

This will allow us to perform PVR matching more broadly, eg. consider
both POWER8 and POWER8E CPUs to be the same even though they have
different PVR values.

9 years agocpu: Align ppc64 CPU data with x86
Andrea Bolognani [Fri, 7 Aug 2015 15:39:13 +0000 (17:39 +0200)]
cpu: Align ppc64 CPU data with x86

Use a typedef instead of the plain struct and heap allocation. This
will make it easier to extend the ppc64 specific CPU data later on.

9 years agotests: Temporarily disable ppc64 cpu tests
Andrea Bolognani [Fri, 7 Aug 2015 15:39:12 +0000 (17:39 +0200)]
tests: Temporarily disable ppc64 cpu tests

The upcoming commits will make heavy modifications to the ppc64
driver, split so that it's easier to review the changes.

Instead of updating the test cases so that they pass, possibly
only to update them again with the following commit, disable them
for the time being.

Another commit will update them all in one go once all required
changes are in place.

9 years agocpu: Use ppc64Compute() to implement ppc64DriverCompare()
Andrea Bolognani [Fri, 7 Aug 2015 15:39:11 +0000 (17:39 +0200)]
cpu: Use ppc64Compute() to implement ppc64DriverCompare()

This ensures comparison of two CPU definitions will be consistent
regardless of the fact that it is performed using cpuCompare() or
cpuGuestData(). The x86 driver uses the same exact code.

9 years agocpu: CPU model names have to match on ppc64
Andrea Bolognani [Fri, 7 Aug 2015 15:39:10 +0000 (17:39 +0200)]
cpu: CPU model names have to match on ppc64

Limitations of the POWER architecture mean that you can't run
eg. a POWER7 guest on a POWER8 host when using KVM. This applies
to all guests, not just those using VIR_CPU_MATCH_STRICT in the
CPU definition; in fact, exact and strict CPU matching are
basically the same on ppc64.

This means, of course, that hosts using different CPUs have to be
considered incompatible as well.

Change ppc64Compute(), called by cpuGuestData(), to reflect this
fact and update test cases accordingly.

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

9 years agocpu: Never skip CPU model name check in ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:09 +0000 (17:39 +0200)]
cpu: Never skip CPU model name check in ppc64 driver

ppc64Compute(), called by cpuNodeData(), is used not only to retrieve
the driver-specific data associated to a guest CPU definition, but
also to check whether said guest CPU is compatible with the host CPU.

If the user is not interested in the CPU data, it's perfectly fine
to pass a NULL pointer instead of a return location, and the
compatibility data returned should not be affected by this. One of
the checks, specifically the one on CPU model name, was however
only performed if the return location was non-NULL.

9 years agotests: Improve result handling in cpuTestGuestData()
Andrea Bolognani [Fri, 7 Aug 2015 15:39:08 +0000 (17:39 +0200)]
tests: Improve result handling in cpuTestGuestData()

A test is considered successful if the obtained result matches
the expected result: if that's not the case, whether because a
test that was expected to succeed failed or because a test that
was supposed to fail succeeded, then something's not right and
we want the user to know about this.

On the other hand, if a failure that's unrelated to the bits
we're testing occurs, then the user should be notified even if
the test was expected to fail.

Use different values to tell these two situations apart.

Fix a test case that was wrongly expected to fail as well.

9 years agotests: Remove unused file
Andrea Bolognani [Fri, 7 Aug 2015 15:39:07 +0000 (17:39 +0200)]
tests: Remove unused file

No functional changes.

9 years agocpu: Remove ISA information from CPU map XML
Andrea Bolognani [Fri, 7 Aug 2015 15:39:06 +0000 (17:39 +0200)]
cpu: Remove ISA information from CPU map XML

The information is not used anywhere in libvirt.

No functional changes.

9 years agocpu: Reorder functions in the ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:05 +0000 (17:39 +0200)]
cpu: Reorder functions in the ppc64 driver

Having the functions grouped together this way will avoid further
shuffling around down the line.

No functional changes.

9 years agocpu: Simplify ppc64ModelFromCPU()
Andrea Bolognani [Fri, 7 Aug 2015 15:39:04 +0000 (17:39 +0200)]
cpu: Simplify ppc64ModelFromCPU()

9 years agocpu: Simplify NULL handling in ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:03 +0000 (17:39 +0200)]
cpu: Simplify NULL handling in ppc64 driver

Use briefer checks, eg. (!model) instead of (model == NULL), and
avoid initializing to NULL a pointer that would be assigned in
the first line of the function anyway.

Also remove a pointless NULL assignment.

No functional changes.

9 years agocpu: Mark driver functions in ppc64 driver
Andrea Bolognani [Fri, 7 Aug 2015 15:39:02 +0000 (17:39 +0200)]
cpu: Mark driver functions in ppc64 driver

Use the ppc64Driver prefix for all functions that are used to
fill in the cpuDriverPPC64 structure, ie. those that are going
to be called by the generic CPU code.

This makes it clear which functions are exported and which are
implementation details; it also gets rid of the ambiguity that
affected the ppc64DataFree() function which, despite what the
name suggested, was not related to ppc64DataCopy() and could
not be used to release the memory allocated for a
virCPUppc64Data* instance.

No functional changes.