]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agovirbuftest: remove unnecessary labels
Ján Tomko [Tue, 14 Jan 2020 07:10:25 +0000 (08:10 +0100)]
virbuftest: remove unnecessary labels

Remove the ret variables and labels from functions that no longer need
them.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: use g_autofree
Ján Tomko [Tue, 14 Jan 2020 07:04:54 +0000 (08:04 +0100)]
virbuftest: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovirbuftest: remove extra G_GNUC_UNUSED markers
Ján Tomko [Tue, 14 Jan 2020 07:05:56 +0000 (08:05 +0100)]
virbuftest: remove extra G_GNUC_UNUSED markers

These functions do use the opaque argument.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agomaint: Post-release version bump to 6.1.0
Ján Tomko [Tue, 3 Dec 2019 04:20:37 +0000 (21:20 -0700)]
maint: Post-release version bump to 6.1.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoRelease of libvirt-6.0.0
Daniel Veillard [Wed, 15 Jan 2020 15:18:42 +0000 (16:18 +0100)]
Release of libvirt-6.0.0

* docs/news.xml: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
5 years agonews: Document <disk type='nvme'/>
Michal Privoznik [Tue, 14 Jan 2020 08:24:52 +0000 (09:24 +0100)]
news: Document <disk type='nvme'/>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agonews: News for RDT-MBM feature
Han Han [Tue, 14 Jan 2020 05:48:23 +0000 (13:48 +0800)]
news: News for RDT-MBM feature

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agovircgroupv2devices: free BPF map when replacing with new one
Pavel Hrdina [Mon, 13 Jan 2020 11:50:41 +0000 (12:50 +0100)]
vircgroupv2devices: free BPF map when replacing with new one

This leaks the FD of BPF map which means it will not be freed.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agonews: Update for libvirt 6.0.0
Andrea Bolognani [Mon, 13 Jan 2020 10:47:09 +0000 (11:47 +0100)]
news: Update for libvirt 6.0.0

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: Rearrange a few entries
Andrea Bolognani [Mon, 13 Jan 2020 09:30:05 +0000 (10:30 +0100)]
news: Rearrange a few entries

Some were in the wrong section, some in the wrong version.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: Fix typo (Libivrt -> Libvirt)
Andrea Bolognani [Mon, 13 Jan 2020 10:49:47 +0000 (11:49 +0100)]
news: Fix typo (Libivrt -> Libvirt)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_capabilities: Do not report USB as subsystem type if it is not available
Thomas Huth [Mon, 13 Jan 2020 08:04:57 +0000 (09:04 +0100)]
qemu_capabilities: Do not report USB as subsystem type if it is not available

libvirt currently always reports that USB is available as a bus subsystem
type when running "virsh domcapabilities". However, this is not always
true, for example the qemu-system-s390x binary normally never has support
for USB. Thus we should only report that USB is available if there is
also a USB host controller available where we can attach USB devices.

Reported-by: Sebastian Mitterle <smitterl@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1759849
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodomain_conf: Do not use USB by default for <input> devices on s390x
Thomas Huth [Mon, 13 Jan 2020 08:30:14 +0000 (09:30 +0100)]
domain_conf: Do not use USB by default for <input> devices on s390x

When trying to specify an input device on s390x without bus like this:

 <input type='keyboard'/>

... then libvirt currently complains:

 error: unsupported configuration: USB is disabled for this domain,
 but USB devices are present in the domain XML

This is somewhat confusing since the user did not specify an USB
device here. Since USB is not available on s390x, we should default
to the "virtio" bus here instead.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1790189
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: Always format storage source auth and encryption under <source> for backing...
Peter Krempa [Fri, 10 Jan 2020 16:25:16 +0000 (17:25 +0100)]
conf: Always format storage source auth and encryption under <source> for backing files

Historically there are two places where we format authentication and
encryption for a disk. The logich which formats it for backing files was
flawed though and didn't format it at all. This worked if the image
became a backing file through the means of a snapshot but not directly.

Force formatting of the source and encryption for any non-disk case to
fix the issue.

This caused problems in many places as we use the formatter to copy the
definition. Effectively any copy lost the secret definition.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2xml: Enable luks-disks-source-qcow2 case
Peter Krempa [Fri, 10 Jan 2020 16:35:10 +0000 (17:35 +0100)]
tests: qemuxml2xml: Enable luks-disks-source-qcow2 case

The test data was used only in xml->argv testing but it will have some
interresting fallout soon.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2argv: Run luks-disks-source-qcow2 case with latest caps
Peter Krempa [Fri, 10 Jan 2020 16:49:42 +0000 (17:49 +0100)]
tests: qemuxml2argv: Run luks-disks-source-qcow2 case with latest caps

Try also the modern incarnation of the test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agotests: qemuxml2argv: Add disk image with encrypted backing file
Peter Krempa [Fri, 10 Jan 2020 16:32:33 +0000 (17:32 +0100)]
tests: qemuxml2argv: Add disk image with encrypted backing file

Add another disk to luks-disks-source-qcow2 case to cover a backing
chain with encrypted members.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemuxml2*test: Fix hugepages-default-system-size tests
Jiri Denemark [Mon, 13 Jan 2020 08:39:22 +0000 (09:39 +0100)]
qemuxml2*test: Fix hugepages-default-system-size tests

Commit v5.10.0-269-g62065a6cb5 moved NUMA validation code to domain
definition time and appropriately adjusted affected test cases except
for hugepages-default-system-size. And since we don't mock
virGetSystemPageSizeKB in our tests, hugepages-default-system-size test
would fail on architectures (ppc64le) with default page size other than
4KiB.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoFix typo (cetificate -> certificate)
Andrea Bolognani [Mon, 13 Jan 2020 10:47:41 +0000 (11:47 +0100)]
Fix typo (cetificate -> certificate)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
5 years agovirerror: Make it easier to add new error number
Michal Privoznik [Thu, 9 Jan 2020 08:53:31 +0000 (09:53 +0100)]
virerror: Make it easier to add new error number

In v5.0.0-rc1~94 we switched from one huge switch() to an array
for translating error numbers into error messages. However, the
array is declared to have VIR_ERR_NUMBER_LAST items which makes
it impossible to spot this place by compile checking when adding
new error number.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonews: Mention problems with backing image format probing
Peter Krempa [Fri, 10 Jan 2020 11:28:19 +0000 (12:28 +0100)]
news: Mention problems with backing image format probing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: storage: Link to knowledge base when reporting missing image backing format
Peter Krempa [Fri, 10 Jan 2020 11:27:07 +0000 (12:27 +0100)]
util: storage: Link to knowledge base when reporting missing image backing format

Mention the knowledge base article which has tips how to fix the backing
chain to work with current libvirt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agotests: avoid re-execing test once for each mock
Daniel P. Berrangé [Thu, 9 Jan 2020 18:01:44 +0000 (18:01 +0000)]
tests: avoid re-execing test once for each mock

When debugging tests under GDB/valgrind there is a significant
delay each time an execve is done as they scan shared libraries
once again. For tests which use many mock libraries, we have
been invoking execve many times which makes the debug experience
horrible. This changes our framework to activate the full
set of mock libraries in one single execve.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: Add snapshot-revert qemu managedsave force
Michael Weiser [Fri, 3 Jan 2020 18:43:25 +0000 (19:43 +0100)]
docs: Add snapshot-revert qemu managedsave force

Add documentation for additional reason why snapshot-revert might need
to be forced. This explains why restoring an inactive snapshot while
there is managed saved state is refused by default.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Reformat snapshot-revert force reasons
Michael Weiser [Fri, 3 Jan 2020 18:43:24 +0000 (19:43 +0100)]
docs: Reformat snapshot-revert force reasons

Reformat explanations of the snapshot-revert force reasons in
preparation for more to be added. This is a simple reformat without any
wording changes.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Warn of restore with managed save being risky
Michael Weiser [Fri, 3 Jan 2020 18:43:23 +0000 (19:43 +0100)]
qemu: Warn of restore with managed save being risky

Internal snapshots of a non-running domain do not carry any memory state
and restoring such a snapshot will not replace existing saved memory
state. This allows a scenario, where a user first suspends a domain into
managedsave, restores a non-running snapshot and then resumes the domain
from managedsave. After that, the guest system will run with its
previous memory state atop a different disk state. The most obvious
possible fallout from this is extensive file system corruption. Swap
content and RAID bitmaps might also be off.

This has been discussed[1] and fixed[2] from the end-user perspective for
virt-manager.

This patch marks the restore operation as risky at the libvirt level,
requiring the user to remove the saved memory state first or force the
operation.

[1] https://www.redhat.com/archives/virt-tools-list/2019-November/msg00011.html
[2] https://www.redhat.com/archives/virt-tools-list/2019-December/msg00049.html

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: Harmonize hypervisor names for QEMU and LXC
Michael Weiser [Fri, 3 Jan 2020 18:39:56 +0000 (19:39 +0100)]
docs: Harmonize hypervisor names for QEMU and LXC

Trivially replace usages of qemu and lxc in the virsh manpage with their
more heavily used and (according to Wikipedia) correct upper-case
spellings QEMU and LXC.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
Suggested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Don't use NULL path from qemuDomainGetHostdevPath
Jiri Denemark [Thu, 9 Jan 2020 14:40:14 +0000 (15:40 +0100)]
qemu: Don't use NULL path from qemuDomainGetHostdevPath

Commit v5.10.0-290-g3a4787a301 refactored qemuDomainGetHostdevPath to
return a single path rather than an array of paths. When the function is
called on a missing device, it will now return NULL in @path rather than
a NULL array with zero items and the callers need to be adapted
properly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirsh migrate: Require --tls for --tls-destination
Jiri Denemark [Tue, 17 Dec 2019 13:31:10 +0000 (14:31 +0100)]
virsh migrate: Require --tls for --tls-destination

--tls-destination would be just ignored unless --tls is not specified,
which is correct, but let's provide a bit of a guidance is a user
forgets to add --tls.

This is just a virsh-only check targeted to end users as we don't
currently have such checks at the API level for migration parameters
that depend on flags.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
5 years agotests: avoid probing host CPU from bhyve test
Daniel P. Berrangé [Wed, 8 Jan 2020 18:17:58 +0000 (18:17 +0000)]
tests: avoid probing host CPU from bhyve test

bhyveargv2xmlmock calls virBhyveCapsBuild which in turn
calls virCPUProbeHost, probing the real host CPU. This
causes a test failure if the host CPU happens to contain
the 'arch-capabilities' feature as it triggers a call
to virHostCPUGetMSR() which fails on FreeBSD.

Fortunately we already have convenient code for mocking
the host CPU probing.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoschema: Allow iSCSI source to have interleaved children
Michal Privoznik [Wed, 8 Jan 2020 16:03:42 +0000 (17:03 +0100)]
schema: Allow iSCSI source to have interleaved children

There is no need to require users to produce iSCSI disk source
following our ordering of children elements. In fact, we don't
even accept our own order in the schema :(.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agobhyve_parse_command: Undefine CONSUME_ARG macro when no longer needed
Michal Privoznik [Wed, 8 Jan 2020 10:17:23 +0000 (11:17 +0100)]
bhyve_parse_command: Undefine CONSUME_ARG macro when no longer needed

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agobhyve_parse_command.c: Don't jump onto non-existent label in CONSUME_ARG()
Michal Privoznik [Wed, 8 Jan 2020 10:13:55 +0000 (11:13 +0100)]
bhyve_parse_command.c: Don't jump onto non-existent label in CONSUME_ARG()

In v5.10.0-508-gfbf3f3d86a, the 'error' label was removed from
bhyveParseBhyveCommandLine(), however the CONSUME_ARG() macro
still uses it. Fix the macro to return an error instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: fix implicit fallthrough warning
Ján Tomko [Wed, 8 Jan 2020 09:20:39 +0000 (10:20 +0100)]
qemu: fix implicit fallthrough warning

src/qemu/qemu_domain_address.c:680:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             switch ((virDomainFSModel) dev->data.fs->model) {

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: f363af7e351c6cac0ff442390d0dab283cbd9fae
5 years agovz: Don't try to jump on a non-existent label in prlsdkRemoveBootDevices()
Michal Privoznik [Wed, 8 Jan 2020 08:46:27 +0000 (09:46 +0100)]
vz: Don't try to jump on a non-existent label in prlsdkRemoveBootDevices()

Commit v5.10.0-522-g9000b2f298 was too aggressive and removed the
'error' label from prlsdkRemoveBootDevices() even though it's
used. Luckily, it's used only from one place and we have an
alternative for it that doesn't require the label.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()
Michal Privoznik [Wed, 8 Jan 2020 08:42:47 +0000 (09:42 +0100)]
qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmware()

The point of this function is to translate virDomainOsDefFirmware
enum to qemuFirmwareOSInterface enum. However, with my commit
v5.10.0-507-g8e1804f9f6 we are passing a variable type of
virDomainLoader enum. Make the function accept both enums and
make the enum members correspond to each other.

This fixes clang build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: formatdomain: use 'element' instead of 'block'
Ján Tomko [Wed, 18 Dec 2019 14:09:20 +0000 (15:09 +0100)]
docs: formatdomain: use 'element' instead of 'block'

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: command: take fsdriver type into account
Ján Tomko [Tue, 6 Aug 2019 15:57:44 +0000 (17:57 +0200)]
qemu: command: take fsdriver type into account

Split the formatting by fsdriver type to allow adding a new type.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: address: take fsdriver type into account
Ján Tomko [Tue, 16 Jul 2019 06:27:28 +0000 (08:27 +0200)]
qemu: address: take fsdriver type into account

Split the switch by fsdriver type to allow adding a new one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: pass private data to qemuBuildFilesystemCommandLine
Ján Tomko [Tue, 6 Aug 2019 16:22:24 +0000 (18:22 +0200)]
qemu: pass private data to qemuBuildFilesystemCommandLine

This will be used by a future patch.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: add private data to virDomainFSDef
Ján Tomko [Tue, 10 Dec 2019 12:53:10 +0000 (13:53 +0100)]
qemu: add private data to virDomainFSDef

Wire up the allocation and disposal of private data.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add private data to virDomainFSDef
Ján Tomko [Tue, 10 Dec 2019 12:52:52 +0000 (13:52 +0100)]
conf: add private data to virDomainFSDef

Add an object to hold the private data and call the
allocation function if it's present in xmlopt.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add xmlopt to virDomainFSDefNew
Ján Tomko [Tue, 10 Dec 2019 12:51:54 +0000 (13:51 +0100)]
conf: add xmlopt to virDomainFSDefNew

This will be needed in the future for allocating private data.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: rename gluster_debug_entry
Ján Tomko [Wed, 11 Dec 2019 21:22:31 +0000 (22:22 +0100)]
qemu: rename gluster_debug_entry

Remove the 'gluster' part and decouple the return from
the gluster_debug_level parsing to allow adding more options
to this section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: error out when check-augeas fails
Ján Tomko [Wed, 18 Dec 2019 13:42:46 +0000 (14:42 +0100)]
build: error out when check-augeas fails

Fixes: 2ffbdabb859594256d45c1b48521dd6501629852
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: backup: Move capability check after inactive check
Peter Krempa [Mon, 6 Jan 2020 11:27:40 +0000 (12:27 +0100)]
qemu: backup: Move capability check after inactive check

Inactive VM doesn't have qemuCaps set thus we'd never properly report
that VM backups are supported only for running VMs.

Move the capability check after the active check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agopo: Fix indentation of SED_PO_FIXUP_ARGS variable
Michal Privoznik [Tue, 7 Jan 2020 16:36:59 +0000 (17:36 +0100)]
po: Fix indentation of SED_PO_FIXUP_ARGS variable

The variable value is split on multiple lines, which have too
long indentation prefix leading to needless long lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoremote_daemon: Initialize host boot time global variable
Michal Privoznik [Tue, 17 Dec 2019 13:08:42 +0000 (14:08 +0100)]
remote_daemon: Initialize host boot time global variable

This is not strictly needed, but it makes sure we initialize the
@bootTime global variable. Thing is, in order to validate XATTRs
and prune those set in some previous runs of the host, a
timestamp is recorded in XATTRs. The host boot time was unique
enough so it was chosen as the timestamp value. And to avoid
querying and parsing /proc/uptime every time, the query function
does that only once and stores the boot time in a global
variable. However, the only time the query function is called is
in a child process that does lock files and changes seclabels. So
effectively, we are doing exactly what we wanted to prevent from
happening.

The fix is simple, call the virHostBootTimeInit() function which
sets the global variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirhostuptime: Introduce virHostBootTimeInit()
Michal Privoznik [Thu, 19 Dec 2019 09:11:04 +0000 (10:11 +0100)]
virhostuptime: Introduce virHostBootTimeInit()

The idea is to offer callers an init function that they can call
independently to ensure that the global variables get
initialized.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirt-aa-helper: Drop unused variable in verify_xpath_context()
Michal Privoznik [Tue, 7 Jan 2020 15:55:50 +0000 (16:55 +0100)]
virt-aa-helper: Drop unused variable in verify_xpath_context()

After one of previous commits (v5.10.0-524-gce56408e5f) there is
a variable left unused in verify_xpath_context() which breaks the
build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoexamples: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:50 +0000 (18:57 -0300)]
examples: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotests: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:49 +0000 (18:57 -0300)]
tests: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agologging: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:48 +0000 (18:57 -0300)]
logging: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoutil: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:45 +0000 (18:57 -0300)]
util: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosecurity: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:44 +0000 (18:57 -0300)]
security: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovbox: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:43 +0000 (18:57 -0300)]
vbox: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agovz/vz_sdk.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:42 +0000 (18:57 -0300)]
vz/vz_sdk.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:40 +0000 (18:57 -0300)]
qemu: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoopenvz: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:39 +0000 (18:57 -0300)]
openvz: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosecret/secret_driver.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:38 +0000 (18:57 -0300)]
secret/secret_driver.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonode_device: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:37 +0000 (18:57 -0300)]
node_device: remove unneeded labels

gather_scsi_host_cap() in node_device_hal.c can be greatly
simplified, given that the 'out' label is always getting
hit regardless of 'retval', which can also be eliminated.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agolxc: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:36 +0000 (18:57 -0300)]
lxc: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agocpu/cpu_ppc64.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:35 +0000 (18:57 -0300)]
cpu/cpu_ppc64.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agolocking/lock_driver_lockd.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:34 +0000 (18:57 -0300)]
locking/lock_driver_lockd.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agohyperv/hyperv_wmi.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:33 +0000 (18:57 -0300)]
hyperv/hyperv_wmi.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoremote/remote_daemon_config.c: remove unneeded label
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:32 +0000 (18:57 -0300)]
remote/remote_daemon_config.c: remove unneeded label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agonwfilter: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:31 +0000 (18:57 -0300)]
nwfilter: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agostorage: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:30 +0000 (18:57 -0300)]
storage: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agotest/test_driver.c: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:29 +0000 (18:57 -0300)]
test/test_driver.c: remove unneeded labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoconf: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:26 +0000 (18:57 -0300)]
conf: remove unneeded labels

Remove unneeded, easy to remove goto labels (cleanup|error|done|...).

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agobhyve: remove unneeded labels
Daniel Henrique Barboza [Mon, 6 Jan 2020 21:57:25 +0000 (18:57 -0300)]
bhyve: remove unneeded labels

Labels that are simply a jump to a 'return' call are
unneeded and can be replaced by the return value instead.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu_firmware: Try to autofill for old style UEFI specification
Michal Privoznik [Tue, 17 Dec 2019 16:45:50 +0000 (17:45 +0100)]
qemu_firmware: Try to autofill for old style UEFI specification

While we discourage people to use the old style of specifying
UEFI for their domains (the old style is putting path to the FW
image under /domain/os/loader/ whilst the new one is using
/domain/os/@firmware), some applications might have not adapted
yet. They still rely on libvirt autofilling NVRAM path and
figuring out NVRAM template when using the old way (notably
virt-install does this). We must preserve backcompat for this
previously supported config approach. However, since we really
want distro maintainers to leave --with-loader-nvram configure
option and rely on JSON descriptors, we need to implement
autofilling of NVRAM template for the old way too.

Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1782778
RHEL: https://bugzilla.redhat.com/show_bug.cgi?id=1776949

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: Introduce and use virDomainDefHasOldStyleUEFI() and virDomainDefHasOldStyleROUEFI()
Michal Privoznik [Tue, 7 Jan 2020 09:34:03 +0000 (10:34 +0100)]
src: Introduce and use virDomainDefHasOldStyleUEFI() and virDomainDefHasOldStyleROUEFI()

These functions are meant to replace verbose check for the old
style of specifying UEFI with a simple function call.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu_firmware: Introduce @want variable to qemuFirmwareMatchDomain()
Michal Privoznik [Tue, 7 Jan 2020 09:10:02 +0000 (10:10 +0100)]
qemu_firmware: Introduce @want variable to qemuFirmwareMatchDomain()

This simplifies condition when matching FW interface by having a
single line condition instead of multiline one. Also, it prepares
the code for future expansion.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu_firmware: Pass virDomainDef into qemuFirmwareFillDomain()
Michal Privoznik [Fri, 13 Dec 2019 14:41:16 +0000 (15:41 +0100)]
qemu_firmware: Pass virDomainDef into qemuFirmwareFillDomain()

This function needs domain definition really, we don't need to
pass the whole domain object. This saves couple of dereferences
and characters esp. in more checks to come.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocmdDomIfAddr: Move domain lookup down a few lines
Michal Privoznik [Fri, 3 Jan 2020 15:50:02 +0000 (16:50 +0100)]
cmdDomIfAddr: Move domain lookup down a few lines

The 'domifaddr' command accepts several arguments. Let's validate
them first and look up domain to work with only after to save
some RPC cycles should validation fail.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirsh: Fix virshDomainInterfaceSourceCompleter
Michal Privoznik [Thu, 5 Dec 2019 15:00:22 +0000 (16:00 +0100)]
virsh: Fix virshDomainInterfaceSourceCompleter

Introduced in v5.10.0-449-gcf44ec5577 it used
virshCommaStringListComplete() to generate list of options. But
this is not correct because the '--source' argument of the
'domifaddr' doesn't accept a string list (for instance
"arp,agent,lease") rather than a single string. Therefore, the
completer must return these strings separately and thus must
refrain from using virshCommaStringListComplete().

At the same time, now that we have strings we need declared as
an enum we can use TypeToString() instead of copying strings.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirsh: Use VIR_ENUM_* instead of open coding string -> enum conversion
Michal Privoznik [Thu, 5 Dec 2019 14:59:47 +0000 (15:59 +0100)]
virsh: Use VIR_ENUM_* instead of open coding string -> enum conversion

There are more occurrences, but I'm converting --source argument
of domifaddr command only, because I will need it in next commit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopo/Makefile.am: use SOURCE_DATE_EPOCH to set POT creation date
Pavel Hrdina [Mon, 6 Jan 2020 14:23:06 +0000 (15:23 +0100)]
po/Makefile.am: use SOURCE_DATE_EPOCH to set POT creation date

When building RPMs for libvirt the PO files are part of libvirt-libs
package.  Now that we generate libvirt.pot during build time the POT
creation date is also generated at that time.

The issue here is that when building libvirt-libs for x86_64 and i686
the generated libvirt.pot file will have different POT creation date
which affects installed PO files as well which leads to conflict when
installing both x86_64 and i686 packages.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agotravis: add build for Debian 9
Daniel P. Berrangé [Fri, 3 Jan 2020 17:14:08 +0000 (17:14 +0000)]
travis: add build for Debian 9

Debian 9 ships the oldest versions of some of our dependent
packages so can highlight bugs not seen elsewhere. CentOS 7,
despite being quite old, has rebased some packages to much
newer versions.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: introduce compile time API version checking
Daniel P. Berrangé [Fri, 3 Jan 2020 17:54:12 +0000 (17:54 +0000)]
util: introduce compile time API version checking

GLib header files annotate every API with a version number.

It is possible to define some constants before including
glib.h which will result in useful compile time warnings.

Setting GLIB_VERSION_MIN_REQUIRED will result in a warning
if libvirt uses an API that was deprecated in the declared
version, or before. Such API usage should be rewritten to
use the documented new replacement API.

Setting GLIB_VERSION_MAX_ALLOWED will result in a warning
if libvirt uses an API that was not introduced until a
version of GLib that's newer than our minimum declared
version. This avoids accidentally using functionality
that is not available on some supported platforms.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: remove use of g_date_time_new_from_iso8601 function
Daniel P. Berrangé [Mon, 6 Jan 2020 14:20:09 +0000 (14:20 +0000)]
src: remove use of g_date_time_new_from_iso8601 function

The g_date_time_new_from_iso8601() function was introduced as
a replacement for strptime in

  commit 810613a60efe3924c536b3663246900bc08910a5
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Mon Dec 23 15:37:26 2019 +0000

    src: replace strptime()/timegm()/mktime() with GDateTime APIs set

Unfortunately g_date_time_new_from_iso8601 isn't available until
glib 2.56, and backporting it requires alot of code copying and
poking at private glib structs.

This reverts domain_conf.c back to its original parsing logic prior
to 810613a60efe3924c536b3663246900bc08910a5, but using g_date_time_new()
instead of gmtime(). The other files are then adapted to follow a
similar approach.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: add compat impl of g_canonicalize_filename
Daniel P. Berrangé [Mon, 6 Jan 2020 11:54:20 +0000 (11:54 +0000)]
util: add compat impl of g_canonicalize_filename

g_canonicalize_filename was not introduced until glib 2.58
so we need a temporary backport of its impl.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: fix indent depth for glib compat impls
Daniel P. Berrangé [Mon, 6 Jan 2020 16:00:59 +0000 (16:00 +0000)]
util: fix indent depth for glib compat impls

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: keep glib compat methods in alphabetical order
Daniel P. Berrangé [Mon, 6 Jan 2020 15:56:10 +0000 (15:56 +0000)]
util: keep glib compat methods in alphabetical order

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: always replace g_fsync usage with our wrapper
Daniel P. Berrangé [Mon, 6 Jan 2020 11:42:17 +0000 (11:42 +0000)]
util: always replace g_fsync usage with our wrapper

g_fsync was introduced in 2.63 which is newer than our minimum
glib version. A future commit will introduce compile time
checking of API versions to prevent accidental usage of APIs
from glib newer than our min declared.

To avoid triggering this warning, however, we need to ensure
that we always use our wrapper function via glibcompat.c,
which will disable the API version warnings.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosecurity: improve security driver error message
Sebastian Mitterle [Tue, 7 Jan 2020 14:15:19 +0000 (14:15 +0000)]
security: improve security driver error message

Currently, when security driver is not available users are informed that
it wasn't found which can be confusing.
1. Update error message
2. Add comment to domain doc

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by Sebastian Mitterle <smitterl@redhat.com>

5 years agoselinux: Use fd_path instead of /dev/tap* to get context
Dominick Grift [Tue, 7 Jan 2020 14:22:30 +0000 (15:22 +0100)]
selinux: Use fd_path instead of /dev/tap* to get context

/dev/tap* is an invalid path but it works with lax policy.
Make it work with more accurate policy as well

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dominick Grift <dac.override@gmail.com>
5 years agoqemu: backup: roll-back checkpoint metadata if the checkpoint wasn't taken
Peter Krempa [Mon, 6 Jan 2020 14:32:54 +0000 (15:32 +0100)]
qemu: backup: roll-back checkpoint metadata if the checkpoint wasn't taken

We insert the checkpoint metadata into the list of checkpoints prior to
actually creating the on-disk bits. If the 'transaction' or any other
steps done between inserting the checkpoint and creating the on-disk
data fail we'd end up with an unusable checkpoint that would vanish
after libvirtd restart.

Prevent this by rolling back the metadata if we didn't actually take and
record the checkpoint.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: checkpoint: Extract and export rollback of checkpoint metadata storing
Peter Krempa [Mon, 6 Jan 2020 14:03:56 +0000 (15:03 +0100)]
qemu: checkpoint: Extract and export rollback of checkpoint metadata storing

If we are certain that the checkpoint creation failed we remove the
metadata from the list. To allow reusing this in the backup code add a
new helper and export it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoman: virsh: Mention how to disable snapshot of disk in snapshot-create-as
Peter Krempa [Tue, 7 Jan 2020 08:24:59 +0000 (09:24 +0100)]
man: virsh: Mention how to disable snapshot of disk in snapshot-create-as

Document that --diskspec DISK,snapshot=no disables snapshot for the
given disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agocpu_map/x86: Add support for BFLOAT16 data type
Jiri Denemark [Fri, 13 Dec 2019 16:08:44 +0000 (17:08 +0100)]
cpu_map/x86: Add support for BFLOAT16 data type

Introduced in QEMU by commit v4.1.0-266-g80db491da4.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovircgroupv2devices: Avoid double close on map FD
Michal Privoznik [Mon, 6 Jan 2020 14:06:20 +0000 (15:06 +0100)]
vircgroupv2devices: Avoid double close on map FD

When allowing/denying a device in devices CGroupV2 we have to
write a BPF program for it. The program we put there is merely
static and all it does it looks up a device in a hash table (also
known as map in BPF terminology). A map is referenced via an FD
which can be acquired via virBPFCreateMap() and like any other FD
it should be closed when no longer needed. However, we close it
twice: the first time in virCgroupV2DevicesAttachProg() which
closes it unconditionally, and the second time in either
virCgroupV2DevicesCreateProg() or
virCgroupV2DevicesPrepareProg(). Remove the second close.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agovircgroupv2devices: Unexport virCgroupV2DevicesAttachProg()
Michal Privoznik [Mon, 6 Jan 2020 14:05:05 +0000 (15:05 +0100)]
vircgroupv2devices: Unexport virCgroupV2DevicesAttachProg()

This function is not called outside of the source file where it's
defined. There's no need to export it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agoci: Fetch list of available container images dynamically
Andrea Bolognani [Wed, 11 Dec 2019 17:40:31 +0000 (18:40 +0100)]
ci: Fetch list of available container images dynamically

Any static list of images is destined to become outdated eventually,
so let's start generating it dynamically instead.

Unfortunately there doesn't seem to be a straightforward way to get
Podman/Docker to list all repositories under quay.io/libvirt, so we
have to resort to searching and filtering manually; and since the
two tools behave slightly differently in that regard, it's more
sane to have the logic in a separate shell script than it would be
to keep it inline in the Makefile with all the annoying escaping
doing so would entail.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoIntroduce command 'virsh domstats --memory' for reporting memory BW
Wang Huaqiang [Thu, 2 Jan 2020 10:45:05 +0000 (18:45 +0800)]
Introduce command 'virsh domstats --memory' for reporting memory BW

Introduce an option '--memory' for showing memory related
information. The memory bandwidth infomatio is listed as:

Domain: 'libvirt-vm'
 memory.bandwidth.monitor.count=4
 memory.bandwidth.monitor.0.name=vcpus_0-4
 memory.bandwidth.monitor.0.vcpus=0-4
 memory.bandwidth.monitor.0.node.count=2
 memory.bandwidth.monitor.0.node.0.id=0
 memory.bandwidth.monitor.0.node.0.bytes.total=10208067584
 memory.bandwidth.monitor.0.node.0.bytes.local=4807114752
 memory.bandwidth.monitor.0.node.1.id=1
 memory.bandwidth.monitor.0.node.1.bytes.total=8693735424
 memory.bandwidth.monitor.0.node.1.bytes.local=5850161152
 memory.bandwidth.monitor.1.name=vcpus_7
 memory.bandwidth.monitor.1.vcpus=7
 memory.bandwidth.monitor.1.node.count=2
 memory.bandwidth.monitor.1.node.0.id=0
 memory.bandwidth.monitor.1.node.0.bytes.total=853811200
 memory.bandwidth.monitor.1.node.0.bytes.local=290701312
 memory.bandwidth.monitor.1.node.1.id=1
 memory.bandwidth.monitor.1.node.1.bytes.total=406044672
 memory.bandwidth.monitor.1.node.1.bytes.local=229425152

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
5 years agoutil, resctrl: using 64bit interface instead of 32bit for counters
Wang Huaqiang [Thu, 2 Jan 2020 10:45:04 +0000 (18:45 +0800)]
util, resctrl: using 64bit interface instead of 32bit for counters

The underlying resctrl monitoring is actually using 64 bit counters,
not the 32bit one. Correct this by using 64bit data type for reading
hardware value.

To keep the interface consistent, the result of CPU last level cache
that occupied by vcpu processors of specific restrl monitor group is
still reported with a truncated 32bit data type. because, in silicon
world, CPU cache size will never exceed 4GB.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
5 years agoutil: time: Fix comment for virTimeFieldsNow
Peter Krempa [Fri, 15 Nov 2019 11:11:27 +0000 (12:11 +0100)]
util: time: Fix comment for virTimeFieldsNow

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 years agoschemas: backup: Remove pointless <choice> for 'name' of backup disk
Peter Krempa [Fri, 20 Dec 2019 10:27:37 +0000 (11:27 +0100)]
schemas: backup: Remove pointless <choice> for 'name' of backup disk

One of the first versions thought of using disk path as the second
option but this was dropped as being a legacy interface. Remove the
leftover pointless <choice> wrapper for the disk name as there's just
one option now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: process: Terminate backup job on VM destroy
Peter Krempa [Fri, 20 Dec 2019 10:20:24 +0000 (11:20 +0100)]
qemu: process: Terminate backup job on VM destroy

Commit d75f865fb989b3e6330c78c28e1c3bf7fa28e6a5 caused a job-deadlock if
a VM is running the backup job and being destroyed as it removed the
cleanup of the async job type and there was nothing to clean up the
backup job.

Add an explicit cleanup of the backup job when destroying a VM.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>