]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoTerminate backing chains explicitly
Peter Krempa [Thu, 12 Oct 2017 17:13:44 +0000 (19:13 +0200)]
Terminate backing chains explicitly

Express a properly terminated backing chain by putting a
virStorageSource of type VIR_STORAGE_TYPE_NONE in the chain. The newly
used helpers simplify this greatly.

The change fixes a bug as formatting an incomplete backing chain and
parsing it back would end up in expressing a terminated chain since
src->backingStoreRaw was not populated. By relying on the terminator
object this can be now processed appropriately.

7 years agoutil: storagefile: Add helpers to check presence of backing store
Peter Krempa [Thu, 12 Oct 2017 17:27:40 +0000 (19:27 +0200)]
util: storagefile: Add helpers to check presence of backing store

Add helpers that will simplify checking if a backing file is valid or
whether it has backing store. The helper virStorageSourceIsBacking
returns true if the given virStorageSource is a valid backing store
member. virStorageSourceHasBacking returns true if the virStorageSource
has a backing store child.

Adding these functions creates a central points for further refactors.

7 years agotest: set 'type' field of virStorageSource
Peter Krempa [Thu, 12 Oct 2017 18:45:50 +0000 (20:45 +0200)]
test: set 'type' field of virStorageSource

Set the type so that the iterators will work after upcoming
modification.

7 years agostorage: Fill in 'type' field for virStorageSource in storage driver
Peter Krempa [Thu, 12 Oct 2017 18:31:33 +0000 (20:31 +0200)]
storage: Fill in 'type' field for virStorageSource in storage driver

Storage driver uses virStorageSource only partially to store it's
configuration but fully when parsing backing files of storage volumes.
This patch sets the 'type' field to a value other than
VIR_STORAGE_TYPE_NONE so that further patches can add a terminator
element to backing chains without breaking iteration.

7 years agoutil: storagefile: Tolerate NULL path when looking up volume in chain
Peter Krempa [Thu, 12 Oct 2017 17:26:10 +0000 (19:26 +0200)]
util: storagefile: Tolerate NULL path when looking up volume in chain

chain->path may be NULL e.g. for NBD drives, so the check needs to avoid
dereferencing the path in such case

7 years agoutil: storage: use stored index to lookup disks
Peter Krempa [Fri, 6 Oct 2017 12:23:05 +0000 (14:23 +0200)]
util: storage: use stored index to lookup disks

We can now use the backing store ID directly rather than counting the
number of images seen while looking up images.

7 years agoutil: storage: Store backing chain index in virStorageSource
Peter Krempa [Fri, 6 Oct 2017 11:35:24 +0000 (13:35 +0200)]
util: storage: Store backing chain index in virStorageSource

The backing store indexes were not bound to the storage sources in any
way. To allow us to bind a given alias to a given storage source we need
to save the index in virStorageSource. The backing store ids are now
generated when detecting the backing chain.

Since we don't re-detect the backing chain after snapshots, the
numbering needs to be fixed there.

7 years agoconf: Make backing store index optional
Peter Krempa [Tue, 26 Sep 2017 12:00:57 +0000 (14:00 +0200)]
conf: Make backing store index optional

Index will remain an internal property even if we allow backing store
parsing from the XML, so we need to allow backing store without it in
the schema.

7 years agoconf: domain: Simplify return from backing store parser
Peter Krempa [Fri, 6 Oct 2017 10:50:30 +0000 (12:50 +0200)]
conf: domain: Simplify return from backing store parser

Use VIR_STEAL_PTR to remove conditional cleanup.

7 years agoqemu: argv: parse qemu commandline memory arguments
Kothapally Madhu Pavan [Mon, 9 Oct 2017 17:16:29 +0000 (22:46 +0530)]
qemu: argv: parse qemu commandline memory arguments

Existing qemuParseCommandLineMem() will parse "-m 4G" format string.
This patch allows it to parse "-m size=8126464k,slots=32,maxmem=33554432k"
format along with existing format. And adds a testcase to validate the changes.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
7 years agohyperv: Map Limit to max_memory and VirtualQuantity to cur_balloon
Ladi Prosek [Fri, 6 Oct 2017 06:47:35 +0000 (08:47 +0200)]
hyperv: Map Limit to max_memory and VirtualQuantity to cur_balloon

Hyper-V uses its own specific memory management so no mapping is going to
be perfect. However, it is more correct to map Limit to max_memory (it
really is the upper limit of what the VM may potentially use) and keep
cur_balloon equal to total_memory.

The typical value returned from Hyper-V in Limit is 1 TiB, which is not
really going to work if interpreted as "startup memory" to be ballooned
away later.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
7 years agohyperv: Escape WQL queries
Ladi Prosek [Fri, 6 Oct 2017 06:47:34 +0000 (08:47 +0200)]
hyperv: Escape WQL queries

The code was vulnerable to SQL injection. Likely not a security issue due to
WMI SQL and other constraints but still lame. For example:

  virsh # dominfo \"
  error: failed to get domain '"'
  error: internal error: SOAP fault during enumeration: code 's:Sender', subcode
  'n:CannotProcessFilter', reason 'The data source could not process the filter.
  The filter might be missing or it might be invalid. Change the filter and try
  the request again.  ', detail 'The WS-Management service cannot process the
  request. The WQL query is invalid. '

This commit fixes the Hyper-V driver by escaping all WMI SQL string parameters.

The same command with the fix:

  virsh # dominfo \"
  error: failed to get domain '"'
  error: Domain not found: No domain with name "

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
7 years agohyperv: Fix hypervInitConnection error reporting
Ladi Prosek [Fri, 6 Oct 2017 06:47:33 +0000 (08:47 +0200)]
hyperv: Fix hypervInitConnection error reporting

"%s is not a Hyper-V server" is not a correct generalization of all possible
error conditions of hypervEnumAndPull. For example:

  $ virsh --connect hyperv://localhost/?transport=http
  Enter username for localhost [administrator]:
  Enter administrator's password for localhost: <enters incorrect password>
  error: failed to connect to the hypervisor
  error: internal error: localhost is not a Hyper-V server

This commit removes the general virReportError from hypervInitConnection and
also the "Invalid query" virReportError from hypervSerializeEprParam, which
does not correctly describe the error either (virBufferCheckError has
already set a meaningful error message at that point).

The same scenario with the fix:

  $ virsh --connect hyperv://localhost/?transport=http
  Enter username for localhost [administrator]:
  Enter administrator's password for localhost: <enters incorrect password>
  error: failed to connect to the hypervisor
  error: internal error: Transport error during enumeration: User, password or
  similar was not accepted (26)

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
7 years agoqemu: ensure TLS clients always verify the server certificate
Daniel P. Berrange [Thu, 5 Oct 2017 16:54:28 +0000 (17:54 +0100)]
qemu: ensure TLS clients always verify the server certificate

The default_tls_x509_verify (and related) parameters in qemu.conf
control whether the QEMU TLS servers request & verify certificates
from clients. This works as a simple access control system for
servers by requiring the CA to issue certs to permitted clients.
This use of client certificates is disabled by default, since it
requires extra work to issue client certificates.

Unfortunately the code was using this configuration parameter when
setting up both TLS clients and servers in QEMU. The result was that
TLS clients for character devices and disk devices had verification
turned off, meaning they would ignore errors while validating the
server certificate.

This allows for trivial MITM attacks between client and server,
as any certificate returned by the attacker will be accepted by
the client.

This is assigned CVE-2017-1000256  / LSN-2017-0002

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoUse https:// links for most sites
Daniel P. Berrange [Fri, 13 Oct 2017 15:30:41 +0000 (16:30 +0100)]
Use https:// links for most sites

This adds a rule to require https links for the libvirt, qemu
and kvm websites.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoRemove obsolete TODO file
Daniel P. Berrange [Fri, 13 Oct 2017 15:31:07 +0000 (16:31 +0100)]
Remove obsolete TODO file

We stopped autogenerating a TODO file from RFE bugs a long time
ago.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: reserve PCI addresses for implicit i440fx devices
Ján Tomko [Tue, 26 Sep 2017 10:35:29 +0000 (12:35 +0200)]
qemu: reserve PCI addresses for implicit i440fx devices

Somewhere around commit 9ff9d9f reserving entire PCI slots was
eliminated, as demonstrated by commit 6cc2014.

Reserve the functions required by the implicit devices:
00:01.0 ISA Bridge
00:01.1 IDE Controller
00:01.2 USB Controller (unless USB is disabled)
00:01.3 Bridge

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

7 years agocputest: Make a crippled version of Core-i7-2600
Jiri Denemark [Tue, 3 Oct 2017 22:55:46 +0000 (00:55 +0200)]
cputest: Make a crippled version of Core-i7-2600

xsaveopt is artificially removed from the host to test disabled feature
which is only included in QEMU's version of the CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Update Core-i7-2600 data
Jiri Denemark [Wed, 4 Oct 2017 12:01:25 +0000 (14:01 +0200)]
cputest: Update Core-i7-2600 data

arat is now enabled even if the hardware does not support it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Add query-cpu-definitions reply for Xeon-E3-1245
Jiri Denemark [Tue, 26 Sep 2017 19:08:58 +0000 (21:08 +0200)]
cputest: Add query-cpu-definitions reply for Xeon-E3-1245

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Update Xeon-E3-1245 data
Jiri Denemark [Wed, 20 Sep 2017 08:50:01 +0000 (10:50 +0200)]
cputest: Update Xeon-E3-1245 data

xsaves is supported by current QEMU/KVM on this CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Add query-cpu-definitions reply for Xeon-E7-4830
Jiri Denemark [Tue, 26 Sep 2017 20:14:25 +0000 (22:14 +0200)]
cputest: Add query-cpu-definitions reply for Xeon-E7-4830

This CPU was incorrectly detected as SandyBridge before because the
number of additional <feature> elements was the same for both
SandyBridge and Westmere CPU models, but SandyBridge is newer (the CPU
signature does not help here because it doesn't match any signature
defined in cpu_map.xml). But since QEMU's version of SandyBridge CPU
model contains xsaveopt which needs to be disabled, Westmere becomes the
best CPU model when translating CPUID data to virCPUDef. Unfortunately,
this doesn't help with translating the data we got from QEMU and the CPU
model is still computed as SandyBridge in this case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Add CPUID data for Intel(R) Xeon(R) CPU E7-4830
Jiri Denemark [Tue, 26 Sep 2017 19:57:04 +0000 (21:57 +0200)]
cputest: Add CPUID data for Intel(R) Xeon(R) CPU E7-4830

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Add query-cpu-definitions reply for Core-i5-2540M
Jiri Denemark [Tue, 26 Sep 2017 21:07:47 +0000 (23:07 +0200)]
cputest: Add query-cpu-definitions reply for Core-i5-2540M

The unavailable features do not make any difference in this case,
because this is a SandyBridge CPU which has an empty list of unavailable
features.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Use CPU models from QEMU when available
Jiri Denemark [Wed, 27 Sep 2017 07:29:28 +0000 (09:29 +0200)]
cputest: Use CPU models from QEMU when available

When testing cpuDecode for computing guest CPU definition from CPUID
data (the CPU definition reported by domain capabilities), we need to
use CPU models (and their usability blockers) from QEMU if they are
available to cpuDecode in the same way it is actually used in the qemu
driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Separate QEMUCaps creation from cpuTestCPUIDJson
Jiri Denemark [Wed, 27 Sep 2017 09:58:23 +0000 (11:58 +0200)]
cputest: Separate QEMUCaps creation from cpuTestCPUIDJson

To make the code reusable by other tests.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Test CPU usability blockers
Jiri Denemark [Tue, 26 Sep 2017 19:08:37 +0000 (21:08 +0200)]
cputest: Test CPU usability blockers

Gather query-cpu-definitions results and use them for testing CPU model
usability blockers in CPUID to virCPUDef translation.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Print correct feature in virCPUUpdateLive test
Jiri Denemark [Wed, 27 Sep 2017 09:21:36 +0000 (11:21 +0200)]
cputest: Print correct feature in virCPUUpdateLive test

If the actual result does not match our expectation, the tests would
not correctly show the difference if a CPU feature is disabled in the
expected result and the actual result does not mention it at all. The
test could complain about an unrelated CPU feature or it could even
crash in case the actual result contains no more features to go through.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Avoid calling json_reformat in cpu-parse.sh
Jiri Denemark [Tue, 26 Sep 2017 21:02:48 +0000 (23:02 +0200)]
cputest: Avoid calling json_reformat in cpu-parse.sh

Various version of json_reformat use different number of spaces for
indenting. Let's use a simple python reformatter to gain full control
over the formatting for consistent results.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocputest: Replace bool with cpuTestCPUIDJson enum
Jiri Denemark [Tue, 26 Sep 2017 19:01:56 +0000 (21:01 +0200)]
cputest: Replace bool with cpuTestCPUIDJson enum

We will soon need to handle more than two values.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocpu_x86: Disable blockers from unusable CPU models
Jiri Denemark [Fri, 13 Oct 2017 16:17:52 +0000 (18:17 +0200)]
cpu_x86: Disable blockers from unusable CPU models

When decoding CPUID data to virCPUDef we need to be careful about using
a CPU model which cannot be directly used on the current host. Normally,
libvirt would notice the features which prevent the model from being
usable and it would disable them in the computed virCPUDef, but this
won't work in case the definition of the CPU model in QEMU contains more
features than what we have in cpu_map.xml. We need to count with the
usability blockers we got from QEMU and explicitly disable all of them
to make the computed virCPUDef usable.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocpu_x86: Move x86FeatureFind* to avoid forward prototypes
Jiri Denemark [Tue, 26 Sep 2017 12:52:34 +0000 (14:52 +0200)]
cpu_x86: Move x86FeatureFind* to avoid forward prototypes

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Introduce virDomainCapsCPUModelsGet
Jiri Denemark [Fri, 13 Oct 2017 15:37:34 +0000 (17:37 +0200)]
conf: Introduce virDomainCapsCPUModelsGet

This internal API can be used to find a specific CPU model in
virDomainCapsCPUModels list.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocpu: Drop unused parameter from cpuDecode
Jiri Denemark [Tue, 26 Sep 2017 08:24:05 +0000 (10:24 +0200)]
cpu: Drop unused parameter from cpuDecode

The "preferred" parameter is not used by any caller of cpuDecode
anymore. It's only used internally in cpu_x86 to implement cpuBaseline.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agocpu: Use virDomainCapsCPUModelsPtr in cpu driver APIs
Jiri Denemark [Fri, 22 Sep 2017 13:51:33 +0000 (15:51 +0200)]
cpu: Use virDomainCapsCPUModelsPtr in cpu driver APIs

All APIs which expect a list of CPU models supported by hypervisors were
switched from char **models and int models to just accept a pointer to
virDomainCapsCPUModels object stored in domain capabilities. This avoids
the need to transform virDomainCapsCPUModelsPtr into a NULL-terminated
list of model names and also allows the various cpu driver APIs to
access additional details (such as its usability) about each CPU model.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Parse unavailable features for CPU models
Jiri Denemark [Wed, 20 Sep 2017 08:45:49 +0000 (10:45 +0200)]
qemu: Parse unavailable features for CPU models

query-cpu-definitions QMP command returns a list of unavailable features
which prevent CPU models from being usable on the current host. So far
we only checked whether the list was empty to mark CPU models as
(un)usable. This patch parses all unavailable features for each CPU
model and stores them in virDomainCapsCPUModel as a list of usability
blockers.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Store CPU usability blockers in caps cache
Jiri Denemark [Thu, 21 Sep 2017 14:11:14 +0000 (16:11 +0200)]
qemu: Store CPU usability blockers in caps cache

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Add usability blockers to virDomainCapsCPUModel
Jiri Denemark [Tue, 19 Sep 2017 16:35:08 +0000 (18:35 +0200)]
conf: Add usability blockers to virDomainCapsCPUModel

When a hypervisor marks a CPU model as unusable on the current host, it
may also give us a list of features which prevent the model from being
usable. Storing this list in virDomainCapsCPUModel will help the CPU
driver with creating a host-model CPU configuration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Introduce virStringListCopy
Jiri Denemark [Wed, 20 Sep 2017 08:41:35 +0000 (10:41 +0200)]
util: Introduce virStringListCopy

The API makes a deep copy of a NULL-terminated string list.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirDomainDeviceInfoParseXML: Clear whole @info on failure
Michal Privoznik [Tue, 3 Oct 2017 08:38:50 +0000 (10:38 +0200)]
virDomainDeviceInfoParseXML: Clear whole @info on failure

Currently, if parsing of device info fails info->alias is freed.
It doesn't make much sense to leave the rest of the struct
behind.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirDomainDeviceInfoParseXML: Separate address parsing into separate func
Michal Privoznik [Tue, 3 Oct 2017 08:35:52 +0000 (10:35 +0200)]
virDomainDeviceInfoParseXML: Separate address parsing into separate func

There's one 'return' in the middle of the function body. It's
very easy to miss and so it makes adding new code harder. Also
the function doesn't follow our style 100%.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirDomainInterfaceStats: Accept MAC addresses properly
Michal Privoznik [Fri, 13 Oct 2017 23:29:36 +0000 (16:29 -0700)]
virDomainInterfaceStats: Accept MAC addresses properly

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

In 0d3d020ba6c4f I've added capability to accept MAC addresses
for the API too. However, the implementation was faulty. It needs
to lookup the corresponding interface in the domain definition
and pass the ifname instead of MAC address.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agonodedev: Fix missing network devices
John Ferlan [Tue, 10 Oct 2017 13:04:54 +0000 (09:04 -0400)]
nodedev: Fix missing network devices

Commit id '8708ca01c' added a check to determine whether the NIC had
Switchdev capabilities; however, in doing so inadvertently would cause
network devices without a PCI device to not be added to the node device
database. Thus, network devices having a "computer" as a parent, such
as "net_lo*", "net_virbr*", "net_tun*", "net_vnet*", etc. were not added.

Alter the check to not even check for Switchdev bits if no PCI device found.

7 years agovirsh: Deal with multiple matching devices in domif-getlink
Michal Privoznik [Wed, 4 Oct 2017 15:39:59 +0000 (17:39 +0200)]
virsh: Deal with multiple matching devices in domif-getlink

The command tries to match interface in domain definition by MAC
address or interface name. However, since it's possible to
configure two interfaces with the same MAC address, it may
happen that the XPath returns two or more nodes. We should check
for that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirDomainInterfaceStats: Accept MAC address too
Michal Privoznik [Fri, 13 Oct 2017 20:25:42 +0000 (13:25 -0700)]
virDomainInterfaceStats: Accept MAC address too

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

The other APIs accept both, ifname and MAC address. There's no
reason virDomainInterfaceStats can't do the same.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirDomainNetFind: Report error if no device found
Michal Privoznik [Fri, 13 Oct 2017 20:40:47 +0000 (13:40 -0700)]
virDomainNetFind: Report error if no device found

Every caller reports the error themselves. Might as well move it
into the function and thus unify it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Document limitation of domifstat
Michal Privoznik [Fri, 13 Oct 2017 20:15:13 +0000 (13:15 -0700)]
virsh: Document limitation of domifstat

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

The current implementation reads the stats from the host.
However, this doesn't work for all types of interfaces as not all
of them have a representation in the host. For instance,
interface type='user' doesn't.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoAdd CII best practices badge
Daniel P. Berrange [Fri, 13 Oct 2017 13:31:14 +0000 (14:31 +0100)]
Add CII best practices badge

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agonodedev: Convert virNodeDeviceObjHasCap to bool
John Ferlan [Mon, 9 Oct 2017 22:01:57 +0000 (18:01 -0400)]
nodedev: Convert virNodeDeviceObjHasCap to bool

It only returns 0 or 1 anyway, let's be realistic

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agonodedev: Convert virNodeDeviceObjList to use RWObjectLockable
John Ferlan [Mon, 9 Oct 2017 20:55:23 +0000 (16:55 -0400)]
nodedev: Convert virNodeDeviceObjList to use RWObjectLockable

Let's use the RWObjectLockable for the various list lock mgmt.
Only time need Write lock will be for Add/Remove logic.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agosecrets: Convert to use ObjectRWLockable
John Ferlan [Mon, 9 Oct 2017 18:24:32 +0000 (14:24 -0400)]
secrets: Convert to use ObjectRWLockable

Let's use the ObjectRWLockable for the various list lock mgmt.
Only time need Write lock will be for Add/Remove logic.

7 years agonetwork: Convert virNetworkObjList to use RWObjectLockable
John Ferlan [Tue, 10 Oct 2017 14:02:32 +0000 (10:02 -0400)]
network: Convert virNetworkObjList to use RWObjectLockable

Let's use the RWObjectLockable for the various list lock mgmt.
Only time need Write lock will be for Add, Remove, and Prune logic.

7 years agoutil: Resolve resource leak
John Ferlan [Wed, 11 Oct 2017 20:56:58 +0000 (16:56 -0400)]
util: Resolve resource leak

Need to free @groups in the parent on success similar to other
APIs (virFile*) which use virGetGroupList and virFork.

Reported by Coverity.

7 years agovirt-host-validate: require fuse for LXC if compiled in
Guido Günther [Thu, 12 Oct 2017 14:51:13 +0000 (16:51 +0200)]
virt-host-validate: require fuse for LXC if compiled in

Domains fail to start without fuse like

  error: internal error: guest failed to start: fuse: device not found, try 'modprobe fuse' first
  Failure in libvirt_lxc startup: no error

so check for it too.

References: https://ci.debian.net/data/autopkgtest/unstable/amd64/libv/libvirt/20171012_105903/log.gz

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoqemu: add the print of page size in cmd domjobinfo
Chao Fan [Mon, 9 Oct 2017 02:00:03 +0000 (10:00 +0800)]
qemu: add the print of page size in cmd domjobinfo

The command "info migrate" of qemu outputs the dirty-pages-rate during
migration, but page size is different in different architectures. So
page size should be output to calculate dirty pages in bytes.

Page size is already implemented with commit
030ce1f8612215fcbe9d353dfeaeb2937f8e3f94 in qemu.
Now Implement the counter-part in libvirt.

Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agocpu_ppc64: Error out when model tag missing in virsh cpu-compare xml
Nitesh Konkar [Mon, 18 Sep 2017 16:57:52 +0000 (22:27 +0530)]
cpu_ppc64: Error out when model tag missing in virsh cpu-compare xml

libvirtd throws unhandled signal 11 on ppc while running
virsh cpu-compare with missing model tag in the xml. This
patch errors out in such situation.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoFix 1 << -1 in JOB_MASK macro
caoxinhua [Sat, 15 Jul 2017 06:42:39 +0000 (14:42 +0800)]
Fix 1 << -1 in JOB_MASK macro

Calling JOB_MASK(QEMU_JOB_NONE) would result in 1 << -1.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agomaint: update to latest gnulib
Daniel P. Berrange [Tue, 10 Oct 2017 08:56:31 +0000 (09:56 +0100)]
maint: update to latest gnulib

This pulls in the fix for getopt tests on Fedora >= 28 / glibc > 2.26.0

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agospec: Install README.md
Jiri Denemark [Tue, 10 Oct 2017 08:40:26 +0000 (10:40 +0200)]
spec: Install README.md

Installing dead README symlink only is pretty useless.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: clarify error message for index 0 PIIX3 USB controller
Ján Tomko [Tue, 26 Sep 2017 11:03:49 +0000 (13:03 +0200)]
qemu: clarify error message for index 0 PIIX3 USB controller

The address is restricted to 0:0:1.2 only for the piix3-uhci controller
at index 0.

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

7 years agoqemu: Don't crash when parsing command line lacking -M
Andrea Bolognani [Tue, 10 Oct 2017 13:53:53 +0000 (15:53 +0200)]
qemu: Don't crash when parsing command line lacking -M

Parse the -M (or -machine) command line option before starting
processing in earnest and have a fallback ready in case it's not
present, so that while parsing other options we can rely on
def->os.machine being initialized.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agolxc: Fixed indentation
Marc Hartmayer [Mon, 9 Oct 2017 19:14:58 +0000 (21:14 +0200)]
lxc: Fixed indentation

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agolxc: Fixed a typo
Marc Hartmayer [Mon, 9 Oct 2017 19:14:57 +0000 (21:14 +0200)]
lxc: Fixed a typo

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agoutil: Fix deadlock across fork()
Marc Hartmayer [Mon, 9 Oct 2017 19:14:56 +0000 (21:14 +0200)]
util: Fix deadlock across fork()

This commit fixes the deadlock introduced by commit
0980764dee687e8da86dc410c351759867163389. The call getgrouplist() of
the glibc library isn't safe to be called in between fork and
exec (see commit 75c125641ac73473ba4b0542524d67a184769c8e).

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Fixes: 0980764dee68 ("util: share code between virExec and virCommandExec")
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agoutil: Add virCommandGetGID and virCommandGetUID
Marc Hartmayer [Mon, 9 Oct 2017 19:14:55 +0000 (21:14 +0200)]
util: Add virCommandGetGID and virCommandGetUID

These functions are used by an upcoming commit.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agoqemu: Remove redundant code in qemuParseCommandLineDisk
Kothapally Madhu Pavan [Sun, 8 Oct 2017 09:24:53 +0000 (14:54 +0530)]
qemu: Remove redundant code in qemuParseCommandLineDisk

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
7 years agoapparmor: add dnsmasq ptrace rule to libvirtd profile
Jim Fehlig [Fri, 6 Oct 2017 20:20:36 +0000 (14:20 -0600)]
apparmor: add dnsmasq ptrace rule to libvirtd profile

Commit b482925c added ptrace rule for the apparmor profiles,
but one was missed in the libvirtd profile for dnsmasq. It was
overlooked since the test machine did not have an active libvirt
network requiring dnsmasq that was also set to autostart. With
one active and set to autostart, the following denial is observed
in audit.log when restarting libvirtd

type=AVC msg=audit(1507320136.306:298): apparmor="DENIED" \
operation="ptrace" profile="/usr/sbin/libvirtd" pid=5472 \
comm="libvirtd" requested_mask="trace" denied_mask="trace" \
peer="/usr/sbin/dnsmasq"

With an active network, I suspect a libvirtd restart causes access
to /proc/<dnsmasq-pid>/*, hence the resulting denial. As a nasty
side affect of the denial, libvirtd thinks it needs to spawn a
dnsmasq process even though one is already running for the network.
E.g. after two libvirtd restarts

dnsmasq   1683  0.0  0.0  51188  2612 ?        S    12:03   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
root      1684  0.0  0.0  51160   576 ?        S    12:03   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
dnsmasq   4706  0.0  0.0  51188  2572 ?        S    13:54   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
root      4707  0.0  0.0  51160   572 ?        S    13:54   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
dnsmasq   4791  0.0  0.0  51188  2580 ?        S    13:56   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper
root      4792  0.0  0.0  51160   572 ?        S    13:56   0:00 \
 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf \
 --leasefile-ro --dhcp-script=/usr/lib64/libvirt/libvirt_leaseshelper

A simple fix is to add a ptrace rule for dnsmasq.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-By: Guido Günther <agx@sigxcpu.org>
7 years agonuma: rename function virDomainNumaDefCPUFormat
Wim ten Have [Fri, 8 Sep 2017 14:47:14 +0000 (16:47 +0200)]
numa: rename function virDomainNumaDefCPUFormat

Rename virDomainNumaDefCPUFormat to virDomainNumaDefCPUFormatXML,
matching its peer virDomainNumaDefCPUParseXML and the general
vir*{Format,Parse}XML conventions.

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
7 years agobuild: isolate core libvirt libs deps from xen runtime
Wim ten Have [Fri, 6 Oct 2017 12:16:07 +0000 (14:16 +0200)]
build: isolate core libvirt libs deps from xen runtime

Generating libvirt packages per make rpm, "with-libxl=1" and "with-xen=1",
adds strict runtime dependencies per libxenlight for xen-libs package from
core libvirt-libs package.  This is not necessary and unfortunate since
those dependencies set demand to "xen-libs" package even when there's no
need for libvirt xen or libxl driver components.

This patch is to have two separate xenconfig lib tool libraries: one for
core libvirt (without XL), and a another that contains xl for libxl driver
(libvirt_driver_libxl_impl.la) which when loading the driver, loads the
remaining symbols (xen{Format,Parse}XL. For the user/sysadmin, this means
the xen dependencies are moved into libxl driver, instead of core libvirt.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
7 years agostorage: Use virStoragePoolObjGetDef accessor for Gluster backend
John Ferlan [Wed, 26 Jul 2017 18:23:46 +0000 (14:23 -0400)]
storage: Use virStoragePoolObjGetDef accessor for Gluster backend

In preparation for privatizing the object, use the accessor.

7 years agostorage: Use virStoragePoolObjGetDef accessor for FS backend
John Ferlan [Wed, 26 Jul 2017 18:21:08 +0000 (14:21 -0400)]
storage: Use virStoragePoolObjGetDef accessor for FS backend

In preparation for privatizing the object, use the accessor.

7 years agostorage: Use virStoragePoolObjGetDef accessor for Sheepdog backend
John Ferlan [Wed, 26 Jul 2017 18:17:22 +0000 (14:17 -0400)]
storage: Use virStoragePoolObjGetDef accessor for Sheepdog backend

In preparation for privatizing the object, use the accessor.

7 years agostorage: Use virStoragePoolObjGetDef accessor for Logical backend
John Ferlan [Wed, 26 Jul 2017 18:16:52 +0000 (14:16 -0400)]
storage: Use virStoragePoolObjGetDef accessor for Logical backend

In preparation for privatizing the object, use the accessor.

7 years agostorage: Use virStoragePoolObjGetDef accessor for Disk backend
John Ferlan [Wed, 26 Jul 2017 18:06:59 +0000 (14:06 -0400)]
storage: Use virStoragePoolObjGetDef accessor for Disk backend

In preparation for privatizing the object, use the accessor.

7 years agostorage: Use virStoragePoolObjGetDef accessor for storage_util
John Ferlan [Mon, 8 May 2017 12:47:32 +0000 (08:47 -0400)]
storage: Use virStoragePoolObjGetDef accessor for storage_util

In preparation for privatizing the object, use the accessor.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Use virStoragePoolObjGetDef accessor
John Ferlan [Mon, 8 May 2017 12:21:52 +0000 (08:21 -0400)]
test: Use virStoragePoolObjGetDef accessor

In preparation for privatizing the object, use the accessor.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Create local virStoragePoolObjPtr VolLookup APIs
John Ferlan [Wed, 26 Jul 2017 17:38:45 +0000 (13:38 -0400)]
test: Create local virStoragePoolObjPtr VolLookup APIs

Rather than accessing privconn->pools.objs[i] in the for loop,
let's use an @obj variable to make it easier to read the code.

7 years agotest: Rename @vol to @volDef in testOpenVolumesForPool
John Ferlan [Wed, 26 Jul 2017 17:33:30 +0000 (13:33 -0400)]
test: Rename @vol to @volDef in testOpenVolumesForPool

Make it more obvious as we're about to need to change how
obj->def gets referenced.

Perform a couple of minor cleanups along the way too.

7 years agostorage: Use virStoragePoolObjGetDef accessor for driver
John Ferlan [Mon, 8 May 2017 16:41:11 +0000 (12:41 -0400)]
storage: Use virStoragePoolObjGetDef accessor for driver

In preparation for privatizing the object, use the accessor to fetch
the obj->def instead of the direct reference.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Fix possible NULL deref
John Ferlan [Wed, 20 Sep 2017 11:47:17 +0000 (07:47 -0400)]
tests: Fix possible NULL deref

7 years agoconf: Fix prototype/definition for virStoragePoolObj get functions
John Ferlan [Tue, 19 Sep 2017 12:55:43 +0000 (08:55 -0400)]
conf: Fix prototype/definition for virStoragePoolObj get functions

Modify virStoragePoolObjGetAutostartLink and
virStoragePoolObjGetConfigFile to return "const char *"
since that's how both are used and to ensure no one
tries to VIR_FREE the result.

7 years agovirt-aa-helper: put static rules in quotes
Christian Ehrhardt [Wed, 20 Sep 2017 14:59:09 +0000 (16:59 +0200)]
virt-aa-helper: put static rules in quotes

To avoid any issues later on if paths ever change (unlikely but
possible) and to match the style of other generated rules the paths
of the static rules have to be quoted as well.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
7 years agovirt-aa-helper: allow spaces in vm names
Christian Ehrhardt [Wed, 20 Sep 2017 14:59:08 +0000 (16:59 +0200)]
virt-aa-helper: allow spaces in vm names

libvirt allows spaces in vm names, there were issues in the past but it
seems not removed so the assumption has to be that spaces are continuing
to be allowed.

Therefore virt-aa-helper should not reject spaces in vm names anymore if
it is going to be refused causing issues then the parser or xml schema
should do so.
Apparmor rules are in quotes, so a space in a path based on the name works.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirt-aa-helper: fix libusb access to udev usb data
Christian Ehrhardt [Wed, 20 Sep 2017 14:59:07 +0000 (16:59 +0200)]
virt-aa-helper: fix libusb access to udev usb data

libusb as used by qemu needs to read data from /run/udev/data/ about usb
devices. That is read once on the first initialization of libusb_init by
qemu.

Therefore generating just the device we need would not be sufficient as
another hotplug later can need another device which would fail as the
data is no more re-read at this point.

But we can restrict the paths very much to just the major number of
potential usb devices which will make it match approximately the detail
that e.g. an lsusb -v would reveal - that is much safer than the
"/run/udev/data/* r" blanket many users are using now as a workaround.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
7 years agovirt-aa-helper: fix paths for usb hostdevs
Christian Ehrhardt [Wed, 20 Sep 2017 14:59:06 +0000 (16:59 +0200)]
virt-aa-helper: fix paths for usb hostdevs

If users only specified vendor&product (the common case) then parsing
the xml via virDomainHostdevSubsysUSBDefParseXML would only set these.
Bus and Device would much later be added when the devices are prepared
to be added.

Due to that a hot-add of a usb hostdev works as the device is prepared
and virt-aa-helper processes the new internal xml. But on an initial
guest start at the time virt-aa-helper renders the apparmor rules the
bus/device id's are not set yet:

p ctl->def->hostdevs[0]->source.subsys.u.usb
$12 = {autoAddress = false, bus = 0, device = 0, vendor = 1921, product
= 21888}

That causes rules to be wrong:
  "/dev/bus/usb/000/000" rw,

The fix calls virHostdevFindUSBDevice after reading the XML from
virt-aa-helper to only add apparmor rules for devices that could be found
and now are fully known to be able to write the rule correctly.

It uncondtionally sets virHostdevFindUSBDevice mandatory attribute as
adding an apparmor rule for a device not found makes no sense no matter
what startup policy it has set.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: process: Don't redetect backing chain on reconnect
Peter Krempa [Wed, 27 Sep 2017 16:06:44 +0000 (18:06 +0200)]
qemu: process: Don't redetect backing chain on reconnect

Skip purging the backing chain and redetecting it when it was not going
to change during the time we were not present.

The decision is based on the new flag which records whether there were
blockjobs running to the status XML.

7 years agoqemu: process: Simplify access to individual disk when reconnecting
Peter Krempa [Thu, 5 Oct 2017 12:00:08 +0000 (14:00 +0200)]
qemu: process: Simplify access to individual disk when reconnecting

Add a helper variable so that we don't have to access the disk via 3
indirections.

7 years agoqemu: domain: Mark if no blockjobs are active in the status XML
Peter Krempa [Tue, 26 Sep 2017 14:37:47 +0000 (16:37 +0200)]
qemu: domain: Mark if no blockjobs are active in the status XML

Note when no blockjobs are running in the status XML so that we know
that the backing chain will not change until we reconnect.

7 years agoutil: Add functions to simplify bool->virTristate(Bool|Switch) assignment
Peter Krempa [Thu, 5 Oct 2017 11:06:41 +0000 (13:06 +0200)]
util: Add functions to simplify bool->virTristate(Bool|Switch) assignment

virTristateBoolFromBool and virTristateSwitchFromBool convert a boolean
to the correct enum value.

7 years agonews: Document watchdog hot-(un)plug change
Michal Privoznik [Thu, 5 Oct 2017 13:11:25 +0000 (15:11 +0200)]
news: Document watchdog hot-(un)plug change

In 361c8dc17 and 662140fa68ae0 I've implemented hot-(un)plug of
watchdog devices. Document this change.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: hot-unplug of watchdog
Michal Privoznik [Tue, 5 Sep 2017 09:08:36 +0000 (11:08 +0200)]
qemu: hot-unplug of watchdog

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: hot-plug of watchdog
Michal Privoznik [Fri, 1 Sep 2017 11:39:15 +0000 (13:39 +0200)]
qemu: hot-plug of watchdog

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

Since domain can have at most one watchdog it simplifies things a
bit. However, since we must be able to set the watchdog action as
well, new monitor command needs to be used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemuDomainDeviceDefValidate: Validate watchdog
Michal Privoznik [Wed, 27 Sep 2017 11:45:07 +0000 (13:45 +0200)]
qemuDomainDeviceDefValidate: Validate watchdog

Currently we don't do it. Therefore we accept senseless
combinations of models and buses they are attached to.
Moreover, diag288 watchdog is exclusive to s390(x).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agodocs,rng: Adjust storage pool name grammar checks
John Ferlan [Tue, 3 Oct 2017 11:14:04 +0000 (07:14 -0400)]
docs,rng: Adjust storage pool name grammar checks

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

It's possible to define and start a pool with a '.' in the
name; however, when trying to add a volume to a domain using
the storage pool source with a '.' in the storage pool name,
the domain RNG validation fails because RNG uses 'genericName'
which does not allow a '.' in the name.

Domain XML def parsing has a virXMLValidateAgainstSchema which
generates the error. The Storage Pool XML def parsing has no
call to virXMLValidateAgainstSchema. The only Storage Pool name
validation occurs in virStoragePoolDefParseXML to ensure the
name doesn't have a '/' in it and in storagePoolDefineXML to
call virXMLCheckIllegalChars using the same parameter "\n" as
qemuDomainDefineXMLFlags would check after the RNG check
could be succesful.

In order to resolve this, create a poolName definition in
storagecommon.rng that will mimic the domain name regex that
disallows a newline character, but add the "/" in the exclude
list. Then modify the pool and volume source name definitions
to key off that poolName.

7 years agotests: qemuxml2xml: Simplify adding to the status XML expect string generator
Peter Krempa [Tue, 26 Sep 2017 15:11:16 +0000 (17:11 +0200)]
tests: qemuxml2xml: Simplify adding to the status XML expect string generator

Unindent the static XML block and move around the autoindent calls so
that further additions don't have to add more of them.

Also rename the string holding the static XML section.

7 years agoqemu: driver: Save status XML when starting a block job
Peter Krempa [Wed, 27 Sep 2017 15:50:31 +0000 (17:50 +0200)]
qemu: driver: Save status XML when starting a block job

Few jobs (which don't) use the 'mirror' element did not save the status
XML. It will be helpful to do so once we start tracking jobs fully.

7 years agoqemu: blockjob: Always save config XML when a blockjob is finished
Peter Krempa [Mon, 28 Aug 2017 13:36:05 +0000 (15:36 +0200)]
qemu: blockjob: Always save config XML when a blockjob is finished

For VMs with persistent config the config may change upon successful
completion of a job. Save it always if a persistent VM finishes a
blockjob. This will simplify further additions.

7 years agoqemu: blockjob: Always save status XML after block event
Peter Krempa [Mon, 28 Aug 2017 13:21:06 +0000 (15:21 +0200)]
qemu: blockjob: Always save status XML after block event

The status XML would be saved only for the copy job (in case of success)
or on failure even for other jobs. As the status contains the backing
chain data, which change after success we should always save it on
block job completion.

7 years agonews: Document domifstat and QoS changes made recently
Michal Privoznik [Thu, 5 Oct 2017 07:29:35 +0000 (09:29 +0200)]
news: Document domifstat and QoS changes made recently

In cea3715b2e9 and d86fd2402e9d2 I've fixed domifstat and QoS
that was reversed for some types of interfaces. Document this
in the news file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agospec: Enable qemu driver on s390x on RHEL/CentOS
Jiri Denemark [Thu, 5 Oct 2017 07:17:06 +0000 (09:17 +0200)]
spec: Enable qemu driver on s390x on RHEL/CentOS

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