]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agoqemu_domain: add a PPC64 memLockLimit helper
Daniel Henrique Barboza [Tue, 5 Mar 2019 12:46:07 +0000 (09:46 -0300)]
qemu_domain: add a PPC64 memLockLimit helper

There is a lot of documentation in the comments about how PPC64 handles
passthrough VFIO devices to calculate the @memLockLimit. And more will
be added with the PPC64 NVLink2 support code.

Let's remove the PPC64 code from qemuDomainGetMemLockLimitBytes()
body and put it into a helper function. This will simplify the
flow of qemuDomainGetMemLockLimitBytes() that handles all the other
platforms and improves readability of the PPC64 specifics.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemu: domain: Simplify non-VFIO memLockLimit calculation for PPC64
Daniel Henrique Barboza [Tue, 5 Mar 2019 12:46:06 +0000 (09:46 -0300)]
qemu: domain: Simplify non-VFIO memLockLimit calculation for PPC64

@passthroughLimit is being calculated even if @usesVFIO is false. After
that, an if-else conditional is used to check if we're going to sum it
up with @baseLimit.

This patch initializes @passthroughLimit to zero and always returns
@memKB = @baseLimit + @passthroughLimit. The conditional is then used to
calculate @passthroughLimit if @usesVFIO == true. This results in some
cycles being spared for the @usesVFIO == false scenario, but the real
motivation is to make the code simpler to add an alternative formula to
calculate @passthroughLimit for NVLink2.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoutil: enable cgroups v2 cpuset controller for threads
Pavel Hrdina [Wed, 20 Feb 2019 12:50:23 +0000 (13:50 +0100)]
util: enable cgroups v2 cpuset controller for threads

When we create cgroup for qemu threads we need to enable cpuset
controller in order to use it.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoutil: implement virCgroupV2(Set|Get)CpusetCpus
Pavel Hrdina [Tue, 19 Feb 2019 14:55:38 +0000 (15:55 +0100)]
util: implement virCgroupV2(Set|Get)CpusetCpus

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoutil: implement virCgroupV2(Set|Get)CpusetMemoryMigrate
Pavel Hrdina [Tue, 19 Feb 2019 14:53:34 +0000 (15:53 +0100)]
util: implement virCgroupV2(Set|Get)CpusetMemoryMigrate

Cgroups v2 don't have memory_migrate interface and the migration is
enabled by default.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoutil: implement virCgroupV2(Set|Get)CpusetMems
Pavel Hrdina [Tue, 19 Feb 2019 14:42:51 +0000 (15:42 +0100)]
util: implement virCgroupV2(Set|Get)CpusetMems

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovirmock: Initialize both symbols in VIR_MOCK_REAL_INIT_ALT
Michal Privoznik [Tue, 26 Feb 2019 09:12:05 +0000 (10:12 +0100)]
virmock: Initialize both symbols in VIR_MOCK_REAL_INIT_ALT

It may happen that both symbols are present. Especially when
chaining mocks. For instance if a test is using virpcimock and
then both stat and __xstat would be present in the address space
as virpcimock implements both. Then, if the test would try to use
say virfilewrapper (which again uses VIR_MOCK_REAL_INIT_ALT() to
init real_stat and real___xstat) it would find stat() from
virpcimock and stop there. The virfilewrapper.c:real___xstat
wouldn't be initialized and thus it may result in a segfault.

The reason for segfault is that sys/stat.h may redefine stat() to
call __xstat().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agodocs: remove Google+ link from page footer
Daniel P. Berrangé [Thu, 7 Mar 2019 11:06:37 +0000 (11:06 +0000)]
docs: remove Google+ link from page footer

Google is shutting down Google+, with no replacement, in the very near
future so we are losing the Libvirt community group there.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agorpm: add dep on xfsprogs-devel for reflink support
Daniel P. Berrangé [Tue, 5 Feb 2019 12:12:40 +0000 (12:12 +0000)]
rpm: add dep on xfsprogs-devel for reflink support

Support for XFS reflink clone was added in:

  commit 8ed874b39b3c330bbcdff434e08995dbb4467285
  Author: Julio Faracco <jcfaracco@gmail.com>
  Date:   Fri Jul 6 10:43:01 2018 -0300

    storage: Rename btrfsCloneFile to support other filesystems.

  commit 2e11298f938672c5430193277c98b9474a68b1fb
  Author: Julio Faracco <jcfaracco@gmail.com>
  Date:   Fri Jul 6 10:43:00 2018 -0300

    configure: Adding XFS library/headers check.

But these patches missed that the xfs/xfs.h header is not installed
unless you have xfsprogs-devel present.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agotests: use VIR_AUTOUNREF in storagepoolcapstest
Pavel Hrdina [Thu, 7 Mar 2019 11:12:11 +0000 (12:12 +0100)]
tests: use VIR_AUTOUNREF in storagepoolcapstest

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agocaps: drop requiredSourceElements from storage pool capabilities
Pavel Hrdina [Wed, 6 Mar 2019 17:59:39 +0000 (18:59 +0100)]
caps: drop requiredSourceElements from storage pool capabilities

Capabilities should not duplicate data that are obvious from our
documentation and will not change with different QEMU binaries
or the way how we compile libvirt.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agotests: invert the return logic in storagepoolcapstest
Pavel Hrdina [Wed, 6 Mar 2019 18:14:16 +0000 (19:14 +0100)]
tests: invert the return logic in storagepoolcapstest

This way if the first test "full" fails we will run the second test as
well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agotests: use virTestCompareToFile in storagepoolcapstest
Pavel Hrdina [Wed, 6 Mar 2019 18:02:08 +0000 (19:02 +0100)]
tests: use virTestCompareToFile in storagepoolcapstest

This will allow to use VIR_TEST_REGENERATE_OUTPUT.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoUse virStringHasSuffix() where possible
Andrea Bolognani [Thu, 7 Mar 2019 08:40:54 +0000 (09:40 +0100)]
Use virStringHasSuffix() where possible

When dealing with internal paths we don't need to worry about
whether or not suffixes are lowercase since we have full control
over them, which means we can avoid performing case-insensitive
string comparisons.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: Add virStringHasSuffix()
Andrea Bolognani [Wed, 6 Mar 2019 16:05:03 +0000 (17:05 +0100)]
util: Add virStringHasSuffix()

This is the case-sensitive counterpart of the existing
virStringHasCaseSuffix() function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: Rename virFileMatchesNameSuffix() to virStringMatchesNameSuffix()
Andrea Bolognani [Wed, 6 Mar 2019 14:45:15 +0000 (15:45 +0100)]
util: Rename virFileMatchesNameSuffix() to virStringMatchesNameSuffix()

Despite its name, this is really just a general-purpose string
manipulation function, so it should be moved to the virstring
module and renamed accordingly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: Rename virFileStripSuffix() to virStringStripSuffix()
Andrea Bolognani [Wed, 6 Mar 2019 14:30:04 +0000 (15:30 +0100)]
util: Rename virFileStripSuffix() to virStringStripSuffix()

Despite its name, this is really just a general-purpose string
manipulation function, so it should be moved to the virstring
module and renamed accordingly.

A few trivial whitespace changes are squashed in.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: Rename virFileHasSuffix() to virStringHasCaseSuffix()
Andrea Bolognani [Wed, 6 Mar 2019 14:07:26 +0000 (15:07 +0100)]
util: Rename virFileHasSuffix() to virStringHasCaseSuffix()

Despite its name, this is really just a general-purpose string
manipulation function, so it should be moved to the virstring
module and renamed accordingly.

In addition to the obvious s/File/String/, also tweak the name
to make it clear that the presence of the suffix is verified
using case-insensitive comparison.

A few trivial whitespace changes are squashed in.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoDrop some useless comparisons and checks
Michal Privoznik [Wed, 27 Feb 2019 14:03:10 +0000 (15:03 +0100)]
Drop some useless comparisons and checks

In these cases the check that is removed has been done a few
lines above already (as can even be seen in the context). Drop
them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoapparmor: Add ptrace and signal rules for named profile
Jim Fehlig [Fri, 1 Mar 2019 22:05:36 +0000 (15:05 -0700)]
apparmor: Add ptrace and signal rules for named profile

Commit a3ab6d42 changed the libvirtd profile to a named profile
but neglected to accommodate the change in the qemu profile
ptrace and signal rules. As a result, libvirtd is unable to
signal confined qemu processes and hence unable to shutdown
or destroy VMs.

Add ptrace and signal rules that reference the libvirtd profile
by name in addition to full binary path.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Jamie Strandboge <jamie@canonical.com>
6 years agodocs: Add news article
John Ferlan [Thu, 7 Feb 2019 20:33:29 +0000 (15:33 -0500)]
docs: Add news article

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Expose virConnectGetStoragePoolCapabilities
John Ferlan [Thu, 7 Feb 2019 17:02:53 +0000 (12:02 -0500)]
virsh: Expose virConnectGetStoragePoolCapabilities

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

Add a new storage pool command "pool-capabilities" to output
the storage pool capabilities.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agostorage: Introduce storageConnectGetStoragePoolCapabilities
John Ferlan [Thu, 7 Feb 2019 17:03:08 +0000 (12:03 -0500)]
storage: Introduce storageConnectGetStoragePoolCapabilities

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

Create the storage driver code to generate the output for the
storage pool capabilities XML.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolibvirt: Introduce virConnectGetStoragePoolCapabilities
John Ferlan [Thu, 7 Feb 2019 17:02:25 +0000 (12:02 -0500)]
libvirt: Introduce virConnectGetStoragePoolCapabilities

Introduce the API to expose the storage pool capabilities along
with all the remote munglement required to hook up the client.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agodocs: Add description for Storage Pool Capabilities
John Ferlan [Thu, 7 Feb 2019 20:26:00 +0000 (15:26 -0500)]
docs: Add description for Storage Pool Capabilities

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotests: Introduce storage pool capabilites test
John Ferlan [Thu, 7 Feb 2019 17:07:16 +0000 (12:07 -0500)]
tests: Introduce storage pool capabilites test

Add a new test for the storage pool capabilities. There will be
one test mocked with every backend available (full) and one where
only the file system pool is available.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Add storage pool capability formatting
John Ferlan [Thu, 7 Feb 2019 17:29:43 +0000 (12:29 -0500)]
conf: Add storage pool capability formatting

Add support to format the storage pool capabilities using
the virStoragePoolTypeInfoPtr to determine what capabilities
exist for the various pools and the driver capabilities to
determine whether the pool is compiled in and supported.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agodocs: Add schema for storage pool capabilities
John Ferlan [Thu, 7 Feb 2019 17:29:15 +0000 (12:29 -0500)]
docs: Add schema for storage pool capabilities

Define a schema for the storage pool capabilities along with
a test to show the general format.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agostorage: Process storage pool capabilities
John Ferlan [Thu, 10 Jan 2019 12:23:26 +0000 (07:23 -0500)]
storage: Process storage pool capabilities

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

During storage driver backend initialization, let's save
which backends are available in the storage pool capabilities.

In order to format those, we need add a connectGetCapabilities
processor to the storageHypervisorDriver. This allows a storage
connection, such as "storage:///system" to find the API and
format the results, such as:

  virsh -c storage:///system capabilities

  <capabilities>

    <pool>
      <enum name='type'>
        <value>dir</value>
        <value>fs</value>
        <value>netfs</value>
        <value>logical</value>
        <value>iscsi</value>
        <value>iscsi-direct</value>
        <value>scsi</value>
        <value>mpath</value>
        <value>disk</value>
        <value>rbd</value>
        <value>sheepdog</value>
        <value>gluster</value>
        <value>zfs</value>
      </enum>
    </pool>

  </capabilities>

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Introduce storage pool functions into capabilities
John Ferlan [Thu, 10 Jan 2019 12:19:35 +0000 (07:19 -0500)]
conf: Introduce storage pool functions into capabilities

Introduce the bare bones functions to processing capability
data for the storage driver.

Since there will be no need for the <host> output, we need
to filter that data.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agodocs: Fix a few storage.html.in typos
John Ferlan [Thu, 7 Feb 2019 20:23:35 +0000 (15:23 -0500)]
docs: Fix a few storage.html.in typos

Fix the ZFS Valid Volume Format Types label and add the
Valid pool format types for Vstorage pools.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove defaultFormat from VIR_STORAGE_POOL_ZFS
John Ferlan [Thu, 7 Feb 2019 18:48:43 +0000 (13:48 -0500)]
conf: Remove defaultFormat from VIR_STORAGE_POOL_ZFS

The ZFS pool is documented as not using pool format types, so remove
the defaultFormat value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove volOptions for VIR_STORAGE_POOL_MPATH
John Ferlan [Wed, 6 Feb 2019 22:18:57 +0000 (17:18 -0500)]
conf: Remove volOptions for VIR_STORAGE_POOL_MPATH

The multipath pool is documented as not using the volume type,
so let's just remove it.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove volOptions for VIR_STORAGE_POOL_ISCSI[_DIRECT]
John Ferlan [Wed, 6 Feb 2019 22:14:35 +0000 (17:14 -0500)]
conf: Remove volOptions for VIR_STORAGE_POOL_ISCSI[_DIRECT]

The iscsi and iscsi-direct pools are documented as not using
the volume type, so let's just remove it. Besides it would
have produced bad output since formatting uses the Disk types.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove volOptions for VIR_STORAGE_POOL_SCSI
John Ferlan [Wed, 6 Feb 2019 22:05:33 +0000 (17:05 -0500)]
conf: Remove volOptions for VIR_STORAGE_POOL_SCSI

The scsi pool is documented as not using the volume type,
so let's just remove it.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove volOptions for VIR_STORAGE_POOL_RBD
John Ferlan [Wed, 6 Feb 2019 22:03:42 +0000 (17:03 -0500)]
conf: Remove volOptions for VIR_STORAGE_POOL_RBD

The rbd pool is documented as not using the volume type,
so let's just remove it.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Remove volOptions for VIR_STORAGE_POOL_SHEEPDOG
John Ferlan [Wed, 6 Feb 2019 21:57:28 +0000 (16:57 -0500)]
conf: Remove volOptions for VIR_STORAGE_POOL_SHEEPDOG

The sheepdog pool is documented as not using the volume type,
so let's just remove it.  Besides it would have produced bad
results since the defaultType is FILE but the formatting used
the Disk types.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: domain: Use VIR_XPATH_NODE_AUTORESTORE where appropriate
Peter Krempa [Tue, 5 Mar 2019 15:21:36 +0000 (16:21 +0100)]
conf: domain: Use VIR_XPATH_NODE_AUTORESTORE where appropriate

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Move XPath context node in descendants of virSysinfoParseXML
Peter Krempa [Tue, 5 Mar 2019 14:38:26 +0000 (15:38 +0100)]
conf: Move XPath context node in descendants of virSysinfoParseXML

Rather than moving the XPath root node in the caller and then still
passing it down, make sure that the callees move the node themselves.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: domain: Use VIR_AUTOCLEAN(virBuffer) where appropriate
Peter Krempa [Tue, 5 Mar 2019 14:10:01 +0000 (15:10 +0100)]
conf: domain: Use VIR_AUTOCLEAN(virBuffer) where appropriate

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Use virXMLFormatElement in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 13:37:11 +0000 (14:37 +0100)]
conf: Use virXMLFormatElement in virDomainDefFormatFeatures

Remove logic necessary to figure out whether to format the 'features'
element by using virXMLFormatElement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor formating of 'capabilities' features
Peter Krempa [Tue, 5 Mar 2019 12:48:20 +0000 (13:48 +0100)]
conf: Refactor formating of 'capabilities' features

Use virXMLFormatElement for the formatting which allows us to avoid
looking through the array to see if any feature is enabled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Avoid formatting empty <capabilities> element
Peter Krempa [Tue, 5 Mar 2019 12:56:46 +0000 (13:56 +0100)]
conf: Avoid formatting empty <capabilities> element

If none of the 'capabilities' features are enabled we'd still format the
opening and closing tag for the <capabilities element.

The implementation is suboptimal but will be refactored for a better
approach. This is done prior to the refactor to show that tests are not
impacted.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Avoid extra scope when formatting 'smm' feature
Peter Krempa [Tue, 5 Mar 2019 12:35:21 +0000 (13:35 +0100)]
conf: Avoid extra scope when formatting 'smm' feature

Use an early break and remove the temporary variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Avoid extra set of temp buffers in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 12:33:05 +0000 (13:33 +0100)]
conf: Avoid extra set of temp buffers in virDomainDefFormatFeatures

Use the top level set of temp buffers to do the job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Simplify lifecycle of temp buffers in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 12:27:45 +0000 (13:27 +0100)]
conf: Simplify lifecycle of temp buffers in virDomainDefFormatFeatures

Use VIR_AUTOCLEAN to avoid leaking the buffer on error path and get rid
of resetting mid loop since virXMLFormatElement does the reset
internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Remove impossible error in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 12:21:39 +0000 (13:21 +0100)]
conf: Remove impossible error in virDomainDefFormatFeatures

'i' is always in range of the enum, thus the name is always populated by
virDomainFeatureTypeToString.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Rename temp buffers in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 12:17:31 +0000 (13:17 +0100)]
conf: Rename temp buffers in virDomainDefFormatFeatures

These buffers are used temporarily for some of the partial formatters
but not globally. Prefix the name with 'tmp' to be explicit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor control flow in virDomainDefFormatFeatures
Peter Krempa [Tue, 5 Mar 2019 12:07:40 +0000 (13:07 +0100)]
conf: Refactor control flow in virDomainDefFormatFeatures

Use an early return to avoid one level of nesting scopes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Split out domain features formatting from virDomainDefFormatInternal
Peter Krempa [Tue, 5 Mar 2019 12:01:26 +0000 (13:01 +0100)]
conf: Split out domain features formatting from virDomainDefFormatInternal

Pure code motion of code for formatting domain features to a function
called virDomainDefFormatFeatures. Best viewed with the '--patience'
option for git show.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: refactor formatting of 'blkiotune' from virDomainDefFormatInternal
Peter Krempa [Tue, 5 Mar 2019 11:50:36 +0000 (12:50 +0100)]
conf: refactor formatting of 'blkiotune' from virDomainDefFormatInternal

Split out the code into a separate function named
virDomainDefFormatBlkiotune and use virXMLFormatElement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor virDomainHubDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor virDomainHubDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor virDomainInputDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor virDomainInputDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor formatting of 'driver' in virDomainRNGDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor formatting of 'driver' in virDomainRNGDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor virDomainPanicDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor virDomainPanicDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor virDomainWatchdogDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor virDomainWatchdogDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Refactor virDomainMemballoonDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:17:31 +0000 (10:17 +0100)]
conf: Refactor virDomainMemballoonDefFormat

Use virXMLFormatElement to format the internals along with simplifying
cleanup code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Use virXMLFormatElement in virDomainControllerDefFormat
Peter Krempa [Tue, 5 Mar 2019 09:01:37 +0000 (10:01 +0100)]
conf: Use virXMLFormatElement in virDomainControllerDefFormat

Refactor the function to use the XML formatting aid and use automatic
cleaning to simplify the control flow.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: Use virXMLFormatElement in virDomainControllerDriverFormat
Peter Krempa [Tue, 5 Mar 2019 08:51:03 +0000 (09:51 +0100)]
conf: Use virXMLFormatElement in virDomainControllerDriverFormat

Refactor adding of the controller <driver> element.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoutil: xml: Enforce return value check from virXMLFormatElement
Peter Krempa [Fri, 22 Feb 2019 16:36:23 +0000 (17:36 +0100)]
util: xml: Enforce return value check from virXMLFormatElement

The function does not transfer errors from 'attrBuf' and 'childBuf'
arguments into 'buf', but rather reports them right away, thus we need
to make sure that it's always checked.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Don't set migration caps when changing postcopy bandwidth
Jiri Denemark [Tue, 5 Mar 2019 21:16:03 +0000 (22:16 +0100)]
qemu: Don't set migration caps when changing postcopy bandwidth

The qemuMigrationParamsApply internal API was designed to apply all
migration parameters and capabilities before we start to migrate a
domain. While migration parameters are only passed to QEMU when we
explicitly want to set a specific value, capabilities are always either
enabled or disabled.

Thus when this API is called outside migration job, e.g., via a call to
qemuDomainMigrateSetMaxSpeed with VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY
flag, we would call migrate-set-capabilities and disable all
capabilities. However, changing capabilities while migration is already
running does not make sense and our code should never be trying to do
so. In fact QEMU even reports an error if migrate-set-capabilities is
called during migration and qemuDomainMigrateSetMaxSpeed would fail
with:

    internal error: unable to execute QEMU command
    migrate-set-capabilities: There's a migration process in progress

With this patch qemuMigrationParamsApply never tries to call
migrate-set-capabilities outside of migration job. When the capabilities
bitmap is all zeros (which is its initial value after
qemuMigrationParamsNew), we just skip the command. But when any
capability bit is set to 1 by a non-migration job, we report an error to
highlight a bug in our code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
6 years agosecurity: aa-helper: gl devices in sysfs at arbitrary depth
Christian Ehrhardt [Tue, 5 Mar 2019 12:38:38 +0000 (13:38 +0100)]
security: aa-helper: gl devices in sysfs at arbitrary depth

Further testing with more devices showed that we sometimes have a
different depth of pci device paths when accessing sysfs for device
attributes.

But since the access is limited to a set of filenames and read only it
is safe to use a wildcard for that.

Related apparmor denies - while we formerly had only considered:
apparmor="DENIED" operation="open"
  name="/sys/devices/pci0000:00/0000:00:02.1/uevent"
  requested_mask="r"

We now also know of cases like:
apparmor="DENIED" operation="open"
  name="/sys/devices/pci0000:00/0000:00:03.1/0000:1c:00.0/uevent"
  requested_mask="r"

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1817943
Acked-by: Jamie Strandboge <jamie@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
6 years agosecurity: aa-helper: nvidia rules for gl devices
Christian Ehrhardt [Fri, 1 Mar 2019 06:25:59 +0000 (07:25 +0100)]
security: aa-helper: nvidia rules for gl devices

Further testing with different devices showed that we need more rules
to drive gl backends with nvidia cards. Related denies look like:

apparmor="DENIED" operation="open"
  name="/usr/share/egl/egl_external_platform.d/"
  requested_mask="r"
apparmor="DENIED" operation="open"
  name="/proc/modules"
  requested_mask="r"
apparmor="DENIED" operation="open"
  name="/proc/driver/nvidia/params"
  requested_mask="r"
apparmor="DENIED" operation="mknod"
  name="/dev/nvidiactl"
  requested_mask="c"

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1817943
Acked-by: Jamie Strandboge <jamie@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
6 years agoRevert "Separate out StateAutoStart from StateInitialize"
Michal Privoznik [Fri, 1 Mar 2019 14:22:40 +0000 (15:22 +0100)]
Revert "Separate out StateAutoStart from StateInitialize"

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

This reverts commit e4a969092bda5b3b952963fdf6658895165040b7.

Now that drivers may call virConnectOpen() on secondary drivers, it
doesn't make much sense to have autostart separated from driver
initialization callback. In fact, it creates a problem because one
driver during its initialization might try to fetch an object from
another driver but since the object is yet to be autostarted the fetch
fails. This has been observed in reality: qemu driver performs
qemuProcessReconnect() during qemu's stateInitialize phase which may
call virDomainDiskTranslateSourcePool() which connects to the storage
driver to look up the volume. But the storage driver did not autostart
its pools yet therefore volume lookup fails and the domain is killed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoRevert "virStateDriver - Separate AutoStart from Initialize"
Michal Privoznik [Fri, 1 Mar 2019 14:16:45 +0000 (15:16 +0100)]
Revert "virStateDriver - Separate AutoStart from Initialize"

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

This reverts commit cefb97fb815c81fc882da752f45effd23bcb9b4b.

The stateAutoStart callback will be removed in the next commit.
Therefore move autostarting of domains, networks and storage
pools back into stateInitialize callbacks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agobhyve: Move autostarting of domains into bhyveStateInitialize
Michal Privoznik [Fri, 1 Mar 2019 14:01:13 +0000 (15:01 +0100)]
bhyve: Move autostarting of domains into bhyveStateInitialize

The stateAutoStart callback will go away shortly. Therefore, move
the autostart call into state initialize callback.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agodaemon: Register secret driver before storage driver
Michal Privoznik [Fri, 1 Mar 2019 14:48:53 +0000 (15:48 +0100)]
daemon: Register secret driver before storage driver

The order in which drivers are registered is important because
their stateInitialize and stateAutoStart callback are called in
that order. Well, stateAutoStart is going away and therefore if
there is some dependency between two drivers (e.g. when
initializing storage driver expects secret driver to be available
already), the registration of such drivers must happen in correct
order.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agodocs: Fix version number
Andrea Bolognani [Tue, 5 Mar 2019 16:08:47 +0000 (17:08 +0100)]
docs: Fix version number

virtio-(non-)transitional device models have been introduced
in 5.2.0, not 5.1.0.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
6 years agocpu_map: Add more signatures for Skylake-Client CPU models
Jiri Denemark [Tue, 26 Feb 2019 20:02:49 +0000 (21:02 +0100)]
cpu_map: Add more signatures for Skylake-Client CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Broadwell CPU models
Jiri Denemark [Fri, 22 Feb 2019 13:45:24 +0000 (14:45 +0100)]
cpu_map: Add more signatures for Broadwell CPU models

This fixes several CPUs which were incorrectly detected as
Skylake-Client.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Haswell CPU models
Jiri Denemark [Tue, 26 Feb 2019 11:06:05 +0000 (12:06 +0100)]
cpu_map: Add more signatures for Haswell CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for IvyBridge CPU models
Jiri Denemark [Tue, 26 Feb 2019 11:22:00 +0000 (12:22 +0100)]
cpu_map: Add more signatures for IvyBridge CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for SandyBridge CPU models
Jiri Denemark [Tue, 26 Feb 2019 19:26:35 +0000 (20:26 +0100)]
cpu_map: Add more signatures for SandyBridge CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Westmere CPU model
Jiri Denemark [Mon, 25 Feb 2019 15:44:11 +0000 (16:44 +0100)]
cpu_map: Add more signatures for Westmere CPU model

This fixes several CPUs which were incorrectly detected as a different
CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Nehalem CPU models
Jiri Denemark [Tue, 26 Feb 2019 11:59:37 +0000 (12:59 +0100)]
cpu_map: Add more signatures for Nehalem CPU models

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Penryn CPU model
Jiri Denemark [Tue, 26 Feb 2019 11:59:50 +0000 (12:59 +0100)]
cpu_map: Add more signatures for Penryn CPU model

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add more signatures for Conroe CPU model
Jiri Denemark [Tue, 26 Feb 2019 09:45:56 +0000 (10:45 +0100)]
cpu_map: Add more signatures for Conroe CPU model

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Test CPU signatures
Jiri Denemark [Mon, 25 Feb 2019 09:05:34 +0000 (10:05 +0100)]
cputest: Test CPU signatures

The signature computation code is not too complicated and it will likely
never change so testing it is not very important. We do it mostly for a
nice side effect of easily accessible signature numbers for all CPU
data files.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_map: Add hex representation of signatures
Jiri Denemark [Tue, 26 Feb 2019 08:22:36 +0000 (09:22 +0100)]
cpu_map: Add hex representation of signatures

The family/model numbers are nice for humans or for comparing with
/proc/cpuinfo, but sometimes there's a need to see the CPUID
representation of the signature. Let's add it into a comment for each
signature in out cpu_map XMLs as the conversion is not exactly
straightforward.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Add virCPUx86DataGetSignature for tests
Jiri Denemark [Mon, 25 Feb 2019 09:04:21 +0000 (10:04 +0100)]
cpu_x86: Add virCPUx86DataGetSignature for tests

The function exports the functionality of x86DataToSignatureFull and
x86MakeSignature to the test suite.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_capabilities: Use virQEMUCapsGetCPUModelInfo
Jiri Denemark [Mon, 25 Feb 2019 09:00:53 +0000 (10:00 +0100)]
qemu_capabilities: Use virQEMUCapsGetCPUModelInfo

Most places in qemu_capabilities.c which call virQEMUCapsGetHostCPUData
actually need qemuMonitorCPUModelInfoPtr from QEMU caps. Let's use the
wrapper introduced in the previous commit instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_capabilities: Introduce virQEMUCapsGetCPUModelInfo
Jiri Denemark [Mon, 25 Feb 2019 09:01:34 +0000 (10:01 +0100)]
qemu_capabilities: Introduce virQEMUCapsGetCPUModelInfo

This is a simple wrapper around virQEMUCapsGetHostCPUData usable in
tests for getting qemuMonitorCPUModelInfoPtr from QEMU caps.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_capabilities: Inroduce virQEMUCapsGetCPUModelX86Data
Jiri Denemark [Mon, 25 Feb 2019 08:39:17 +0000 (09:39 +0100)]
qemu_capabilities: Inroduce virQEMUCapsGetCPUModelX86Data

The code for transforming qemuMonitorCPUModelInfo data from QEMU into
virCPUDefPtr consumable by virCPU* APIs was hidden inside
virQEMUCapsInitCPUModelX86. This patch moves it into a new function to
make it usable in tests.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Log decoded CPU model and signatures
Jiri Denemark [Mon, 4 Mar 2019 15:37:31 +0000 (16:37 +0100)]
cpu_x86: Log decoded CPU model and signatures

The log message may be useful when debugging why a specific CPU model
was selected for a given set of CPUID data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Allow multiple signatures for a CPU model
Jiri Denemark [Fri, 22 Feb 2019 16:20:59 +0000 (17:20 +0100)]
cpu_x86: Allow multiple signatures for a CPU model

CPU signatures in the cpu_map serve as a hint for CPUID to CPU model
matching algorithm. If the CPU signatures matches any CPU model in the
cpu_map, this model will be the preferred one.

This works out well and solved several mismatches, but in real world
CPUs which should match a single CPU model may be produced with several
different signatures. For example, low voltage Broadwell CPUs for
laptops and Broadwell CPUs for servers differ in CPU model numbers while
we should detect them all as Broadwell CPU model.

This patch adds support for storing several signatures for a single CPU
model to make this hint useful for more CPUs. Later commits will provide
additional signatures for existing CPU models, which will correct some
results in our CPU test suite.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Store CPU signature in an array
Jiri Denemark [Mon, 4 Mar 2019 15:36:33 +0000 (16:36 +0100)]
cpu_x86: Store CPU signature in an array

In preparation for storing several CPU signatures in a single CPU model,
we need to turn virCPUx86Model's signature into an array of signatures.

The parser still hardcodes the number of signatures to 1, but the
following patch will drop this limit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Add x86ModelCopySignatures helper
Jiri Denemark [Mon, 4 Mar 2019 15:18:42 +0000 (16:18 +0100)]
cpu_x86: Add x86ModelCopySignatures helper

Introduce a helper for copying CPU signature between two CPU models.

It's not very useful until the way we store signatures is changed in the
next patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Make sure CPU model names are unique in cpu_map
Jiri Denemark [Tue, 26 Feb 2019 07:33:08 +0000 (08:33 +0100)]
cpu_x86: Make sure CPU model names are unique in cpu_map

Having multiple CPU model definitions with the same name could result in
unexpected behavior.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Separate feature list parsing from x86ModelParse
Jiri Denemark [Fri, 22 Feb 2019 15:36:02 +0000 (16:36 +0100)]
cpu_x86: Separate feature list parsing from x86ModelParse

The code is separated into a new x86ModelParseFeatures function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Separate vendor parsing from x86ModelParse
Jiri Denemark [Fri, 22 Feb 2019 14:33:53 +0000 (15:33 +0100)]
cpu_x86: Separate vendor parsing from x86ModelParse

The code is separated into a new x86ModelParseVendor function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Separate signature parsing from x86ModelParse
Jiri Denemark [Fri, 22 Feb 2019 14:32:44 +0000 (15:32 +0100)]
cpu_x86: Separate signature parsing from x86ModelParse

The code is separated into a new x86ModelParseSignature function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu_x86: Separate ancestor model parsing from x86ModelParse
Jiri Denemark [Fri, 22 Feb 2019 14:22:29 +0000 (15:22 +0100)]
cpu_x86: Separate ancestor model parsing from x86ModelParse

The code is separated into a new x86ModelParseAncestor function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Add data for Intel(R) Core(TM) i7-8700
Jiri Denemark [Mon, 4 Mar 2019 15:45:48 +0000 (16:45 +0100)]
cputest: Add data for Intel(R) Core(TM) i7-8700

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Add data for Intel(R) Xeon(R) CPU E5-2650
Jiri Denemark [Wed, 27 Feb 2019 08:49:36 +0000 (09:49 +0100)]
cputest: Add data for Intel(R) Xeon(R) CPU E5-2650

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Add data for Intel(R) Xeon(R) CPU E7540
Jiri Denemark [Tue, 26 Feb 2019 20:22:25 +0000 (21:22 +0100)]
cputest: Add data for Intel(R) Xeon(R) CPU E7540

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Add data for Intel(R) Core(TM) i7-7600U
Jiri Denemark [Thu, 21 Feb 2019 21:14:53 +0000 (22:14 +0100)]
cputest: Add data for Intel(R) Core(TM) i7-7600U

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4
Jiri Denemark [Thu, 21 Feb 2019 20:51:58 +0000 (21:51 +0100)]
cputest: Add data for Intel(R) Xeon(R) CPU E5-2630 v4

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocputest: Make sure generated files pass syntax-check
Jiri Denemark [Wed, 27 Feb 2019 08:43:23 +0000 (09:43 +0100)]
cputest: Make sure generated files pass syntax-check

The tests/cputestdata/cpu-parse.sh would produce JSON files with QEMU
replies which wouldn't pass syntax-check. Let's fix this by not emitting
an extra new line after reformatting the JSON file.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: Add -inactive suffix when appropriate for qemuxml2xml
Andrea Bolognani [Thu, 28 Feb 2019 16:25:18 +0000 (17:25 +0100)]
tests: Add -inactive suffix when appropriate for qemuxml2xml

Some test cases are only executed using WHEN_INACTIVE, and the
output file name should reflect this for clarity.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: Use WHEN_BOTH in qemuxml2xml whenever possible
Andrea Bolognani [Thu, 28 Feb 2019 16:10:17 +0000 (17:10 +0100)]
tests: Use WHEN_BOTH in qemuxml2xml whenever possible

There are a few cases where we are using either WHEN_ACTIVE
or WHEN_INACTIVE even though WHEN_BOTH would work perfectly
fine: for those, start using the simpler DO_TEST() macro.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>