]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
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>