]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agoqemu: hotplug: ensure address generation for vfio-ccw
Bjoern Walk [Mon, 28 Oct 2019 08:06:13 +0000 (09:06 +0100)]
qemu: hotplug: ensure address generation for vfio-ccw

When attaching a mediated host device of model vfio-ccw without
specifying a guest-address, none is generated by libvirt. Let's fix this
and make sure to generate a device address during live-hotplug.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirpcimock: Make @fakerootdir static
Michal Privoznik [Tue, 22 Oct 2019 11:10:20 +0000 (13:10 +0200)]
virpcimock: Make @fakerootdir static

Since we are not passing the @fakerootdir variable to any inline function
anymore, we can make the variable static.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoDrop virVasprintf()
Michal Privoznik [Tue, 22 Oct 2019 12:13:39 +0000 (14:13 +0200)]
Drop virVasprintf()

Now that function is no longer used, it can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirstring: Drop virVasprintfQuiet()
Michal Privoznik [Tue, 22 Oct 2019 11:47:19 +0000 (13:47 +0200)]
virstring: Drop virVasprintfQuiet()

This macro is no longer used and therefore can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoDrop virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 11:17:18 +0000 (13:17 +0200)]
Drop virAsprintf()

Now that function is no longer used, it can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirstring: Drop virAsprintfQuiet()
Michal Privoznik [Tue, 22 Oct 2019 08:49:33 +0000 (10:49 +0200)]
virstring: Drop virAsprintfQuiet()

This macro is no longer used and therefore can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoUse g_strdup_vprintf() instead of virVasprintf() everywhere
Michal Privoznik [Tue, 22 Oct 2019 12:11:15 +0000 (14:11 +0200)]
Use g_strdup_vprintf() instead of virVasprintf() everywhere

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoUse g_strdup_printf instead of virAsprintf everywhere
Michal Privoznik [Tue, 22 Oct 2019 13:48:08 +0000 (15:48 +0200)]
Use g_strdup_printf instead of virAsprintf everywhere

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
tools: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotests: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
tests: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovz: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
vz: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovmx: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
vmx: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovmware: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
vmware: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovbox: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
vbox: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agosecret: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
secret: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoutil: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
util: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotest: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
test: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agostorage: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
storage: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agosecurity: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
security: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agorpc: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
rpc: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoremote: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
remote: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
qemu: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agophyp: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
phyp: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoopenvz: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
openvz: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agonwfilter: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
nwfilter: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agonode_device: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
node_device: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agonetwork: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
network: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agolxc: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
lxc: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agologging: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
logging: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agolocking: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
locking: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agolibxl: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
libxl: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agointerface: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
interface: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agohyperv: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
hyperv: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoesx: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
esx: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agocpu: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
cpu: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
conf: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agobhyve: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
bhyve: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoaccess: Use g_strdup_printf() instead of virAsprintf()
Michal Privoznik [Tue, 22 Oct 2019 13:26:14 +0000 (15:26 +0200)]
access: Use g_strdup_printf() instead of virAsprintf()

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc: Wrap long lines in Makefiles
Michal Privoznik [Tue, 12 Nov 2019 15:07:41 +0000 (16:07 +0100)]
src: Wrap long lines in Makefiles

In my previous commit of v5.9.0-83-g4ae7181376 I've fixed
check-aclrules but whilst doing so, I forgot to wrap long
lines that I've added.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agospec: fix vpath build on RHEL 7
Pavel Hrdina [Mon, 11 Nov 2019 14:22:45 +0000 (15:22 +0100)]
spec: fix vpath build on RHEL 7

Macro _vpath_builddir is not defined so we have to define it ourselves.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agomake check-driverimpls work again
Michal Privoznik [Mon, 11 Nov 2019 12:41:34 +0000 (13:41 +0100)]
make check-driverimpls work again

Previously we generated all source files into $srcdir which is no
longer true. This means that we can't just blindly prepend each
source file with $srcdir.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: Make check-aclrules work again
Michal Privoznik [Mon, 11 Nov 2019 05:37:33 +0000 (06:37 +0100)]
src: Make check-aclrules work again

Previously we generated all source files into $srcdir which is no
longer true. This means that we can't just blindly prepend each
source file with $srcdir.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: capabilities: Modernize virCapabilitiesFormatMemoryBandwidth
Peter Krempa [Fri, 25 Oct 2019 14:26:35 +0000 (16:26 +0200)]
conf: capabilities: Modernize virCapabilitiesFormatMemoryBandwidth

Use virXMLFormatElement and the automatic memory handlers to simplfy the
code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: caps: Modernize virCapabilitiesFormatCaches
Peter Krempa [Fri, 25 Oct 2019 14:16:41 +0000 (16:16 +0200)]
conf: caps: Modernize virCapabilitiesFormatCaches

Use automatic memory freeing and use virXMLFormatElement instead of open
coding it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: turn virDomainMemtuneFormat void
Peter Krempa [Wed, 30 Oct 2019 11:09:34 +0000 (12:09 +0100)]
conf: turn virDomainMemtuneFormat void

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: domain: Split up formatting of <memtune> and <memoryBacking>
Peter Krempa [Fri, 25 Oct 2019 15:21:37 +0000 (17:21 +0200)]
conf: domain: Split up formatting of <memtune> and <memoryBacking>

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: caps: Automaticaly free 'cpus_str'
Peter Krempa [Fri, 25 Oct 2019 14:11:34 +0000 (16:11 +0200)]
conf: caps: Automaticaly free 'cpus_str'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Rename virDomainCapsFeature to virDomainProcessCapsFeature
Peter Krempa [Fri, 25 Oct 2019 12:50:15 +0000 (14:50 +0200)]
conf: Rename virDomainCapsFeature to virDomainProcessCapsFeature

The enum name sounds too generic. It in fact describes the capabilities
of the process, thus add 'Process' to the name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: storagecaps: Fix broken attempt at being const-correct
Peter Krempa [Fri, 25 Oct 2019 12:25:16 +0000 (14:25 +0200)]
conf: storagecaps: Fix broken attempt at being const-correct

The code formatting storage capabilities faithfully copied the wrong use
of 'const' from domain capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: domaincaps: Fix broken attempt at being const-correct
Peter Krempa [Fri, 25 Oct 2019 12:21:08 +0000 (14:21 +0200)]
conf: domaincaps: Fix broken attempt at being const-correct

'virBlahPtr const blah' results into modification to the value of 'blah'
triggering compilation error rather than the modification of the virBlah
struct the pointer points to.

All of the domain capability formatting code was broken in this regard.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: caps: Make capability filler functions void
Peter Krempa [Fri, 25 Oct 2019 11:25:20 +0000 (13:25 +0200)]
qemu: caps: Make capability filler functions void

Most of them don't have anything to report so we can simplify the logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: caps: Rework memory allocation in virQEMUCapsFillDomainFeatureSEVCaps
Peter Krempa [Fri, 25 Oct 2019 11:18:55 +0000 (13:18 +0200)]
qemu: caps: Rework memory allocation in virQEMUCapsFillDomainFeatureSEVCaps

Use g_new0 instead of VIR_ALLOC to avoid error cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agostorage: improve the while loop virStorageBackendFileSystemIsMounted
Yi Li [Thu, 31 Oct 2019 03:55:26 +0000 (11:55 +0800)]
storage: improve the while loop virStorageBackendFileSystemIsMounted

Move virStorageBackendFileSystemGetPoolSource outside of the while loop

Signed-off-by: Yi Li <yili@winhong.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: remove duplicate header files
Mao Zhongyi [Wed, 30 Oct 2019 03:42:11 +0000 (11:42 +0800)]
qemu: remove duplicate header files

"#include vircgroup.h" appears in both qemu_cgroup.h and
qemu_cgroup.c, and qemu_cgroup.c contains qemu_cgroup.h,
so remove the duplicate declarations.

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agolxc: remove duplicate header files
Mao Zhongyi [Wed, 30 Oct 2019 03:42:10 +0000 (11:42 +0800)]
lxc: remove duplicate header files

"#include vircgroup.h" appears in both lxc_cgroup.h and
lxc_cgroup.c, and lxc_cgroup.c contains lxc_cgroup.h,
so remove the duplicate declarations.

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: snapshot: split out preparation of a snapshot with blockdev
Peter Krempa [Fri, 25 Oct 2019 07:30:56 +0000 (09:30 +0200)]
qemu: snapshot: split out preparation of a snapshot with blockdev

Separate the blockdev code since it makes the original function lengthy.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: command: Use XML based disk bus convertor in error message
Peter Krempa [Fri, 8 Nov 2019 14:37:26 +0000 (15:37 +0100)]
qemu: command: Use XML based disk bus convertor in error message

The qemu driver has an internal implementation for converting disk bus
to string for use with qemu. This should not be used in error messages
though as we want to report the string based on the XML value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Eric Blake <eblake@redhat.com>
5 years agosyms: Add 'global:' keyword to LIBVIRT_5.8 section
Peter Krempa [Thu, 31 Oct 2019 10:37:41 +0000 (11:37 +0100)]
syms: Add 'global:' keyword to LIBVIRT_5.8 section

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodatatypes: Fix comment for the _virNetwork struct
Peter Krempa [Thu, 31 Oct 2019 10:35:17 +0000 (11:35 +0100)]
datatypes: Fix comment for the _virNetwork struct

The comment was copied form the domain and the object type was not
changed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Warn verbosely if using old loader:nvram pairs
Michal Privoznik [Mon, 11 Nov 2019 16:22:50 +0000 (17:22 +0100)]
qemu: Warn verbosely if using old loader:nvram pairs

There are two ways for specifying loader:nvram pairs:

  1) --with-loader-nvram configure option
  2) nvram variable in qemu.conf

Since we have FW descriptors, using this old style is
discouraged, but not as strong as one would expect. Produce more
warnings:

  1) produce a warning if somebody tries the configure option
  2) produce a warning if somebody sets nvram variable and at
     least on FW descriptor was found

The reason for producing warning in case 1) is that package
maintainers, who set the configure option in the first place
should start moving towards FW descriptors and abandon the
configure option. After all, the warning is printed into config
output only in this case.

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: pci: Remove always-false condition
Peter Krempa [Mon, 11 Nov 2019 12:03:14 +0000 (13:03 +0100)]
util: pci: Remove always-false condition

Commit d19c21429fd modified the condition so that it checks whether the
value is more than 0xFFFFFFFF. Since addr->domain is an unsigned int, it
will never be more than that.

Remove the whole check

src/util/virpci.c:1291:22: error: result of comparison 'unsigned int' > 4294967295 is always false [-Werror,-Wtautological-type-limit-compare]
    if (addr->domain > 0xFFFFFFFF) {
        ~~~~~~~~~~~~ ^ ~~~~~~~~~~

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 years agotests: make domaincapstest less anoying to debug
Peter Krempa [Fri, 25 Oct 2019 11:59:46 +0000 (13:59 +0200)]
tests: make domaincapstest less anoying to debug

Since 6a077cf2b3 domaincapstest does not run through all cases on
failure but terminates right away. This makes it super annoying to debug
or use in combination with VIR_TEST_REGENERATE_OUTPUT.

Fix it by remembering failure and still running through all cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agobuild: fix substitution of RUNSTATEDIR in man pages
Daniel P. Berrangé [Fri, 18 Oct 2019 14:31:30 +0000 (15:31 +0100)]
build: fix substitution of RUNSTATEDIR in man pages

When RUNSTATEDIR was introduced

  commit d29c917ef470a25149d1f3787ec494d006549f27
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Tue Aug 20 16:05:12 2019 +0100

    src: honour the RUNSTATEDIR variable in all code

The makefile rules for man pages were accidentally not updated for the
new variablle name.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: comment on why we're not adopting certain flake8 rules
Daniel P. Berrangé [Tue, 8 Oct 2019 09:38:29 +0000 (10:38 +0100)]
build: comment on why we're not adopting certain flake8 rules

Simplify the list of ignored warnings now that we only have two left,
and document why we're not honouring them.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: sanitize indentation after line continuations
Daniel P. Berrangé [Tue, 24 Sep 2019 16:26:29 +0000 (17:26 +0100)]
python: sanitize indentation after line continuations

Line continuations should be 4 space indented unless a previous opening
brace required different alignment.

docs/apibuild.py:2014:24: E126 continuation line over-indented for hanging indent
                       token[0], token[1]))
                       ^
docs/apibuild.py:74:3: E121 continuation line under-indented for hanging indent
  "ATTRIBUTE_UNUSED": (0, "macro keyword"),
  ^
...more...

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: sanitize spaces either side of operators
Daniel P. Berrangé [Tue, 24 Sep 2019 15:47:02 +0000 (16:47 +0100)]
python: sanitize spaces either side of operators

There should be a single space either side of operators. Inline
comments should have two spaces before the '#'

src/hyperv/hyperv_wmi_generator.py:130:45: E261 at least two spaces before inline comment
            source += '    { "", "", 0 },\n' # null terminated
                                            ^
src/esx/esx_vi_generator.py:417:25: E221 multiple spaces before operator
    FEATURE__DESERIALIZE  = (1 << 6)
                        ^
tests/cputestdata/cpu-cpuid.py:187:78: E225 missing whitespace around operator
                f.write("  <msr index='0x%x' edx='0x%08x' eax='0x%08x'/>\n" %(
                                                                             ^
docs/apibuild.py:524:47: E226 missing whitespace around arithmetic operator
                            self.line = line[i+2:]
                                              ^
...more...

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: sanitize blank line usage
Daniel P. Berrangé [Tue, 24 Sep 2019 12:55:56 +0000 (13:55 +0100)]
python: sanitize blank line usage

Coding style expects 1 blank line between each method and 2 blank lines
before each class.

docs/apibuild.py:171:5: E303 too many blank lines (2)
    def set_header(self, header):
    ^
docs/apibuild.py:230:1: E302 expected 2 blank lines, found 1
class index:
^
docs/apibuild.py:175:5: E301 expected 1 blank line, found 0
    def set_module(self, module):
    ^
...more...

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: avoid bare 'except:' clause
Daniel P. Berrangé [Tue, 24 Sep 2019 12:42:51 +0000 (13:42 +0100)]
python: avoid bare 'except:' clause

Exception catching statements should always match on a class name, the
most specific one possible. Rather than analyse the code to look at what
the most specific one is, this just uses the base Exception class.

docs/apibuild.py:255:9: E722 do not use bare 'except'
        except:
        ^
docs/apibuild.py:279:9: E722 do not use bare 'except'
        except:
        ^
...more...

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: avoid variable named 'l'
Daniel P. Berrangé [Tue, 24 Sep 2019 12:40:44 +0000 (13:40 +0100)]
python: avoid variable named 'l'

Python code style recommends avoiding a variable named 'l' as it is
visually similar to '1'.

docs/apibuild.py:482:13: E741 ambiguous variable name 'l'
            l = len(line)
            ^
docs/apibuild.py:503:21: E741 ambiguous variable name 'l'
                    l = len(line)
                    ^
...more...

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: mark regex strings with 'r' prefix
Daniel P. Berrangé [Tue, 24 Sep 2019 12:29:27 +0000 (13:29 +0100)]
python: mark regex strings with 'r' prefix

When writing regexes special regex matches like "\d" can get
misinterpreted as normal string escape sequences:

docs/apibuild.py:1359:51: W605 invalid escape sequence '\d'
                        value = value + re.sub("^(\d+)U$", "\\1", token[1])
                                                  ^
docs/apibuild.py:2134:31: W605 invalid escape sequence '\('
                m = re.match("\(?1<<(\d+)\)?", info[0])
                              ^
docs/apibuild.py:2134:38: W605 invalid escape sequence '\d'
                m = re.match("\(?1<<(\d+)\)?", info[0])
                                     ^
docs/apibuild.py:2134:42: W605 invalid escape sequence '\)'
                m = re.match("\(?1<<(\d+)\)?", info[0])
                                         ^

To avoid this probem all regexes should use the r"...." syntax for their
strings, which disables normal string escape sequences.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopython: fix use of undeclared variables in python scripts
Daniel P. Berrangé [Tue, 24 Sep 2019 12:10:46 +0000 (13:10 +0100)]
python: fix use of undeclared variables in python scripts

docs/apibuild.py:2436:65: F821 undefined name 'first_letter'
                        chunks.append(["chunk%s" % (chunk - 1), first_letter, letter])
                                                                ^
src/hyperv/hyperv_wmi_generator.py:415:57: F821 undefined name 'number'
        report_error("line %d: invalid block header" % (number))
                                                        ^

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: change flake8 to use blacklist instead of whitelist
Daniel P. Berrangé [Tue, 24 Sep 2019 11:50:43 +0000 (12:50 +0100)]
build: change flake8 to use blacklist instead of whitelist

The current flake8 check only looks at one item (semicolons at end of
line). This means that our code quality will continue to get worse,
violating an increasing number of checks.

Switching to a whitelist means that we freeze the badness at its
current level & can incrementally fix things up.

We are excluding the following...

Indentation:

  E114 indentation is not a multiple of four (comment)
  E115 expected an indented block (comment)
  E116 unexpected indentation (comment)
  E121 continuation line under-indented for hanging indent
  E125 continuation line with same indent as next logical line
  E126 continuation line over-indented for hanging indent
  E127 continuation line over-indented for visual indent
  E128 continuation line under-indented for visual indent
  E129 visually indented line with same indent as next logical line
  E131 continuation line unaligned for hanging indent

Whitespace:

  E211 whitespace before ‘(‘
  E221 multiple spaces before operator
  E222 multiple spaces after operator
  E225 missing whitespace around operator
  E226 missing whitespace around arithmetic operator
  E231 missing whitespace after ‘,’, ‘;’, or ‘:’
  E261 at least two spaces before inline comment

Blank lines

  E301 expected 1 blank line, found 0
  E302 expected 2 blank lines, found 0
  E303 too many blank lines (3)
  E305 expected 2 blank lines after end of function or class

Line length

  E501 line too long (82 > 79 characters)

Statements

  E722 do not use bare except, specify exception instead
  E741 do not use variables named ‘l’, ‘O’, or ‘I’

Errors:

  F821 undefined name 'name'

Warnings:

  W504 line break after binary operator
  W605 invalid escape sequence ‘x’

Later commits will enable most of these exclusions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: remove some dead code in apibuild.py
Daniel P. Berrangé [Tue, 24 Sep 2019 16:29:11 +0000 (17:29 +0100)]
docs: remove some dead code in apibuild.py

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agospec: fix rpm build with VPATH
Pavel Hrdina [Sat, 9 Nov 2019 12:04:04 +0000 (13:04 +0100)]
spec: fix rpm build with VPATH

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agosrc: lxc: Fix typo in a Makefile variable
Michal Privoznik [Sun, 10 Nov 2019 10:06:19 +0000 (11:06 +0100)]
src: lxc: Fix typo in a Makefile variable

In commit 0985a9597bb0348d46c0d18dc548a676bf0ad8e2 we stopped
distributing generated source file. This is done by prepending
binary_SOURCES variable with "nodist_". However, there is a typo
- the prefix is "nodst_" instead of "nodist_".

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agosrc: add missing include access path for bhyve and vz drivers
Pavel Hrdina [Fri, 8 Nov 2019 20:11:24 +0000 (21:11 +0100)]
src: add missing include access path for bhyve and vz drivers

Commit <b98f90cf913965243c6e2c49a52aa170a48093ef> forgot to update
bhyve and vz Makefile files as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: update news file
Laine Stump [Wed, 28 Aug 2019 01:46:39 +0000 (21:46 -0400)]
docs: update news file

with info about support for using precreated tap/macvtap devices in
unprivileged libvirtd.

Signed-off-by: Laine Stump <laine@redhat.com>
5 years agotools: stop distributing generated source files
Pavel Hrdina [Thu, 17 Oct 2019 12:03:15 +0000 (14:03 +0200)]
tools: stop distributing generated source files

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: stop distributing generated source files
Pavel Hrdina [Wed, 23 Oct 2019 12:24:37 +0000 (14:24 +0200)]
src: stop distributing generated source files

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: remote: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:52:23 +0000 (14:52 +0200)]
src: remote: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: lxc: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:51:25 +0000 (14:51 +0200)]
src: lxc: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: logging: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:49:44 +0000 (14:49 +0200)]
src: logging: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: locking: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:48:01 +0000 (14:48 +0200)]
src: locking: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: hyperv: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:46:20 +0000 (14:46 +0200)]
src: hyperv: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: esx: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:45:15 +0000 (14:45 +0200)]
src: esx: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: admin: generate source files into build directory
Pavel Hrdina [Wed, 23 Oct 2019 22:56:14 +0000 (00:56 +0200)]
src: admin: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: access: generate source files into build directory
Pavel Hrdina [Wed, 23 Oct 2019 23:36:43 +0000 (01:36 +0200)]
src: access: generate source files into build directory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosrc: generate source files into build directory
Pavel Hrdina [Wed, 16 Oct 2019 12:41:49 +0000 (14:41 +0200)]
src: generate source files into build directory

This affects more than src/Makefile.am as the rule to generate source
files for protocols is generic for all sub-directories.

Affected files are:
    src/admin/admin_protocol.{h,c}
    src/locking/lock_protocol.{h,c}
    src/logging/log_protocol.{h,c}
    src/lxc/lxc_monitor_protocol.{h,c}
    src/remote/{lxc,qemu,remote}_protocol.{h,c}
    src/rpc/{virkeepalive,virnet}protocol.{h,c}

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoremote: unify rpc server dispatch generated files
Pavel Hrdina [Wed, 23 Oct 2019 23:22:16 +0000 (01:22 +0200)]
remote: unify rpc server dispatch generated files

Our naming was not consistent.  Use the protocol name as prefix for all
generated files.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopo: README.md: add a note about which Zanata client is required
Pavel Hrdina [Thu, 24 Oct 2019 12:56:16 +0000 (14:56 +0200)]
po: README.md: add a note about which Zanata client is required

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopo: rewrite the way how we generate files
Pavel Hrdina [Fri, 8 Nov 2019 14:25:33 +0000 (15:25 +0100)]
po: rewrite the way how we generate files

There was no need to handle files for translation from build directory
but that will change with following patches where we will stop
generating source files into source directory.

In order to have them included for translation we have to prefix each
file with SRCDIR or BUILDDIR.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopo: generate files into build directory
Pavel Hrdina [Wed, 23 Oct 2019 19:56:50 +0000 (21:56 +0200)]
po: generate files into build directory

Historically we did not support VPATH builds and everything was
generated into source directory.  The introduction of VPATH builds
did not changed the way how our translation files are handled.

This patch changes the rules to generate everything into build
directory and stops distributing generated files in order to have
properly separated VPATH builds.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosyntax-check.mk: cleanup generated_files list for sc_po_check
Pavel Hrdina [Wed, 23 Oct 2019 19:33:31 +0000 (21:33 +0200)]
syntax-check.mk: cleanup generated_files list for sc_po_check

Move generated_files variable closer to the sc_po_check rule and
remove non-existent gnulib internal path.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosyntax-check.mk: cleanup sc_po_check dependencies
Pavel Hrdina [Wed, 23 Oct 2019 13:35:05 +0000 (15:35 +0200)]
syntax-check.mk: cleanup sc_po_check dependencies

Introduce new rule 'generated-sources' as a helper for PO files check
to make sure that all generated files are prepared and to not duplicate
the list on different places.  This will be used as a dependency for
sc_po_check rule instead of duplicated list of generated files.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agosyntax-check.mk: fix sc_po_check rule
Pavel Hrdina [Wed, 23 Oct 2019 19:26:31 +0000 (21:26 +0200)]
syntax-check.mk: fix sc_po_check rule

Commit <22d8e27ccd5faf48ee2bf288a1b9059aa7ffd28b> introduced our
syntax-check.mk file based on gnulib rules. However, the rule was
completely ignored as we don't have POTFILES.in file.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years ago.gitignore: cleanup old and obsolete ignores
Pavel Hrdina [Thu, 24 Oct 2019 08:26:12 +0000 (10:26 +0200)]
.gitignore: cleanup old and obsolete ignores

Now that we forbid builds in source directory we can remove a lot of
ignores that are created during build time.  To make the cleanup easier
in the future create a sections in our .gitignore file.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: mandate use of a build dir != src dir
Pavel Hrdina [Wed, 6 Nov 2019 14:55:12 +0000 (15:55 +0100)]
build: mandate use of a build dir != src dir

Historically we've allowed builds in the main src dir, but meson does
not support this. Explicitly force separate build dir in autotools to
align with meson. We must re-enable dependency tracking which the RPM
%configure macro turns off. Without this, the build dir doesn't get
the source directory tree mirrored.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Check for job being set when getting iothread stats
Michal Privoznik [Thu, 7 Nov 2019 12:43:21 +0000 (13:43 +0100)]
qemu: Check for job being set when getting iothread stats

The qemuDomainGetStatsIOThread() accesses the monitor by calling
qemuDomainGetIOThreadsMon(). And it's also marked as "need
monitor" in qemuDomainGetStatsWorkers[]. However, it's not
checking if acquiring job was successful.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agoqemu: Warn on possibly incorrect usage of EnterMonitor*
Michal Privoznik [Thu, 7 Nov 2019 13:05:43 +0000 (14:05 +0100)]
qemu: Warn on possibly incorrect usage of EnterMonitor*

The qemuDomainObjEnterMonitor() should not be called without a
job set. Catch this error and produce a warning message if such
call occurred.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agoutil: Set SIGPIPE to a no-op handler in virFork
Wang Yechao [Fri, 8 Nov 2019 00:25:15 +0000 (08:25 +0800)]
util: Set SIGPIPE to a no-op handler in virFork

Libvirtd has set SIGPIPE to ignored, and virFork resets all signal
handlers to the defaults. But child process may write logs to
stderr/stdout, that may generate SIGPIPE if journald has stopped.

So set SIGPIPE to a dummy no-op handler before unmask signals in
virFork(), and the handler will get reset to SIG_DFL when execve()
runs. Now we can delete sigaction() call entirely in virExec().

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>