]>
git.ipfire.org Git - thirdparty/libvirt.git/log
Ján Tomko [Mon, 5 Oct 2020 17:09:27 +0000 (19:09 +0200)]
util: conf: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:09:12 +0000 (19:09 +0200)]
util: firewall: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:09:00 +0000 (19:09 +0200)]
util: systemd: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:08:12 +0000 (19:08 +0200)]
util: netdev: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:07:47 +0000 (19:07 +0200)]
util: command: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:07:18 +0000 (19:07 +0200)]
util: sysinfo: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:06:59 +0000 (19:06 +0200)]
util: storagefile: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 17:06:36 +0000 (19:06 +0200)]
util: resctrl: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 17:16:19 +0000 (19:16 +0200)]
util: split out VIR_ALLOC calls
To make the following commits simpler.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 07:47:04 +0000 (09:47 +0200)]
util: resctrl fix spacing in comment
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Matt Coleman [Mon, 5 Oct 2020 19:14:36 +0000 (15:14 -0400)]
mailmap: consolidate my email addresses
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 16:47:18 +0000 (18:47 +0200)]
virsh: network-port: remove pointless comment
We do not have a legacy API for listing network ports
so there's nothing to fall back on.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 16:43:25 +0000 (18:43 +0200)]
virsh: delete vsh[CM]alloc
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 16:50:09 +0000 (18:50 +0200)]
virsh: use g_new0 instead of vsh[CM]alloc
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 16:48:21 +0000 (18:48 +0200)]
virsh: do not add bools into size calculations
Switch the allocation in virshSnapshotListCollect and
its cargo-culted Checkpoint counterpart to two separate
g_new0 calls and move the boolean expression to
the if condition that chooses between them.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Neal Gompa [Mon, 5 Oct 2020 02:16:57 +0000 (22:16 -0400)]
rpm: Enable Xen support on AArch64
Starting with Linux 5.9, Xen Dom0 works on commonly available
AArch64 devices, such as the Raspberry Pi 4.
Reference: https://xenproject.org/2020/09/29/xen-on-raspberry-pi-4-adventures/
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 16:51:48 +0000 (12:51 -0400)]
tests: cover disk, interface <backenddomain>
There is present no XML test coverage for this.
Add genericxml parse + formatting coverage.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Zhenyu Zheng [Thu, 24 Sep 2020 14:12:21 +0000 (22:12 +0800)]
cpu: Modify virCPUarmCompare to perform compare actions
Modify virCPUarmCompare in cpu_arm.c to perform compare action.
This patch only adds host to host CPU compare, the rest cases
remains the same. This is useful for source and destination host
compare during migrations to avoid migration between different
CPU models that have different CPU freatures.
Signed-off-by: Zhenyu Zheng <zheng.zhenyu@outlook.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Daniel P. Berrangé [Mon, 5 Oct 2020 12:53:33 +0000 (13:53 +0100)]
rpm: include aarch64 & riscv64 in systemtap 64-bit arch tapset rename
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:28:26 +0000 (12:28 +0200)]
qemu: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:27:57 +0000 (12:27 +0200)]
qemu: firmware: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:27:32 +0000 (12:27 +0200)]
qemu: command: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:27:13 +0000 (12:27 +0200)]
qemu: process: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:26:34 +0000 (12:26 +0200)]
qemu: monitor: json: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:26:20 +0000 (12:26 +0200)]
qemu: driver: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:26:10 +0000 (12:26 +0200)]
qemu: domain: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Mon, 5 Oct 2020 10:25:44 +0000 (12:25 +0200)]
qemu: capabilities: use g_new0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Sun, 4 Oct 2020 19:51:15 +0000 (21:51 +0200)]
qemu: separate out VIR_ALLOC calls
Move them to separate conditions to reduce churn
in following patches.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Pino Toscano [Mon, 5 Oct 2020 11:34:25 +0000 (13:34 +0200)]
esx: switch esxUtil_ResolveHostname to return a new string
Change the interface of esxUtil_ResolveHostname() to return a newly
allocated string with the result address, instead of forcing the callers
to provide a buffer and its size. This way we can simply (auto)free the
string, and make the function stacks smaller.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Pino Toscano [Mon, 5 Oct 2020 09:38:09 +0000 (11:38 +0200)]
esx: call freeaddrinfo earlier in esxUtil_ResolveHostname
Call freeaddrinfo() as soon as @result is not needed anymore, i.e. right
after getnameinfo(); this avoids calling freeaddrinfo() in two branches.
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 17:51:27 +0000 (13:51 -0400)]
qemu: Taint cpu host-passthrough only after migration
From a discussion last year[1], Dan recommended libvirt drop the tain
flag for cpu host-passthrough, unless the VM has been migrated.
This repurposes the existing host-cpu taint flag to do just that.
[1]: https://www.redhat.com/archives/virt-tools-list/2019-February/msg00041.html
https://bugzilla.redhat.com/show_bug.cgi?id=
1673098
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 16:34:21 +0000 (12:34 -0400)]
docs: formatdomain: add spicevmc <redirdev> example
spicevmc is the most common <redirdev> usage. This adds an XML example
for it.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 16:32:42 +0000 (12:32 -0400)]
docs: formatdomain: fix net downscript 'since'
It was added in 6.4.0, not 5.1.0
Fixes: 61ba6f09b181ec8c1591dc1df8c3cd8e093ca67b
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 16:29:17 +0000 (12:29 -0400)]
docs: formatdomain: fix incorrect 'Vsock' heading indent
Currently it is visually at the same indent as <seclabel>. This
fixes it to be grouped it with <devices>
Fixes: d4abb7b45d48aba77c2464dbea95f02a43a60834
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Cole Robinson [Sun, 4 Oct 2020 16:27:39 +0000 (12:27 -0400)]
docs: formatdomain: remove doubled filesystem <driver>
libvirt doesn't reject this but only one <driver> element takes
effect.
Drop the instance that is already referenced in the previous example
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:11:49 +0000 (10:11 +0200)]
qemu: migration_cookie: s/VIR_FREE/g_free/
Previous refactors allow us to plainly replace all VIR_FREE by g_free to
finish the modernization of the file.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:11:03 +0000 (10:11 +0200)]
qemuMigrationCookieXMLParse: Avoid VIR_FREE when parsing lockstate
Restructure the control-flow a bit using an temporary variable to avoid
the need to use VIR_FREE.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:09:25 +0000 (10:09 +0200)]
qemuMigrationCookieAddCaps: Use 'g_new0' instead of VIR_ALLOC
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 07:53:54 +0000 (09:53 +0200)]
qemuMigrationCookieCapsXMLParse: Refactor memory handling
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'cleanup' label.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 07:53:54 +0000 (09:53 +0200)]
qemuMigrationCookieNBDXMLParse: Refactor memory handling
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'error' and 'cleanup' labels.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 07:53:54 +0000 (09:53 +0200)]
qemuMigrationCookieNetworkXMLParse: Refactor memory handling
Use modern allocators, automatic memory feeing, and decrease the scope
of some variables to remove the 'error' label.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 07:50:37 +0000 (09:50 +0200)]
qemuMigrationCookieXMLFormat: Refactor memory handling
Use automatic memory freeing to get rid of the 'error' label. Since the
'tmp' variable was used only in one instance, rename it appropriately.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 09:45:55 +0000 (11:45 +0200)]
qemuMigrationCookieNetworkAlloc: Refactor memory handling
Use modern memory handling approach to simplify the code.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 09:45:55 +0000 (11:45 +0200)]
qemuMigrationCookieGraphicsSpiceAlloc: Refactor memory handling
Use modern memory handling approach to simplify the code.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 09:43:09 +0000 (11:43 +0200)]
qemu: migration_cookie: Register 'autoptr' functions for internal types
Register the the cleanup functions for 'qemuMigrationCookieGraphics',
'qemuMigrationCookieNetwork', 'qemuMigrationCookieNBD', and
'qemuMigrationCookieCaps'.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 09:09:14 +0000 (11:09 +0200)]
qemuDomainExtractTLSSubject: Refactor memory handling
Switch to automatic memory cleaning, use g_new0 for allocation and get
rid of the 'error' label.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:54:39 +0000 (15:54 +0200)]
qemuMigrationCookieXMLFormat: Extract formatting of NBD
Move the code into 'qemuMigrationCookieNBDXMLFormat' and use modern XML
formatting code patterns.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:30:20 +0000 (15:30 +0200)]
qemuMigrationCookieNetworkXMLFormat: Refactor XML formatting
Use 'virXMLFormatElement' both for formating the whole <network> element
but also for formatting the <interface> subelements. This alows to
remove the crazy logic which was determining which element was already
formatted.
Additional simplification is achieved by switching to skipping the loop
using 'continue' rather than putting everything in a giant block.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:24:19 +0000 (15:24 +0200)]
qemuMigrationCookieGraphicsXMLFormat: Use 'virXMLFormatElement'
Switch to the two buffer approach to simplify the logic for terminating
the element.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:06:11 +0000 (15:06 +0200)]
qemuMigrationCookieXMLParse: Remove 'error' label
Now it only returns -1 so we can do that directly.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:04:45 +0000 (15:04 +0200)]
qemuMigrationCookieXMLParse: Remove comment mentioning that error was already set
Most of our functions report errors so there's no need to mention it
here again.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:03:59 +0000 (15:03 +0200)]
qemuMigrationCookieXMLParse: Decrease scope of 'nodes' and use automatic freeing
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 13:00:43 +0000 (15:00 +0200)]
qemuMigrationCookieXMLParse: Check domain element count more defensively
Make sure that 'virXPathNodeSet' returns '1' as the only expected value
rather than relying on the fact that the previous check for the number
of elements ensures success of the subsequent call.
The error message no longer mentions the number of <domain> elements in
the cookie, but this is a very unlikely internal error anyways.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 12:58:26 +0000 (14:58 +0200)]
qemuMigrationCookieXMLParse: Switch to single-purpose temporary variables
Don't reuse 'tmp' over and over, but switch to single use automaticaly
freed variables instead.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Wed, 30 Sep 2020 12:31:47 +0000 (14:31 +0200)]
qemu: migration_cookie: Extract parsing/validation of mandatory features
Move the code into 'qemuMigrationCookieXMLParseMandatoryFeatures' to
simplify 'qemuMigrationCookieXMLParse'.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:39:23 +0000 (10:39 +0200)]
qemuDomainFilterHotplugVcpuEntities: Refactor memory freeing to remove 'cleanup' label
After recent refactors the function can be refactored to remove the
'cleanup' label by using autoptr for the 'map' variable.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:36:59 +0000 (10:36 +0200)]
virDomainResctrlNew: Refactor allocation to remove 'cleanup' label
If we use g_new0 there's no need for the 'cleanup' label as there's
nothing to fail after the allocation.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:28:51 +0000 (10:28 +0200)]
util: virbitmap: Remove virBitmapCopy
The function is now unused.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:26:34 +0000 (10:26 +0200)]
Use 'virBitmapNewCopy' instead of 'virBitmapCopy'
There are only 3 places using the function. Two can use virBitmapNewCopy
directly. In case of the qemu capabilities code we need to free the old
bitmap first.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:34:53 +0000 (10:34 +0200)]
Don't check return value of virBitmapNewCopy
The function will not fail any more.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Fri, 2 Oct 2020 08:22:18 +0000 (10:22 +0200)]
virBitmapNewCopy: Reimplement bitmap copying to prevent failure
virBitmapCopy has a failure condition, which is impossible to meet when
creating a new copy. Copy the contents directly to make it obvious that
virBitmapNewCopy can't fail.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 15:42:11 +0000 (17:42 +0200)]
virBitmapNew: Don't check return value
Remove return value check from all callers.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 15:02:16 +0000 (17:02 +0200)]
util: bitamp: Remove virBitmapNewEmpty
It can be replaced by virBitmapNew(0).
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:36:05 +0000 (16:36 +0200)]
virbitmaptest: Remove unnecessary error/cleanup labels
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:26:51 +0000 (16:26 +0200)]
virbitmaptest: Use g_auto(free) for cleanup
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 5 Oct 2020 10:10:42 +0000 (12:10 +0200)]
virbitmaptest: Refactor checks in 'test6'
The 'checkBitmap' helper uses 'virBitmapFormat' internally and also
reports better errors. Use it instead of the open-coded checks.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 5 Oct 2020 10:06:14 +0000 (12:06 +0200)]
virbitmaptest: Turn 'TEST_MAP' macro into a helper function
The function will also be reusable in other places of the code by making
the size check optional. For now only test12* is refactored since it
used TEST_MAP directly.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 5 Oct 2020 09:28:14 +0000 (11:28 +0200)]
virbitmaptest: Use separate output strings in 'test5'
The test validates two outputs. Don't reuse 'str' for both.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 5 Oct 2020 09:17:38 +0000 (11:17 +0200)]
virbitmaptest: Split up test4
'test4' was testing three distinct operations on separate instances of a
bitmap. Split it up into 'test4a', 'test4b' and 'test4c' so that the
'bitmap' variable is not reused.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Mon, 5 Oct 2020 09:17:38 +0000 (11:17 +0200)]
virbitmaptest: Split up test12
'test12' was testing two distinct operations on two instances of a
bitmap. Split it up into 'test12a' and 'test12b' so that the 'bitmap'
variable is not reused.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Daniel P. Berrangé [Mon, 5 Oct 2020 12:17:02 +0000 (13:17 +0100)]
rpm: drop ia64, sparc64 and alpha architectures
None of these arches are relevant to current Fedora or RHEL distros.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Ján Tomko [Wed, 30 Sep 2020 13:07:09 +0000 (15:07 +0200)]
vbox: use g_new0 instead of VIR_ALLOC
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 18:02:48 +0000 (20:02 +0200)]
vbox: refactor vboxNetworkGetXMLDesc a bit
Error out on allocation failure to reduce the nesting.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Sun, 4 Oct 2020 21:18:06 +0000 (23:18 +0200)]
vbox: invert condition in vboxSnapshotGetReadOnlyDisks
Error out on (impossible) failed allocation, to reduce
indentation.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 17:55:02 +0000 (19:55 +0200)]
vbox: vboxDumpAudio: invert conditions
Elimination of the positive conditions reduces
the indentation by two levels.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Daniel P. Berrangé [Mon, 5 Oct 2020 10:27:44 +0000 (11:27 +0100)]
docs: use "::" instead of ".. code-block::"
The former is a short hand for the latter and is already widely used in
the docs. Using the short hand avoids incompatibility with the alternate
impl of rst2html5.
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Ján Tomko [Wed, 30 Sep 2020 13:07:29 +0000 (15:07 +0200)]
vz: use g_new0 instead of VIR_ALLOC
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 18:11:56 +0000 (20:11 +0200)]
vz: vzEatCookie: separate allocation
Use g_new0 outside of the error condition.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 18:09:00 +0000 (20:09 +0200)]
vz: vzEatCookie: use distinct 'tmp' variables
Mark both as g_autofree within their separate scopes.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Fri, 2 Oct 2020 18:06:39 +0000 (20:06 +0200)]
vz: separate if conditions in vzEatCookie
Create a separate scope where 'tmp' variable can be used.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Wed, 30 Sep 2020 13:07:24 +0000 (15:07 +0200)]
vmware: use g_new0 instead of VIR_ALLOC
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Sun, 4 Oct 2020 20:24:00 +0000 (22:24 +0200)]
news: move section about downscript to v6.4.0
The feature was merged in
v6.3.0-175-g61ba6f09b1
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 4eda71a8d05d968e73ab9b0fdc8a90123c57d39e
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Ján Tomko [Sun, 4 Oct 2020 22:20:22 +0000 (00:20 +0200)]
API: virDomainLookupByID: s/UUId/UUID/
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 15:28:46 +0000 (17:28 +0200)]
qemuSlirpNew: Use g_new0 to allocate the slirp object
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:56:48 +0000 (16:56 +0200)]
util: bitmap: Remove virBitmapNewQuiet
We no longer report any errors so all callers can be replaced by
virBitmapNew. Additionally virBitmapNew can't return NULL now so error
handling is not necessary.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 15:42:48 +0000 (17:42 +0200)]
virBitmapNew: Don't force return value check
We now always return a valid pointer or crash so the return value
doesn't need to be checked.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:52:30 +0000 (16:52 +0200)]
virBitmapNewQuiet: Don't fail on unlikely overflow scenario
Modify the condition which would make virBitmapNewQuiet fail to possibly
overallocate by 1 rather than failing.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 12:14:21 +0000 (14:14 +0200)]
virbitmaptest: Add few more cases for virBitmapToString
Test an empty bitmap including it's extension via the self-expanding
APIs and and a "0" and "" strings when converting the string back and
forth.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:45:59 +0000 (16:45 +0200)]
util: virbitmap: Don't forbid 0 size bitmap
We now have APIs which automatically expand the bitmap and also API
which allocates a 0 size bitmap. Remove the condition from virBitmapNew.
Effectively reverts
ce49cfb48ad
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 14:16:21 +0000 (16:16 +0200)]
virbitmaptest: test13: Refactor memory cleanup
Move scope of variables and get rid of the 'cleanup' section.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 12:13:37 +0000 (14:13 +0200)]
virBitmapToString: Properly handle empty bitmaps
virBitmapNewEmpty() can create a bitmap with 0 length. With such a
bitmap virBitmapToString will return NULL rather than an empty string.
Initialize the buffer to avoid that.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 13:52:34 +0000 (15:52 +0200)]
virBitmapToString|virBitmapNewString: Clarify semantics of the 'string'
Clarify which bit is considered most significant in the bitmap and
resulting string. Also be explicit that it's a hex string.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 13:22:24 +0000 (15:22 +0200)]
virBitmapToString: Remove unused 'prefix' and 'trim' arguments
There's only one combination used so we can remove the rest.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Peter Krempa [Thu, 1 Oct 2020 12:11:42 +0000 (14:11 +0200)]
virQEMUCapsFlagsString: Remove unused function
Unused since
a7424faff0fe8270c18d5e9e3befcfd2822d421f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Daniel P. Berrangé [Fri, 2 Oct 2020 14:07:27 +0000 (15:07 +0100)]
examples: fix misc spelling errors reported by codespell
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé [Fri, 2 Oct 2020 14:07:27 +0000 (15:07 +0100)]
tools: fix misc spelling errors reported by codespell
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé [Fri, 2 Oct 2020 14:07:27 +0000 (15:07 +0100)]
tests: fix misc spelling errors reported by codespell
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé [Fri, 2 Oct 2020 14:07:27 +0000 (15:07 +0100)]
src: fix misc spelling errors reported by codespell
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé [Fri, 2 Oct 2020 14:07:27 +0000 (15:07 +0100)]
docs: fix misc spelling errors reported by codespell
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel Henrique Barboza [Thu, 1 Oct 2020 13:34:24 +0000 (10:34 -0300)]
vircommand.c: write child pidfile before process tuning in virExec()
When VIR_EXEC_DAEMON is true and cmd->pidfile exists, the parent
will expect the pidfile to be written before exiting, sitting
tight in a saferead() call waiting.
The child then does process tuning (via virProcessSet* functions)
before writing the pidfile. Problem is that these tunings can
fail, and trigger a 'fork_error' jump, before cmd->pidfile is
written. The result is that the process was aborted in the
child, but the parent is still hang in the saferead() call.
This behavior can be reproduced by trying to create and execute
a QEMU guest in user mode (e.g. using qemu:///session as non-root).
virProcessSetMaxMemLock() will fail if the spawned libvirtd user
process does not have CAP_SYS_RESOURCE capability. setrlimit() will
fail, and a 'fork_error' jump is triggered before cmd->pidfile
is written. The parent will hung in saferead() indefinitely. From
the user perspective, 'virsh start <guest>' will hang up
indefinitely. CTRL+C can be used to retrieve the terminal, but
any subsequent 'virsh' call will also hang because the previous
libvirtd user process is still there.
We can fix this by moving all virProcessSet*() tuning functions
to be executed after cmd->pidfile is taken care of. In the case
mentioned above, this would be the result of 'virsh start'
after this patch:
error: Failed to start domain vm1
error: internal error: Process exited prior to exec: libvirt: error :
cannot limit locked memory to
79691776 : Operation not permitted
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=
1882093
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>