]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agoconf/network_conf: use virStringParseYesNo helper
Mao Zhongyi [Thu, 17 Oct 2019 03:19:32 +0000 (11:19 +0800)]
conf/network_conf: use virStringParseYesNo helper

A function virStringParseYesNo was added to convert
string 'yes' to true and 'no' to false, so use this
helper to replace 'STREQ(.*, \"yes\")' and
'STREQ(.*, \"no\")' as it allows us to drop several
repetitive if-then-else string->bool conversion blocks.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf/domain_conf: use virStringParseYesNo helper
Mao Zhongyi [Thu, 17 Oct 2019 03:19:31 +0000 (11:19 +0800)]
conf/domain_conf: use virStringParseYesNo helper

This helper performs a conversion from a "yes|no" string
to a corresponding boolean, and several conversions were
already done, but there are still some omissions.

For most of the remaining usages in domain_conf.c only
"yes" is explicitly checked for. This means all other
values are implicitly handled as 'false'. In this case,
use virStringParseYesNo to handle the conversion and
reserve the original logic of not raise an error, so
ignore the return value of helper.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
5 years agoqemu: use GUINT32_SWAP_LE_BE
Ján Tomko [Wed, 13 Nov 2019 09:26:37 +0000 (10:26 +0100)]
qemu: use GUINT32_SWAP_LE_BE

Use this GLib macro instead of bswap_32 from gnulib.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoutil: use g_vsnprintf
Ján Tomko [Wed, 13 Nov 2019 09:21:29 +0000 (10:21 +0100)]
util: use g_vsnprintf

Instead of vsnprintf from gnulib, use g_vsnprintf from GLib.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoutil: pidfile: Replace 'areadlink' by 'g_file_read_link'
Peter Krempa [Wed, 13 Nov 2019 12:24:47 +0000 (13:24 +0100)]
util: pidfile: Replace 'areadlink' by 'g_file_read_link'

Use the glib function rather than gnulib.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: pidfile: Sanitize return values of virPidFileReadPathIfAlive
Peter Krempa [Wed, 13 Nov 2019 12:08:58 +0000 (13:08 +0100)]
util: pidfile: Sanitize return values of virPidFileReadPathIfAlive

The callers don't actually use the returned errno for reporting errors.

Additionally virFileResolveAllLinks returns -1 rather than -errno on
error thus you'd get a spurious EPERM even on other errors.

Don't try to return errno in this case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: pidfile: Sanitize return values of virPidFileReadIfAlive
Peter Krempa [Wed, 13 Nov 2019 11:57:01 +0000 (12:57 +0100)]
util: pidfile: Sanitize return values of virPidFileReadIfAlive

Return -1 on failure rather than -errno since none of the callers
actually cares about the return value. This specifically fixes returns
of -ENOMEM in cases of bad usage, which would report wrong error
anyways.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: gpu: Sanitize error values in qemuVhostUserGPUGetPid
Peter Krempa [Wed, 13 Nov 2019 12:17:11 +0000 (13:17 +0100)]
qemu: gpu: Sanitize error values in qemuVhostUserGPUGetPid

The caller doesn't care about the actual return value, so return -1
rather than errno.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: tpm: Sanitize error values in qemuTPMEmulatorGetPid
Peter Krempa [Wed, 13 Nov 2019 12:17:11 +0000 (13:17 +0100)]
qemu: tpm: Sanitize error values in qemuTPMEmulatorGetPid

The callers don't care about the actual return value, so return -1
rather than errno.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: tpm: Use g_autofree in qemuTPMEmulatorGetPid
Peter Krempa [Wed, 13 Nov 2019 12:15:50 +0000 (13:15 +0100)]
qemu: tpm: Use g_autofree in qemuTPMEmulatorGetPid

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: file: Remove virFileReadLink
Peter Krempa [Wed, 13 Nov 2019 11:49:24 +0000 (12:49 +0100)]
util: file: Remove virFileReadLink

The function is unused so we can remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Use g_file_read_link instead of virFileReadLink
Peter Krempa [Wed, 13 Nov 2019 11:45:54 +0000 (12:45 +0100)]
qemu: domain: Use g_file_read_link instead of virFileReadLink

In an effort to remove as much gnulib usage as possible let's
reimplement virFileReadLink. Since it's used in two places only I opted
to open-code it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: snapshot: Fix inactive external snapshots when backing chain is present
Peter Krempa [Tue, 12 Nov 2019 16:37:36 +0000 (17:37 +0100)]
qemu: snapshot: Fix inactive external snapshots when backing chain is present

The inactive external snapshot code replaced the file name in the
virStorageSource but did not touch the backing files. This meant that
after an inactive snapshot the backing chain recorded in the inactive
XML (which is used with -blockdev) would be incorrect.

Fix it by adding a new layer if there is an existing chain and replacing
the virStorageSource struct fully when there is no chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: blockjob: Transfer 'readonly' state of images after active layer block commit
Peter Krempa [Fri, 8 Nov 2019 15:38:08 +0000 (16:38 +0100)]
qemu: blockjob: Transfer 'readonly' state of images after active layer block commit

When commiting a different image becomes the disk source. Since we store
the readonly flag per-image we must update it to the same state the
original image had.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_hotplug.c: user-friendlier setvcpus timeout error message
Daniel Henrique Barboza [Fri, 18 Oct 2019 18:36:34 +0000 (15:36 -0300)]
qemu_hotplug.c: user-friendlier setvcpus timeout error message

The current 'setvcpus' timeout message requires a deeper
understanding of QEMU/Libvirt internals to proper react to it.
One who knows how setvcpus unplug work (it is an asynchronous
operation between QEMU and guest that Libvirt can't know for
sure if it failed, unless an explicit error happened during the
timeout period) will read the message and not assume a failed
operation. But the regular user, most often than not, will read
it and believe that the unplug operation failed.

This leads to situations where the user isn't exactly relieved
when accessing the guest and seeing that the unplug operation
worked. Instead, the user feel mislead by the timeout message
setvcpus threw.

Changing the timeout message to let the user know that the
unplug status is not known, and manual inspection in the guest
is required, is not a silver bullet. But it gives a more
realistic expectation of what happened, as best as we can tell
from Libvirt side anyways.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: Remove qemu_hotplugpriv.h and qemuDomainRemoveDeviceWaitTime
Daniel Henrique Barboza [Fri, 18 Oct 2019 18:36:33 +0000 (15:36 -0300)]
qemu: Remove qemu_hotplugpriv.h and qemuDomainRemoveDeviceWaitTime

qemu_hotplugpriv.h is a header file created to share a global variable
called 'qemuDomainRemoveDeviceWaitTime', declared in qemu_hotplug.c,
to other files that would want to change the timeout value
(currently, only tests/qemuhotplugtest.c).

Previous patch deprecated the variable, using qemu_driver->unplugTimeout
to set the timeout instead. This means that the header file is now
unused, and can be safely discarded.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu_hotplug.c: adding qemuDomainGetUnplugTimeout
Daniel Henrique Barboza [Fri, 18 Oct 2019 18:36:32 +0000 (15:36 -0300)]
qemu_hotplug.c: adding qemuDomainGetUnplugTimeout

For some architectures and setups, device removal can take
longer than the default 5 seconds. This results in commands
such as 'virsh setvcpus' to fire timeout messages even if
the operation were successful in the guest, confusing the
user.

This patch sets a new 10 seconds unplug timeout for PPC64
guests. All other archs will keep the default 5 seconds
timeout.

Instead of putting 'if PPC64' conditionals inside qemu_hotplug.c
to set the new timeout value, a new function called
qemuDomainGetUnplugTimeout was added. The timeout value is then
retrieved when needed, by passing the correspondent DomainDef
object. This approach allows for different guest architectures
to have distint unplug timeout intervals, regardless of the
host architecture. This design also makes it easier to
modify/enhance the unplug timeout logic in the future
(allow for special timeouts for TCG domains, for example).

A new mock file was created to work with qemuhotplugtest.c,
given that the test timeout is significantly shorter than
the actual timeout value in qemu_hotplug.c.

The now unused 'qemuDomainRemoveDeviceWaitTime' global can't
be simply erased from qemu_hotplug.c though. Next patch will
remove it properly.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Suggested-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoconf: use glib allocation when parsing video props
Jonathon Jongsma [Wed, 23 Oct 2019 17:46:47 +0000 (12:46 -0500)]
conf: use glib allocation when parsing video props

In preparation for some other improvements, switch to using glib
allocation and g_autofree when parsing the 'acceleration' and
'resolution' properties of the video device.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agoconf: remove unnecessary NULL checks
Jonathon Jongsma [Wed, 23 Oct 2019 17:46:46 +0000 (12:46 -0500)]
conf: remove unnecessary NULL checks

Just above in the function, we return from the function if either x or y
are NULL, so there's no need to re-check whether x or y are NULL.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agoqemu: fix documentation for video resolution
Jonathon Jongsma [Wed, 23 Oct 2019 17:46:45 +0000 (12:46 -0500)]
qemu: fix documentation for video resolution

The video resolution support that was introduced in
7286279797a34b3083d85bc4556432b5e7ad9fff is specified as a <resolution>
sub-element of <model>, not optional attributes of model.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
5 years agoconf: Fix memory leak caused by missing VIR_FREE for video resolution.
Julio Faracco [Fri, 18 Oct 2019 03:15:45 +0000 (00:15 -0300)]
conf: Fix memory leak caused by missing VIR_FREE for video resolution.

Commit 72862797 introduced resolution settings for QEMU video drivers.
It includes a new structure inside video definition. So, the code needs
to clear pointer allocation for that structure into clear function
virDomainVideoDefClear(). This commit adds this missing VIR_FREE().

Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
5 years agoRemove VIR_STRNDUP usage that subtracts from a non-NULL pointer
Ján Tomko [Thu, 24 Oct 2019 17:32:35 +0000 (19:32 +0200)]
Remove VIR_STRNDUP usage that subtracts from a non-NULL pointer

Use g_strndup in all the cases where we check upfront whether a pointer
is non-NULL and then use it to calculate the copied length.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoRemove VIR_STRNDUP usage that passes -1
Ján Tomko [Thu, 24 Oct 2019 22:05:28 +0000 (00:05 +0200)]
Remove VIR_STRNDUP usage that passes -1

Replace all the usage of
  VIR_STRNDUP(dest, b, p ? p - b : -1)
with separate calls to g_strndup/g_strdup.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoRemove VIR_STRDUP usage that snuck in
Ján Tomko [Thu, 24 Oct 2019 22:34:21 +0000 (00:34 +0200)]
Remove VIR_STRDUP usage that snuck in

Fixes: 224d269f19f0a6c496dd2218f934a54742d51708
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agolocking: fix build with older sanlock
Ján Tomko [Wed, 13 Nov 2019 08:51:45 +0000 (09:51 +0100)]
locking: fix build with older sanlock

../../src/locking/lock_driver_sanlock.c:106:17: error: incompatible pointer types
assigning to 'char **' from 'char *' [-Werror,-Wincompatible-pointer-types]
        message = g_strdup_printf(_("sanlock error %d"), err);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: b1d58418aa5051c7aafa4519b332007e7c73c261
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: buffer: remove virBufferSetChildIndent
Peter Krempa [Fri, 25 Oct 2019 15:33:21 +0000 (17:33 +0200)]
util: buffer: remove virBufferSetChildIndent

Promote usage of separate buffers for separate formatting passes by
removing the now unused virBufferSetChildIndent.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: domain: Convert child buffers to use VIR_BUFFER_INIT_CHILD
Peter Krempa [Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)]
conf: domain: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: cpu: Convert child buffers to use VIR_BUFFER_INIT_CHILD
Peter Krempa [Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)]
conf: cpu: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: caps: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD
Peter Krempa [Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)]
conf: caps: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD
Peter Krempa [Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)]
util: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Convert child buffers to use VIR_BUFFER_INIT_CHILD
Peter Krempa [Wed, 30 Oct 2019 11:40:06 +0000 (12:40 +0100)]
qemu: domain: Convert child buffers to use VIR_BUFFER_INIT_CHILD

Use the new helper to initialize child XML element buffers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: buffer: Add init macro for automatically setting child XML indent
Peter Krempa [Fri, 25 Oct 2019 13:22:12 +0000 (15:22 +0200)]
util: buffer: Add init macro for automatically setting child XML indent

Add a new macro which initializes a virBuffer on the stack and also sets
the indent level to be used for child XML element formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: capabilities: Refactor API for setting guest capability features
Peter Krempa [Tue, 12 Nov 2019 12:57:23 +0000 (13:57 +0100)]
conf: capabilities: Refactor API for setting guest capability features

Remove the need to pass around strings and switch to the enum values
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Refactor storage of guest capabilities
Peter Krempa [Wed, 23 Oct 2019 15:04:20 +0000 (17:04 +0200)]
conf: Refactor storage of guest capabilities

The capabilities are declared in the XML schema so passing feature names
as strings from hypervisor drivers makes no sense.

Additionally some of the features expose so called 'toggles' while
others not. This knowledge was encoded by a bunch of 'STREQ's in the
formatter.

Change all of this by declaring the features as an enum and use it
instead of a dynamically allocated array.

Presence of 'toggles' is encoded together with the conversion strings
rather than in the formatter directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoschema: capabilities: Add 'hap' feature flag
Peter Krempa [Tue, 12 Nov 2019 13:00:53 +0000 (14:00 +0100)]
schema: capabilities: Add 'hap' feature flag

The libxl driver exposes a 'hap' feature in the capability XML but our
schema didn't cover it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: driver: Remove unused 'driver' from qemuDomainSnapshotFSFreeze/Thaw
Peter Krempa [Mon, 23 Sep 2019 13:34:50 +0000 (15:34 +0200)]
qemu: driver: Remove unused 'driver' from qemuDomainSnapshotFSFreeze/Thaw

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agocpu_map: Drop pconfig from Icelake-Server CPU model
Jiri Denemark [Fri, 18 Oct 2019 12:33:00 +0000 (14:33 +0200)]
cpu_map: Drop pconfig from Icelake-Server CPU model

The pconfig feature was enabled in QEMU by accident in 3.1.0. All other
newer versions do not support it and it was removed from the
Icelake-Server CPU model in QEMU.

We don't normally change our CPU models even when QEMU does so to avoid
breaking migrations between different versions of libvirt. But we can
safely do so in this specific case. QEMU never supported enabling
pconfig so any domain which was able to start has pconfig disabled.

With a small compatibility hack which explicitly disables pconfig when
CPU model equals Icelake-Server in migratable domain definition, only
one migration scenario stays broken (and there's nothing we can do about
it): from any host to a host with libvirt < 5.10.0 and QEMU > 3.1.0.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocputest: Add data for Ice Lake Server CPU
Jiri Denemark [Fri, 18 Oct 2019 11:50:19 +0000 (13:50 +0200)]
cputest: Add data for Ice Lake Server CPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocpu_map: Drop comments about ospke
Jiri Denemark [Wed, 16 Oct 2019 11:11:01 +0000 (13:11 +0200)]
cpu_map: Drop comments about ospke

QEMU does not support setting this feature on the command line anymore.
We don't need to explain why it is not included in CPU models then.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Drop disabled CPU features unknown to QEMU
Jiri Denemark [Fri, 18 Oct 2019 12:33:19 +0000 (14:33 +0200)]
qemu: Drop disabled CPU features unknown to QEMU

When a CPU definition wants to explicitly disable some features that are
unknown to QEMU, we can safely drop them from the definition before
starting QEMU. Naturally QEMU won't enable such features implicitly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemuxml2*test: Add tests for Icelake-Server,-pconfig
Jiri Denemark [Fri, 18 Oct 2019 14:14:23 +0000 (16:14 +0200)]
qemuxml2*test: Add tests for Icelake-Server,-pconfig

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocpu_conf: Pass policy to CPU feature filtering callbacks
Jiri Denemark [Thu, 7 Nov 2019 15:25:47 +0000 (16:25 +0100)]
cpu_conf: Pass policy to CPU feature filtering callbacks

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agobhyve_device.c: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:11 +0000 (15:19 -0300)]
bhyve_device.c: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotools: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:09 +0000 (15:19 -0300)]
tools: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agosuspend.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:08 +0000 (15:19 -0300)]
suspend.c: remove unneeded cleanup label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agobridge_driver.c: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:07 +0000 (15:19 -0300)]
bridge_driver.c: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agolibxl_driver.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:06 +0000 (15:19 -0300)]
libxl_driver.c: remove unneeded cleanup label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agolibvirt.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:05 +0000 (15:19 -0300)]
libvirt.c: remove unneeded cleanup label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:04 +0000 (15:19 -0300)]
util: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovz_sdk.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:02 +0000 (15:19 -0300)]
vz_sdk.c: remove unneeded cleanup label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agorpc: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:19:01 +0000 (15:19 -0300)]
rpc: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu_monitor_json.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:59 +0000 (15:18 -0300)]
qemu_monitor_json.c: remove unneeded cleanup label

qemuMonitorJSONBlockIoThrottleInfo uses a macro called
GET_THROTTLE_STATS that's defined outside of the function,
which references a 'cleanup' label. GET_THROTTLE_STATS is
only used inside qemuMonitorJSONBlockIoThrottleInfo (in fact,
the macro is undef right after it) thus it is safe to erase
the 'cleanup' reference inside the macro, then proceed
with the usual cleanup label removal inside
qemuMonitorJSONBlockIoThrottleInfo.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agosecret_driver.c: remove unneeded cleanup label
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:57 +0000 (15:18 -0300)]
secret_driver.c: remove unneeded cleanup label

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonode_device: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:56 +0000 (15:18 -0300)]
node_device: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agolxc: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:55 +0000 (15:18 -0300)]
lxc: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoremote: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:54 +0000 (15:18 -0300)]
remote: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:53 +0000 (15:18 -0300)]
nwfilter: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agostorage: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:52 +0000 (15:18 -0300)]
storage: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: remove unneeded cleanup labels
Daniel Henrique Barboza [Mon, 21 Oct 2019 18:18:51 +0000 (15:18 -0300)]
conf: remove unneeded cleanup labels

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: hacking: add missing code element
Ján Tomko [Mon, 11 Nov 2019 12:00:42 +0000 (13:00 +0100)]
docs: hacking: add missing code element

Wrap the 'g_renew()' call for VIR_SHRINK_N in <code>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
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>