]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agoutil: hash: Add possibility to use simpler data free function in virHash
Peter Krempa [Wed, 9 Oct 2019 13:26:37 +0000 (15:26 +0200)]
util: hash: Add possibility to use simpler data free function in virHash

Introduce a new type virHashDataFreeSimple which has only a void * as
argument for cases when knowing the name of the entry when freeing the
hash entry is not required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
ACKed-by: Eric Blake <eblake@redhat.com>
5 years agoReplace virDomainDiskByName by virDomainDiskByTarget in appropriate cases
Peter Krempa [Mon, 14 Oct 2019 15:24:20 +0000 (17:24 +0200)]
Replace virDomainDiskByName by virDomainDiskByTarget in appropriate cases

In many cases we used virDomainDiskByName to solely look up disk by
target. We have a new helper now so we can replace it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoconf: Remove unused virDomainDiskFindByBusAndDst
Peter Krempa [Mon, 14 Oct 2019 15:19:15 +0000 (17:19 +0200)]
conf: Remove unused virDomainDiskFindByBusAndDst

Previous commit removed last use of this function so we can get rid of
it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: Replace use of virDomainDiskFindByBusAndDst with virDomainDiskByTarget
Peter Krempa [Mon, 14 Oct 2019 15:17:16 +0000 (17:17 +0200)]
qemu: Replace use of virDomainDiskFindByBusAndDst with virDomainDiskByTarget

In both replaced cases we have other code that verifies that the bus
can't be changed or that the target is unique, so limiting the search to
disks with same bus makes no sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoconf: Introduce virDomainDiskByTarget
Peter Krempa [Mon, 14 Oct 2019 14:54:53 +0000 (16:54 +0200)]
conf: Introduce virDomainDiskByTarget

Introduce a simpler replacement for virDomainDiskByName when looking up
by disk target.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoconf: Remove virDomainDiskPathByName
Peter Krempa [Mon, 14 Oct 2019 14:47:21 +0000 (16:47 +0200)]
conf: Remove virDomainDiskPathByName

Last use was removed in 29682196d8f.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData
Peter Krempa [Tue, 8 Oct 2019 13:17:32 +0000 (15:17 +0200)]
qemu: domain: Tolerate NULL @disk in qemuDomainPrepareDiskSourceData

In some cases we want to prepare a @src which is not meant to belong to
a disk and thus does not require us to copy the data. Allow passing in
NULL @disk into qemuDomainPrepareDiskSourceData.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: domain: clarify sematics of qemuDomainPrepareDiskSourceData
Peter Krempa [Tue, 8 Oct 2019 13:16:41 +0000 (15:16 +0200)]
qemu: domain: clarify sematics of qemuDomainPrepareDiskSourceData

Note in the comment that this function prepares the storage source based
on the configuration of the disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: domain: Remove pointless return value in qemuDomainPrepareDiskSourceData
Peter Krempa [Tue, 8 Oct 2019 13:14:22 +0000 (15:14 +0200)]
qemu: domain: Remove pointless return value in qemuDomainPrepareDiskSourceData

The function does not do anything that could fail. Remove the return
value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: domain: Split out setup of virStorageSource from qemu driver config
Peter Krempa [Tue, 8 Oct 2019 12:58:48 +0000 (14:58 +0200)]
qemu: domain: Split out setup of virStorageSource from qemu driver config

qemuDomainPrepareDiskSourceData historically prepared everything but
we've split out the majority of the functionality so that it sets up
predominately only according to the configuration of the disk. There
was one leftover bit of setting the gluster debug level from the config.

Split this out into a separate function so that
qemuDomainPrepareDiskSourceData only prepares based on the disk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
ACKed-by: Eric Blake <eblake@redhat.com>
5 years agotests: Add test case for empty 'network' cdrom
Peter Krempa [Tue, 15 Oct 2019 13:19:58 +0000 (15:19 +0200)]
tests: Add test case for empty 'network' cdrom

We don't allow such config in the schema but the code can handle that so
add a test case supporting it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: Reset disk type if <source> element is completely missing
Peter Krempa [Tue, 15 Oct 2019 13:21:21 +0000 (15:21 +0200)]
conf: Reset disk type if <source> element is completely missing

The disk type is not part of source and thus it's parsed earlier. This
bypasses the checks when parsing a disk type='network' if it's
completely missing the source.

Since there are possible active users of this (it was reported as a
problem with openstack) fix it by resetting the disk type to '_FILE' for
an empty cdrom which is handled correctly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemuDomainGetHostdevPath: Drop @freeTmpPath
Michal Privoznik [Tue, 17 Sep 2019 09:25:03 +0000 (11:25 +0200)]
qemuDomainGetHostdevPath: Drop @freeTmpPath

The @freeTmpPath boolean is used to determine if @tmpPath holds
an allocated memory or is a pointer to a constant string and
therefore if it needs to be freed or not when returning from the
function. Well, we can unify the way we set @tmpPath so that it
always holds an allocated memory and thus always must be freed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoqemu_domain: Drop few useless checks in qemuDomainGetHostdevPath
Michal Privoznik [Tue, 17 Sep 2019 09:20:42 +0000 (11:20 +0200)]
qemu_domain: Drop few useless checks in qemuDomainGetHostdevPath

There are three cases where vir*DeviceGetPath() returns a const
string. In these cases, the string is initialized in
corresponding vir*DeviceNew() calls which fail if string couldn't
be allocated. There's no point in checking the second time if the
string is NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoqemu_cgroup: Teardown Cgroup for more host device types
Michal Privoznik [Tue, 17 Sep 2019 08:39:00 +0000 (10:39 +0200)]
qemu_cgroup: Teardown Cgroup for more host device types

Since its introduction in v1.0.5-rc1-19-g6e13860cb4 the
qemuTeardownHostdevCgroup() does nothing unless the passed
hostdev is a PCI device with VFIO backend. This seems
unnecessary.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoqemu: Introduce qemuDomainNeedsVFIO
Michal Privoznik [Mon, 16 Sep 2019 15:14:48 +0000 (17:14 +0200)]
qemu: Introduce qemuDomainNeedsVFIO

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoqemu_hostdev: Introduce qemuHostdevNeedsVFIO()
Michal Privoznik [Tue, 17 Sep 2019 07:33:28 +0000 (09:33 +0200)]
qemu_hostdev: Introduce qemuHostdevNeedsVFIO()

There are two types of host devices that require /dev/vfio/vfio
access:

  1) PCI devices with VFIO backend
  2) Mediated devices

Introduce a simple helper that returns true if passed @hostdev
falls in either of the categories.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoconf: Introduce virDomainDefHasMdevHostdev
Michal Privoznik [Tue, 17 Sep 2019 05:54:32 +0000 (07:54 +0200)]
conf: Introduce virDomainDefHasMdevHostdev

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirhostdev: Introduce and use virHostdevIsVFIODevice
Michal Privoznik [Tue, 6 Aug 2019 14:25:12 +0000 (16:25 +0200)]
virhostdev: Introduce and use virHostdevIsVFIODevice

In some places we need to check if a hostdev has VFIO backend.
Because of how complicated virDomainHostdevDef structure is, the
check consists of three lines. Move them to a function and
replace all checks with the function call.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agovirhostdev: Fix const correctness of virHostdevIs{PCINet,SCSI,Mdev}Device()
Michal Privoznik [Tue, 6 Aug 2019 13:38:06 +0000 (15:38 +0200)]
virhostdev: Fix const correctness of virHostdevIs{PCINet,SCSI,Mdev}Device()

These functions do not change any of the passed hostdevs. They
just read them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
5 years agoUse g_strdup instead of VIR_STRDUP everywhere
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
Use g_strdup instead of VIR_STRDUP everywhere

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotools: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
tools: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
tests: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovbox: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
vbox: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
util: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovircgroup: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
vircgroup: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirstorage: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
virstorage: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotest: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
test: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agostorage: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
storage: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agosecurity: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
security: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agorpc: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
rpc: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoremote: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
remote: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
qemu: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonwfilter: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
nwfilter: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonode_device: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
node_device: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonetwork: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
network: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolxc: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
lxc: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agologging: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
logging: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolocking: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
locking: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolibxl: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
libxl: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agointerface: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
interface: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoesx: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
esx: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodatatypes: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
datatypes: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agocpu: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
cpu: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
conf: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agobhyve: use g_strdup instead of VIR_STRDUP
Ján Tomko [Sun, 20 Oct 2019 11:49:46 +0000 (13:49 +0200)]
bhyve: use g_strdup instead of VIR_STRDUP

Replace all occurrences of
  if (VIR_STRDUP(a, b) < 0)
     /* effectively dead code */
with:
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoUse g_strdup to fill in default values
Ján Tomko [Fri, 18 Oct 2019 13:08:21 +0000 (15:08 +0200)]
Use g_strdup to fill in default values

Replace:
  if (!s && VIR_STRDUP(s, str) < 0)
    goto;
with:
  if (!s)
    s = g_strdup(str);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoUse g_strdup where VIR_STRDUP's return value was propagated
Ján Tomko [Sun, 20 Oct 2019 10:55:05 +0000 (12:55 +0200)]
Use g_strdup where VIR_STRDUP's return value was propagated

All the callers of these functions only check for a negative
return value.

However, virNetDevOpenvswitchGetVhostuserIfname is documented
as returning 1 for openvswitch interfaces so preserve that.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodrivers: use g_strdup in probe functions
Ján Tomko [Sun, 20 Oct 2019 10:41:35 +0000 (12:41 +0200)]
drivers: use g_strdup in probe functions

The callers expect '1' on a successful probe,
so return 1 just like VIR_STRDUP would.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoUse g_strdup instead of ignoring VIR_STRDUP_QUIET's value
Ján Tomko [Fri, 18 Oct 2019 11:27:03 +0000 (13:27 +0200)]
Use g_strdup instead of ignoring VIR_STRDUP_QUIET's value

Replace all the occurrences of
  ignore_value(VIR_STRDUP_QUIET(a, b));
with
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoUse g_strdup instead of ignoring VIR_STRDUP's value
Ján Tomko [Fri, 18 Oct 2019 11:27:03 +0000 (13:27 +0200)]
Use g_strdup instead of ignoring VIR_STRDUP's value

Replace all the occurrences of
  ignore_value(VIR_STRDUP(a, b));
with
  a = g_strdup(b);

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: use g_strdup in virDomainDiskSet
Ján Tomko [Sat, 19 Oct 2019 16:41:29 +0000 (18:41 +0200)]
conf: use g_strdup in virDomainDiskSet

Use a temporary variable to allow copying from the
currently set source.

Always return 0 since none of the callers distinguishes
between 0 and 1 propagated from VIR_STRDUP.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: fix check for iscsi initiator copy
Ján Tomko [Sun, 20 Oct 2019 10:37:05 +0000 (12:37 +0200)]
util: fix check for iscsi initiator copy

virStorageSourceInitiatorCopy propagates the return
value from VIR_STRDUP, which returns 1 on a successful
copy.

Only error out on < 0, not non-zero values.

Fixes: 9ea3fdc6e90a96e3d7d7aeb9867e8f0a3992b7c6
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoscripts: introduce a macro file for coccinelle
Ján Tomko [Sat, 19 Oct 2019 00:22:34 +0000 (02:22 +0200)]
scripts: introduce a macro file for coccinelle

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: fix CPU model error probing capabilities for ppc
Daniel P. Berrangé [Fri, 18 Oct 2019 18:20:43 +0000 (19:20 +0100)]
qemu: fix CPU model error probing capabilities for ppc

The CPU driver only supports CPU models for PPC64 architecture, not
plain PPC.

  Failed to probe capabilities for /usr/bin/qemu-system-ppc:
  this function is not supported by the connection driver:
  'ppc' architecture is not supported by CPU driver

This fixes a bug in

  commit db873ab3bc5f6fbd7d227727a62ccfee3d1c3e9d
  Author: Jiri Denemark <jdenemar@redhat.com>
  Date:   Thu May 17 17:08:42 2018 +0200

    qemu: Adapt to changed ppc64 CPU model names

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agogitdm: Add other emails into IBM company
Julio Faracco [Sun, 20 Oct 2019 03:49:08 +0000 (00:49 -0300)]
gitdm: Add other emails into IBM company

Some people from IBM does not use 'ibm.com' domain emails.
They use personal or other domains.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agovsh: mark ctl as unused in vshReadline
Ján Tomko [Mon, 21 Oct 2019 09:11:04 +0000 (11:11 +0200)]
vsh: mark ctl as unused in vshReadline

My commit removed the last use in the version for platforms
without readline.

Fixes: c937c1d23db00cf0f33091f9d30f7ac33d9d6aa4
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotools: delete vshStrdup
Ján Tomko [Fri, 18 Oct 2019 13:54:06 +0000 (15:54 +0200)]
tools: delete vshStrdup

Now that we use g_strdup everywhere, delete vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: prefer g_strdup to vshStrdup
Ján Tomko [Fri, 18 Oct 2019 15:24:02 +0000 (17:24 +0200)]
tools: prefer g_strdup to vshStrdup

Remove all the uses of vshStrdup in favor of GLib's g_strdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: vshCommandArgvGetArg: prefer g_strdup
Ján Tomko [Fri, 18 Oct 2019 22:12:53 +0000 (00:12 +0200)]
tools: vshCommandArgvGetArg: prefer g_strdup

Remove the use of vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: vshCommandArgvGetArg: one parameter per line
Ján Tomko [Fri, 18 Oct 2019 22:12:53 +0000 (00:12 +0200)]
tools: vshCommandArgvGetArg: one parameter per line

Split the parameters to make changes more readable.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: getSignalNumber: use g_strdup
Ján Tomko [Fri, 18 Oct 2019 21:35:27 +0000 (23:35 +0200)]
virsh: getSignalNumber: use g_strdup

Eliminate the use of vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: getSignalNumber: use g_autofree
Ján Tomko [Fri, 18 Oct 2019 21:32:12 +0000 (23:32 +0200)]
virsh: getSignalNumber: use g_autofree

Mark the 'str' variable as g_autofree and avoid the need for
a separate cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: getSignalNumber: rename variables
Ján Tomko [Fri, 18 Oct 2019 21:30:27 +0000 (23:30 +0200)]
virsh: getSignalNumber: rename variables

Use 'str' for the allocated copy of the string and 'p'
for the pointer into that string.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: use g_strdup in virshDomainGetEditMetadata
Ján Tomko [Fri, 18 Oct 2019 15:24:29 +0000 (17:24 +0200)]
virsh: use g_strdup in virshDomainGetEditMetadata

Prefer GLib's g_strdup to vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agovirsh: use g_strdup in cmdDomblkinfoGet
Ján Tomko [Fri, 18 Oct 2019 15:24:29 +0000 (17:24 +0200)]
virsh: use g_strdup in cmdDomblkinfoGet

Prefer GLib's g_strdup to vshStrdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotools: cmdDomblkinfoGet: reindent parameters
Ján Tomko [Fri, 18 Oct 2019 22:15:34 +0000 (00:15 +0200)]
tools: cmdDomblkinfoGet: reindent parameters

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agonetwork: allow DHCP/DNS/TFTP explicitly in OUTPUT rules
Malina Salina [Fri, 27 Sep 2019 16:10:34 +0000 (17:10 +0100)]
network: allow DHCP/DNS/TFTP explicitly in OUTPUT rules

While the default iptables setup used by Fedora/RHEL distros
only restricts traffic on the INPUT and/or FORWARD rules,
some users might have custom firewalls that restrict the
OUTPUT rules too.

These can prevent DHCP/DNS/TFTP responses from dnsmasq
from reaching the guest VMs. We should thus whitelist
these protocols in the OUTPUT chain, as well as the
INPUT chain.

Signed-off-by: Malina Salina <malina.salina@protonmail.com>
Initial patch then modified to add unit tests and IPv6
support

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agogitdm: add 'ibm' file
Daniel Henrique Barboza [Fri, 18 Oct 2019 14:40:37 +0000 (11:40 -0300)]
gitdm: add 'ibm' file

Some people from IBM does not use 'ibm.com' domain emails.

Suggested-by: Leonardo Augusto Guimarães Garcia <lagarcia@br.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoutil: drop logging filter/output flags
Daniel P. Berrangé [Wed, 2 Oct 2019 10:51:51 +0000 (11:51 +0100)]
util: drop logging filter/output flags

With the removal of support for log message stack traces, there is
nothing using the logging filter/output flags and they can be removed.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: drop support for stack traces with logging
Daniel P. Berrangé [Wed, 2 Oct 2019 10:51:51 +0000 (11:51 +0100)]
util: drop support for stack traces with logging

The log filters have supported the use of a "+" before the source match
string to request that a stack trace be emitted for every log message:

  commit 548563956e484e0e43e9a66a89bdda0f95930108
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed May 9 15:18:56 2012 +0100

    Allow stack traces to be included with log messages

    Sometimes it is useful to see the callpath for log messages.
    This change enhances the log filter syntax so that stack traces
    can be show by setting '1:+NAME' instead of '1:NAME'.

With the huge & ever increasing number of logging statements per file,
this will be incredibly verbose and have a major performance penalty.
This makes the feature impractical to use widely and as such it is not
worth the code maint cost.

Removing this seldom used feature allows us to drop the 'execinfo'
module in gnulib which provides the backtrace() function which doesn't
exist on non-Linux.

Users who want to get stack traces of parts of libvirt can use GDB,
or systemtap for live tracing with minimal perf impact.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoutil: add stdlib.h include for abort() prototype
Daniel P. Berrangé [Fri, 18 Oct 2019 14:43:39 +0000 (15:43 +0100)]
util: add stdlib.h include for abort() prototype

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoglibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()
Michal Privoznik [Thu, 17 Oct 2019 15:17:01 +0000 (17:17 +0200)]
glibcompat: Reimplement g_strdup_printf() and g_strdup_vprintf()

These functions don't really abort() on OOM. The fix was merged
upstream, but not in the minimal version we require. Provide our
own implementation which can be removed once we bump the minimal
version.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild-aux: rewrite po file minimizer in Python
Daniel P. Berrangé [Fri, 30 Aug 2019 12:22:54 +0000 (13:22 +0100)]
build-aux: rewrite po file minimizer in Python

As part of an goal to eliminate Perl from libvirt build tools,
rewrite the minimize-po.pl tool in Python.

This was a straight conversion, manually going line-by-line to
change the syntax from Perl to Python. Thus the overall structure
of the file and approach is the same.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild-aux: rewrite augeas test generator in Python
Daniel P. Berrangé [Fri, 30 Aug 2019 12:22:54 +0000 (13:22 +0100)]
build-aux: rewrite augeas test generator in Python

As part of an goal to eliminate Perl from libvirt build tools,
rewrite the augeas-gentest.pl tool in Python.

This was a straight conversion, manually going line-by-line to
change the syntax from Perl to Python. Thus the overall structure
of the file and approach is the same.

The use of $(AUG_GENTEST) as a dependancy in the makefiles needed
to be fixed, because this was assumed to be the filename of the
script, but is in fact a full shell command line.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobuild: fix use of $(AUG_GENTEST) as a dependency
Daniel P. Berrangé [Fri, 27 Sep 2019 13:17:54 +0000 (14:17 +0100)]
build: fix use of $(AUG_GENTEST) as a dependency

The use of $(AUG_GENTEST) as a dependency in the makefiles is
a problem because this was assumed to be the filename of the
script, but is in fact a full shell command line.

Split it into two variables, so it can be correctly used for
dependencies.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agopo: refresh translations from zanata
Daniel P. Berrangé [Fri, 18 Oct 2019 12:48:07 +0000 (13:48 +0100)]
po: refresh translations from zanata

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agom4: Don't suggest attribute malloc
Michal Privoznik [Fri, 18 Oct 2019 08:07:50 +0000 (10:07 +0200)]
m4: Don't suggest attribute malloc

With glib inclusion, some of its functions have
__attribute__((__malloc__)) which make compiler realize we want
to use the same attribute for some trivial functions of ours. For
instance qemuDomainManagedSavePath(). I don't see any real
benefit into using the attribute, so disable that suggestion.

In fact, wrong use of the attribute may lead to mysterious bugs:

  https://gitlab.gnome.org/GNOME/glib/issues/1465

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: Generate 'xres' and 'yres' for QEMU video devices
Julio Faracco [Thu, 17 Oct 2019 04:30:32 +0000 (01:30 -0300)]
qemu: Generate 'xres' and 'yres' for QEMU video devices

This commit let QEMU command line define 'xres' and 'yres' properties
if XML contains both properties from video model: based on resolution
fields 'x' and 'y'. There is a conditional structure inside
qemuDomainDeviceDefValidateVideo() that validates if video model
supports this feature. This commit includes the necessary changes to
cover resolution for 'video-qxl-resolution' test cases too.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
5 years agoconf: Add 'x' and 'y' resolution into video XML definition
Julio Faracco [Thu, 17 Oct 2019 04:30:31 +0000 (01:30 -0300)]
conf: Add 'x' and 'y' resolution into video XML definition

This commit adds resolution element with parameters 'x' and 'y' into video
XML domain group definition. Both, properties were added into an element
called 'resolution' and it was added inside 'model' element. They are set
as optional. This element does not follow QEMU properties 'xres' and
'yres' format. Both HTML documentation and schema were changed too. This
commit includes a simple test case to cover resolution for QEMU video
models. The new XML format for resolution looks like:

    <model ...>
      <resolution x='800' y='600'/>
    </model>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
5 years agoqemu: caps: Use unique key for domCaps caching
Cole Robinson [Tue, 15 Oct 2019 15:47:10 +0000 (11:47 -0400)]
qemu: caps: Use unique key for domCaps caching

When searching qemuCaps->domCapsCache for existing domCaps data,
we check for a matching pair of arch+virttype+machine+emulator. However
for the hash table key we only use the machine string. So if the
cache already contains:

  x86_64 + kvm + pc + /usr/bin/qemu-kvm

But a new VM is defined with

  x86_64 + qemu + pc + /usr/bin/qemu-kvm

We correctly fail to find matching cached domCaps, but then attempt
to use a colliding key with virHashAddEntry

Fix this by building a hash key from the 4 values, not just machine

Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
5 years agoqemu_driver.c: use g_strdup_printf
Daniel Henrique Barboza [Wed, 16 Oct 2019 20:54:33 +0000 (17:54 -0300)]
qemu_driver.c: use g_strdup_printf

This patch changes all virAsprintf calls to use the GLib API
g_strdup_printf in qemu_driver.c

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_driver.c: remove unused 'cleanup' labels after g_auto*() changes
Daniel Henrique Barboza [Wed, 16 Oct 2019 20:54:32 +0000 (17:54 -0300)]
qemu_driver.c: remove unused 'cleanup' labels after g_auto*() changes

The g_auto*() changes made by the previous patches made a lot
of 'cleanup' labels obsolete. Let's remove them.

Suggested-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_driver.c: use g_autofree when possible
Daniel Henrique Barboza [Wed, 16 Oct 2019 20:54:31 +0000 (17:54 -0300)]
qemu_driver.c: use g_autofree when possible

String and other scalar pointers an be auto-unref, sparing us
a VIR_FREE() call.

This patch uses g_autofree whenever possible with strings and
other scalar pointer types.

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_driver.c: use g_autoptr() when possible
Daniel Henrique Barboza [Wed, 16 Oct 2019 20:54:30 +0000 (17:54 -0300)]
qemu_driver.c: use g_autoptr() when possible

Several pointer types can be auto-unref for the great majority
of the uses made in qemu_driver, sparing us a virObjectUnref()
call.

This patch uses g_autoptr() in the following pointer types inside
qemu_driver.c, whenever possible:

- qemuBlockJobDataPtr
- virCapsPtr
- virConnect
- virDomainCapsPtr
- virNetworkPtr
- virQEMUDriverConfigPtr

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_driver.c: use g_auto* in some functions
Daniel Henrique Barboza [Wed, 16 Oct 2019 20:54:29 +0000 (17:54 -0300)]
qemu_driver.c: use g_auto* in some functions

This patch changes qemuDomainSnapshotLoad, qemuDomainCheckpointLoad and
qemuStateInitialize to use g_autoptr() and g_autofree, cleaning up
some virObjectUnref() and VIR_FREE() calls on each.

The reason this is being sent separately is because these are not
trivial search/replace cases. In all these functions some strings
declarations are moved inside local loops, where they are in fact
used, allowing us to erase VIR_FREE() calls that were made inside
the loop and in 'cleanup' labels.

Following patches with tackle more trivial cases of g_auto* usage
in all qemu_driver.c file.

Suggested-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: hacking: add a conversion table for removed libvirt macros
Ján Tomko [Wed, 16 Oct 2019 14:11:30 +0000 (16:11 +0200)]
docs: hacking: add a conversion table for removed libvirt macros

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: hacking: use <code> for functions/names
Ján Tomko [Wed, 16 Oct 2019 12:43:49 +0000 (14:43 +0200)]
docs: hacking: use <code> for functions/names

Use the <code> element more in the GLib section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: hacking: separate section about already deleted macros
Ján Tomko [Wed, 16 Oct 2019 13:58:28 +0000 (15:58 +0200)]
docs: hacking: separate section about already deleted macros

Move the recently deleted libvirt macros into a separate section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agostorage: fix build with musl libc
Carlos Santos [Wed, 16 Oct 2019 11:22:14 +0000 (08:22 -0300)]
storage: fix build with musl libc

On musl _PATH_MOUNTED is defined in paths.h, not in mntent.h, which
causes compilation errors:

storage/storage_backend_fs.c: In function 'virStorageBackendFileSystemIsMounted':
storage/storage_backend_fs.c:255:23: error: '_PATH_MOUNTED' undeclared (first use in this function); did you mean 'XPATH_POINT'?
     if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
                       ^~~~~~~~~~~~~
                       XPATH_POINT

Fix this including paths.h if _PATH_MOUNTED is still not defined after
including mntent.h. This also works with glibc and uClibc-ng.

Signed-off-by: Carlos Santos <casantos@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: fix build with musl libc
Carlos Santos [Wed, 16 Oct 2019 11:22:13 +0000 (08:22 -0300)]
qemu: fix build with musl libc

On musl libc "stderr" is a preprocessor macro whose expansion leads to
compilation errors:

In file included from qemu/qemu_process.c:66:
qemu/qemu_process.c: In function 'qemuProcessQMPFree':
qemu/qemu_process.c:8418:21: error: expected identifier before '(' token
     VIR_FREE((proc->stderr));
                     ^~~~~~

Prevent this by renaming the homonymous field in the _qemuProcessQMP
struct to "stdErr".

Signed-off-by: Carlos Santos <casantos@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: remove unused cfg variables
Ján Tomko [Thu, 17 Oct 2019 07:57:03 +0000 (09:57 +0200)]
qemu: remove unused cfg variables

These functions got a reference to the driver config
without actually using it:
  processNicRxFilterChangedEvent
  qemuConnectDomainXMLToNative

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotools: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:57 +0000 (12:33 -0500)]
tools: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovz: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:49 +0000 (12:33 -0500)]
vz: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:39 +0000 (12:33 -0500)]
util: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agostorage: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:30 +0000 (12:33 -0500)]
storage: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoremote: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:20 +0000 (12:33 -0500)]
remote: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:33:04 +0000 (12:33 -0500)]
qemu: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolxc: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:32:37 +0000 (12:32 -0500)]
lxc: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolibxl: Use consistent error preservation and restoration calls
John Ferlan [Thu, 6 Dec 2018 17:32:28 +0000 (12:32 -0500)]
libxl: Use consistent error preservation and restoration calls

Provide some consistency over error message variable name and usage
when saving error messages across possible other errors or possibility
of resetting of the last error.

Instead of virSaveLastError paired up with virSetError and virFreeError,
we should use the newer virErrorPreserveLast and virRestoreError.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>