]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
5 years agoformatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic
Daniel Henrique Barboza [Mon, 20 Jul 2020 16:51:46 +0000 (13:51 -0300)] 
formatdomain.html.in: mention pSeries NVDIMM 'align down' mechanic

The reason why we align down the guest area (total-size - label-size) is
explained in the body of qemuDomainNVDimmAlignSizePseries(). This
behavior must also be documented in the user docs.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: pre-create the dbus directory in qemuStateInitialize
Bihong Yu [Tue, 14 Jul 2020 07:44:05 +0000 (15:44 +0800)] 
qemu: pre-create the dbus directory in qemuStateInitialize

There are races condiction to make '/run/libvirt/qemu/dbus' directory in
virDirCreateNoFork() while concurrent start VMs, and get "failed to create
directory '/run/libvirt/qemu/dbus': File exists" error message. pre-create the
dbus directory in qemuStateInitialize.

Signed-off-by: Bihong Yu <yubihong@huawei.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Drop ret variable from qemuConnectCPUModelComparison
Jiri Denemark [Tue, 21 Jul 2020 13:47:29 +0000 (15:47 +0200)] 
qemu: Drop ret variable from qemuConnectCPUModelComparison

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoNEWS: mention readonly attribute is not yet supported by virtiofsd
Jianan Gao [Tue, 21 Jul 2020 13:32:40 +0000 (21:32 +0800)] 
NEWS: mention readonly attribute is not yet supported by virtiofsd

There was a clear statement on not supported by virtiofsd with
readonly attribute.

Signed-off-by: Jianan Gao <jgao@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosecurity: Remove the superfluous break
Liao Pingfang [Fri, 17 Jul 2020 02:00:43 +0000 (10:00 +0800)] 
security: Remove the superfluous break

Remove the superfuous break, as there is a 'return' before it.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Remove superfluous breaks
Liao Pingfang [Fri, 17 Jul 2020 02:00:28 +0000 (10:00 +0800)] 
qemu: Remove superfluous breaks

Remove superfluous breaks, as there is a "return" before them.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: Remove superfluous breaks
Liao Pingfang [Fri, 17 Jul 2020 02:00:09 +0000 (10:00 +0800)] 
conf: Remove superfluous breaks

Remove superfluous breaks, as there is a "return" before them.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: Properly set //cpu/@migratable default value for running domains
Jiri Denemark [Wed, 15 Jul 2020 15:54:07 +0000 (17:54 +0200)] 
qemu: Properly set //cpu/@migratable default value for running domains

Since active domains which do not have the attribute already set were
not started by libvirt that probed for CPU migratable property, we need
to check this property on reconnect and update the domain definition
accordingly.

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

Reported-by: Mark Mielke <mark.mielke@gmail.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: Do not set //cpu/@migratable for running domains in post-parse
Jiri Denemark [Wed, 15 Jul 2020 09:33:05 +0000 (11:33 +0200)] 
qemu: Do not set //cpu/@migratable for running domains in post-parse

Commit v6.4.0-61-g201bd5db63 started to fill the default value for
//cpu/@migratable attribute according to QEMU support. However, active
domains either have the migratable attribute already set or the
capabilities we use for checking the QEMU support were created by older
libvirt which didn't probe for this specific capability. Thus we should
leave active domains alone when parsing their XMLs.

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

Reported-by: Mark Mielke <mark.mielke@gmail.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu_monitor: Add API for checking CPU migratable property
Jiri Denemark [Wed, 15 Jul 2020 20:33:07 +0000 (22:33 +0200)] 
qemu_monitor: Add API for checking CPU migratable property

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu_capabilities.c: use g_autoptr() in virQEMUCapsInitQMPSingle()
Daniel Henrique Barboza [Fri, 17 Jul 2020 21:15:56 +0000 (18:15 -0300)] 
qemu_capabilities.c: use g_autoptr() in virQEMUCapsInitQMPSingle()

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200717211556.1024748-6-danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemu_driver.c: modernize qemuConnectCPUModelComparison()
Daniel Henrique Barboza [Fri, 17 Jul 2020 21:15:55 +0000 (18:15 -0300)] 
qemu_driver.c: modernize qemuConnectCPUModelComparison()

Use g_auto* on pointers to avoid using the 'cleanup' label.

In theory the 'ret' variable can also be discarded if the flow
of the logic is reworked. Perhaps another time.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200717211556.1024748-5-danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemu_driver.c: modernize qemuConnectCPUModelBaseline()
Daniel Henrique Barboza [Fri, 17 Jul 2020 21:15:54 +0000 (18:15 -0300)] 
qemu_driver.c: modernize qemuConnectCPUModelBaseline()

Use g_autoptr() on pointers and remove the unneeded 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200717211556.1024748-4-danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemu_process.c: modernize qemuProcessQMPNew()
Daniel Henrique Barboza [Fri, 17 Jul 2020 21:15:53 +0000 (18:15 -0300)] 
qemu_process.c: modernize qemuProcessQMPNew()

Use g_autoptr() and remove the 'cleanup' label.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200717211556.1024748-3-danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agoqemu_process.h: register AUTOPTR_CLEANUP_FUNC for qemuProcessQMPPtr
Daniel Henrique Barboza [Fri, 17 Jul 2020 21:15:52 +0000 (18:15 -0300)] 
qemu_process.h: register AUTOPTR_CLEANUP_FUNC for qemuProcessQMPPtr

Next patches will use g_autoptr() in qemuProcessQMPPtr pointers
for some cleanups in QMP code.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200717211556.1024748-2-danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
5 years agonetwork: split out networkSetIPv6Sysctl
Ján Tomko [Wed, 15 Jul 2020 21:22:38 +0000 (23:22 +0200)] 
network: split out networkSetIPv6Sysctl

Refactor networkSetIPv6Sysctls to remove repetition and reuse
of the 'field' variable.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemuDomainBlockPivot: Ignore failures of creating active layer bitmap
Peter Krempa [Thu, 16 Jul 2020 13:14:40 +0000 (15:14 +0200)] 
qemuDomainBlockPivot: Ignore failures of creating active layer bitmap

Ignore errors from creating "libvirt-tmp-activewrite" bitmap. This
prevents failures of finishing blockjobs if the bitmap already exists.

Note that if the bitmap exists, the worst case that can happen is that
more bits are marked as dirty in the resulting merge.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainBlockPivot: Rename 'actions' to 'bitmapactions'
Peter Krempa [Thu, 16 Jul 2020 13:13:17 +0000 (15:13 +0200)] 
qemuDomainBlockPivot: Rename 'actions' to 'bitmapactions'

There are two possible 'transaction' command arguments in the function.
Rename 'actions' as they deal with creating bitmaps only.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: block: Remove 'active-write' bitmap even if there are no bitmaps to merge
Peter Krempa [Thu, 16 Jul 2020 12:46:43 +0000 (14:46 +0200)] 
qemu: block: Remove 'active-write' bitmap even if there are no bitmaps to merge

The 'libvirt-tmp-activewrite' bitmap is added during the 'pivot'
operation of block copy and active layer block commit operations
regardless of whether there are any bitmaps to merge, but was not
removed unless a bitmap was merged. This meant that subsequent attempts
to merge into the same image would fail.

Fix it by checking whether the 'libvirt-tmp-activewrite' would be used
by the code and don't skip the code which would delete it.

This is a regression introduced when we switched to the new code for
block commit in <20a7abc2d2d> and for block copy in <7bfff40fdfe5>. The
actual bug originates from <4fa8654ece>.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: blockjob: Actually delete temporary bitmap on failed active commit
Peter Krempa [Thu, 16 Jul 2020 13:19:25 +0000 (15:19 +0200)] 
qemu: blockjob: Actually delete temporary bitmap on failed active commit

Commit 20a7abc2d2d tried to delete the possibly leftover bitmap but
neglected to call the actual monitor to do so.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: blockjob: Don't base bitmap handling of active-layer block commit on QEMU_CAPS_...
Peter Krempa [Thu, 16 Jul 2020 13:54:46 +0000 (15:54 +0200)] 
qemu: blockjob: Don't base bitmap handling of active-layer block commit on QEMU_CAPS_BLOCKDEV_REOPEN

The handler finalizing the active layer block commit doesn't actually
reopen the file for active layer block commit, so the comment and check
are invalid.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agovirDomainSetBlockThreshold: Mention that the event can be registered for <mirror>
Peter Krempa [Wed, 15 Jul 2020 11:09:32 +0000 (13:09 +0200)] 
virDomainSetBlockThreshold: Mention that the event can be registered for <mirror>

The infrastructure supports setting the threshold also for the <mirror>.
Mention it in the docs.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainGetStorageSourceByDevstr: Look also in 'mirror' chain
Peter Krempa [Wed, 15 Jul 2020 10:51:40 +0000 (12:51 +0200)] 
qemuDomainGetStorageSourceByDevstr: Look also in 'mirror' chain

A disk can have a mirror, look also in its backing chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainDiskLookupByNodename: Look also for 'mirror' node names
Peter Krempa [Wed, 15 Jul 2020 10:36:50 +0000 (12:36 +0200)] 
qemuDomainDiskLookupByNodename: Look also for 'mirror' node names

When doing a block copy, there is another chain of images attached to a
disk. Consider them as well when looking up a disk using nodename.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agovirStorageSourceFindByNodeName: Remove unused 'idx' argument
Peter Krempa [Wed, 15 Jul 2020 10:33:34 +0000 (12:33 +0200)] 
virStorageSourceFindByNodeName: Remove unused 'idx' argument

None of the callers actually use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainDiskLookupByNodename: Remove unused 'idx'
Peter Krempa [Wed, 15 Jul 2020 10:29:34 +0000 (12:29 +0200)] 
qemuDomainDiskLookupByNodename: Remove unused 'idx'

All callers pass NULL as the value. Remove the argument.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agovirDomainSetBlockThreshold: Clarify values of @dev the event is fired for
Peter Krempa [Wed, 15 Jul 2020 11:06:44 +0000 (13:06 +0200)] 
virDomainSetBlockThreshold: Clarify values of @dev the event is fired for

Top level image may get two events, one with the disk target (vda) and
one with disk target with index (vda[3]) if the top level image has an
index.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuProcessHandleBlockThreshold: Report correct indexes
Peter Krempa [Wed, 15 Jul 2020 09:51:17 +0000 (11:51 +0200)] 
qemuProcessHandleBlockThreshold: Report correct indexes

The index returned by qemuDomainDiskLookupByNodename is the position in
the backing chain rather than the index we report in the XML.

Since with -blockdev they differ now and additionally the disk source
also has an index we need to fix the 'threshold' events we report:

1) If it's the top level image we must always trigger the event without
   any suffix as we did until now

2) We must report the correct index

3) We must report the correct index also for the top level image, when
   blockdev is used.

This means that we need to potentially emit 2 events, one for the device
without the index and then when blockdev is used and the top level image
has an index we must do it also with the index.

This will fix it for blockdev cases, while also not removing previous
semantics.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainDiskBackingStoreGetName: Eliminate temp variable
Peter Krempa [Wed, 15 Jul 2020 10:01:39 +0000 (12:01 +0200)] 
qemuDomainDiskBackingStoreGetName: Eliminate temp variable

We can return the formatted string directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuDomainDiskBackingStoreGetName: Remove unused argument
Peter Krempa [Wed, 15 Jul 2020 10:19:35 +0000 (12:19 +0200)] 
qemuDomainDiskBackingStoreGetName: Remove unused argument

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agovirDomainSetBlockThreshold: Document values of '@dev' better
Peter Krempa [Wed, 15 Jul 2020 11:02:24 +0000 (13:02 +0200)] 
virDomainSetBlockThreshold: Document values of '@dev' better

Mention where to obtain the index and how it's treated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agonwfilter: convert remaining VIR_FREE() to g_free()
Laine Stump [Thu, 25 Jun 2020 02:06:47 +0000 (22:06 -0400)] 
nwfilter: convert remaining VIR_FREE() to g_free()

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: convert local pointers to use g_auto*
Laine Stump [Thu, 25 Jun 2020 01:59:39 +0000 (21:59 -0400)] 
nwfilter: convert local pointers to use g_auto*

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: replace VIR_ALLOC with g_new0
Laine Stump [Wed, 24 Jun 2020 20:55:23 +0000 (16:55 -0400)] 
nwfilter: replace VIR_ALLOC with g_new0

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: use standard label names when reasonable
Laine Stump [Thu, 25 Jun 2020 02:20:56 +0000 (22:20 -0400)] 
nwfilter: use standard label names when reasonable

Rather than having labels named exit, done, exit_snooprequnlock,
skip_rename, etc, use the standard "cleanup" label. And instead of
err_exit, malformed, tear_down_tmpebchains, use "error".

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: transform logic in virNWFilterRuleInstSort to eliminate label
Laine Stump [Thu, 25 Jun 2020 02:30:38 +0000 (22:30 -0400)] 
nwfilter: transform logic in virNWFilterRuleInstSort to eliminate label

This rewrite of a nested conditional produces the same results, but
eliminate a goto and corresponding label.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: define a typedef for struct ebtablesSubChainInst
Laine Stump [Wed, 24 Jun 2020 19:56:43 +0000 (15:56 -0400)] 
nwfilter: define a typedef for struct ebtablesSubChainInst

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: clear nrules when resetting virNWFilterInst
Laine Stump [Sun, 5 Jul 2020 02:29:23 +0000 (22:29 -0400)] 
nwfilter: clear nrules when resetting virNWFilterInst

It's possible/probable the callers to virNWFilterInstReset() make it
unnecessary to set the object's nrules to 0 after freeing all its
rules, but that same function is setting nfilters to 0, so let's do
the same for the sake of consistency.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonwfilter: remove unnecessary code from ebtablesGetSubChainInsts()
Laine Stump [Wed, 24 Jun 2020 23:31:55 +0000 (19:31 -0400)] 
nwfilter: remove unnecessary code from ebtablesGetSubChainInsts()

On failure, this function would clear out and free the list of
subchains it had been called with. This is unnecessary, because the
*only* caller of this function will also clear out and free the list
of subchains if it gets a failure from ebtablesGetSubChainInsts().

(It also makes more logical sense for the function that is creating
the entire list to be the one freeing the entire list, rather than
having a function whose purpose is only to create *one item* on the
list freeing the entire list).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko redhat com>
5 years agonetwork: use g_free() in place of remaining VIR_FREE()
Laine Stump [Wed, 24 Jun 2020 02:38:17 +0000 (22:38 -0400)] 
network: use g_free() in place of remaining VIR_FREE()

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonetwork: eliminate unnecessary labels
Laine Stump [Sat, 4 Jul 2020 03:51:27 +0000 (23:51 -0400)] 
network: eliminate unnecessary labels

All these cleanup/error labels were reduced to having just "return
ret" by a previous patch, so get rid of them and return directly.

This patch coincidentally fixes a bug in
networkFindUnusedBridgeName(), where we would log an error yet still
return success if we failed to find a single unused "virbrNNN" name
after checking all values of "N" from 0 - 256. Said bug was introduced
when that function was originally written, in commit a28d3e485f
(libvirt 1.2.15, 2015)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonetwork: use g_auto wherever appropriate
Laine Stump [Sat, 4 Jul 2020 03:43:21 +0000 (23:43 -0400)] 
network: use g_auto wherever appropriate

This includes standard g_autofree() as well as other objects that have
a cleanup function defined to use via g_autoptr (virCommand,
virJSONValue)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonetwork: replace VIR_ALLOC/REALLOC with g_new0/g_renew
Laine Stump [Wed, 24 Jun 2020 17:06:43 +0000 (13:06 -0400)] 
network: replace VIR_ALLOC/REALLOC with g_new0/g_renew

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agodefine g_autoptr cleanup function for virNetworkDHCPLease
Laine Stump [Wed, 24 Jun 2020 17:04:25 +0000 (13:04 -0400)] 
define g_autoptr cleanup function for virNetworkDHCPLease

virNetworkDHCPLease and virNetworkDHCPLeaseFree() are declared in the
public API file libvirt-network.h, and we can't pollute that with glib
macro invocations, so put this in src/datatypes.h next to the other
virNetwork items.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: define g_autoptr cleanups for a couple dnsmasq objects
Laine Stump [Fri, 3 Jul 2020 03:40:13 +0000 (23:40 -0400)] 
util: define g_autoptr cleanups for a couple dnsmasq objects

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoreplace g_new() with g_new0() for consistency
Laine Stump [Thu, 25 Jun 2020 02:37:33 +0000 (22:37 -0400)] 
replace g_new() with g_new0() for consistency

g_new() is used in only 3 places. Switching them to g_new0() will do
no harm, reduces confusion, and helps me sleep better at night knowing
that all allocated memory is initialized to 0 :-) (Yes, I *know* that
in all three cases the associated memory is immediately assigned some
other value. Today.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agospec: Drop explicit dependency on ncurses
Andrea Bolognani [Sat, 18 Jul 2020 21:54:37 +0000 (23:54 +0200)] 
spec: Drop explicit dependency on ncurses

We don't actually use ncurses directly: readline needs it, but
that's a readline implementation detail and not something that we
should concern ourselves with.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoqemu_domainjob: introduce `privateData` for `qemuDomainJob`
Prathamesh Chavan [Thu, 16 Jul 2020 11:48:34 +0000 (17:18 +0530)] 
qemu_domainjob: introduce `privateData` for `qemuDomainJob`

To remove dependecy of `qemuDomainJob` on job specific
paramters, a `privateData` pointer is introduced.
To handle it, structure of callback functions is
also introduced.

Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoInclude <sys/socket.h> before including <net/if.h>
Ryan Schmidt [Thu, 9 Jul 2020 05:36:33 +0000 (00:36 -0500)] 
Include <sys/socket.h> before including <net/if.h>

This is necessary for OS X 10.8 and earlier.

Signed-off-by: Ryan Schmidt <git@ryandesign.com>
5 years agospec: Don't require mdevctl on RHEL 7
Andrea Bolognani [Sat, 18 Jul 2020 22:43:08 +0000 (00:43 +0200)] 
spec: Don't require mdevctl on RHEL 7

mdevctl is a relatively new tool that's packaged for Fedora and
RHEL 8, but not for RHEL 7. Make the dependency conditional to
avoid the libvirt-daemon-driver-nodedev package becoming
uninstallable on that platform.

Fixes: 9691440ecbc7d9383a1410f1067a4f9221f2de2c
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agospec: Remove unnecessary version check
Andrea Bolognani [Sat, 18 Jul 2020 21:46:09 +0000 (23:46 +0200)] 
spec: Remove unnecessary version check

As of 65a883b34932 we no longer support Fedora releases older than
31, so the version check has become unnecessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: fix compilation instructions to use separate build dir
Daniel P. Berrangé [Fri, 17 Jul 2020 09:50:22 +0000 (10:50 +0100)] 
docs: fix compilation instructions to use separate build dir

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 agovirNetSocketCheckProtocols: Actually check bool value
Michal Privoznik [Fri, 17 Jul 2020 14:14:23 +0000 (16:14 +0200)] 
virNetSocketCheckProtocols: Actually check bool value

In 9536379da4c8ed61 and 8b0cb0e666f I've tried to call
virNetSocketCheckProtocolByLookup() only if we are suspecting the
host is IPv4 or IPv6 capable (because we've found an interface
with such address). However, the code was missing dereference of
the boolean variables and thus was comparing pointers against
NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoPartially revert "qemu: fix missing error reports in capabilities probing"
Daniel P. Berrangé [Wed, 15 Jul 2020 14:53:11 +0000 (15:53 +0100)] 
Partially revert "qemu: fix missing error reports in capabilities probing"

This partially reverts commit 5331c4804f4f419b9e75741084f926e52413d3a1.

The original commit mistakenly thought virFileCacheLookup did not set
an error. In fact the only case it doesn't set an error for is when
the cache key is NULL. This in fact the fault of the caller for passing
an invalid cache key, so doesn't need to be handled.

This caller bug was fixed by checking for a NULL binary in the
virQEMUCapsCacheLookupDefault method.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirDomainHostdevSubsysSCSIiSCSIDefParseXML: Use XPath to fetch elements
Peter Krempa [Fri, 10 Jul 2020 11:55:18 +0000 (13:55 +0200)] 
virDomainHostdevSubsysSCSIiSCSIDefParseXML: Use XPath to fetch elements

Conver the code to the new approach which uses XPath to fetch known
elements rather than looping through all XML children.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevSubsysSCSIDefParseXML: Use typecasted switch
Peter Krempa [Fri, 10 Jul 2020 11:47:02 +0000 (13:47 +0200)] 
virDomainHostdevSubsysSCSIDefParseXML: Use typecasted switch

Use a switch statement which will not be omitted when adding potential
new types.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Split out formatting of mdev subsystem
Peter Krempa [Fri, 10 Jul 2020 10:26:31 +0000 (12:26 +0200)] 
virDomainHostdevDefFormatSubsys: Split out formatting of mdev subsystem

Similarly to previous commit split out formatting of the mdev subsystem
related stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Split out formatting of vHBA subsystem
Peter Krempa [Fri, 10 Jul 2020 10:26:31 +0000 (12:26 +0200)] 
virDomainHostdevDefFormatSubsys: Split out formatting of vHBA subsystem

Similarly to previous commit split out formatting of the vHBA subsystem
related stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsysSCSI: Avoid ternary operator when formatting address
Peter Krempa [Tue, 14 Jul 2020 17:26:42 +0000 (19:26 +0200)] 
virDomainHostdevDefFormatSubsysSCSI: Avoid ternary operator when formatting address

Split up formatting of the '<address>' element rather that trying to
optimize it with formatting string hacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Split out formatting of SCSI subsystem
Peter Krempa [Fri, 10 Jul 2020 10:26:31 +0000 (12:26 +0200)] 
virDomainHostdevDefFormatSubsys: Split out formatting of SCSI subsystem

Similarly to previous commit split out formatting of the SCSI subsystem
related stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Split out formatting of PCI subsystem
Peter Krempa [Fri, 10 Jul 2020 10:26:31 +0000 (12:26 +0200)] 
virDomainHostdevDefFormatSubsys: Split out formatting of PCI subsystem

Similarly to previous commit split out formatting of the PCI subsystem
related stuff.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Split out formatting of USB subsystem
Peter Krempa [Fri, 10 Jul 2020 10:26:31 +0000 (12:26 +0200)] 
virDomainHostdevDefFormatSubsys: Split out formatting of USB subsystem

Separate out bits related to USB so that the logic isn't entangled in
multiple conditional statements.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Use virXMLFormatElement
Peter Krempa [Fri, 10 Jul 2020 10:11:33 +0000 (12:11 +0200)] 
virDomainHostdevDefFormatSubsys: Use virXMLFormatElement

Refactor the formatter to the new multiple buffer based approach so that
we can easily separate it into formatters per subsys type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBuildSCSIHostdevDrvStr: unexport
Peter Krempa [Fri, 19 Jun 2020 09:34:53 +0000 (11:34 +0200)] 
qemuBuildSCSIHostdevDrvStr: unexport

The function is no longer called from other modules.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: caps: Enable QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
Peter Krempa [Wed, 8 Jul 2020 13:02:56 +0000 (15:02 +0200)] 
qemu: caps: Enable QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI

Enable it when regular QEMU_CAPS_BLOCKDEV is present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainRemoveHostDevice: Use new infrastructure for (i)SCSI
Peter Krempa [Fri, 19 Jun 2020 13:51:06 +0000 (15:51 +0200)] 
qemuDomainRemoveHostDevice: Use new infrastructure for (i)SCSI

Similarly to previous commits, modify the hostdev detach code to use
blockdev infrastructure to detach (i)SCSI hostdevs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainAttachHostSCSIDevice: Use new infrastructure
Peter Krempa [Fri, 19 Jun 2020 14:44:23 +0000 (16:44 +0200)] 
qemuDomainAttachHostSCSIDevice: Use new infrastructure

Similarly to command line creation, use the blockdev helpers when
hotplugging an (i)SCSI hostdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBuildHostdevSCSICommandLine: Use new infrastructure
Peter Krempa [Wed, 8 Jul 2020 13:03:46 +0000 (15:03 +0200)] 
qemuBuildHostdevSCSICommandLine: Use new infrastructure

In preparation for instantiating (i)SCSI hostdevs via -blockdev,
refactor qemuBuildHostdevSCSICommandLine to use the new infrastructure
which will do it automatically.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: command: Create qemuBlockStorageSourceAttachData for (i)SCSI hostdevs
Peter Krempa [Fri, 19 Jun 2020 14:53:56 +0000 (16:53 +0200)] 
qemu: command: Create qemuBlockStorageSourceAttachData for (i)SCSI hostdevs

Add convertor for creating qemuBlockStorageSourceAttachData which will
allow reusing the infrastructure which we have for attaching disks also
for hostdevs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: capabilities: Add QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
Peter Krempa [Wed, 8 Jul 2020 13:02:47 +0000 (15:02 +0200)] 
qemu: capabilities: Add QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI

We want to instantiate hostdevs via -blockdev too. Add a separate
capability for them for a clean transition. The new capability will be
enabled when QEMU_CAPS_BLOCKDEV is present once all code is prepared.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBuildSCSIHostdevDevStr: Pass in backend alias
Peter Krempa [Fri, 19 Jun 2020 14:56:36 +0000 (16:56 +0200)] 
qemuBuildSCSIHostdevDevStr: Pass in backend alias

Don't (re)generate the backend alias (alias of the -drive backend for
now) internally but rather pass it in. Later on it will be replaced by
the nodename when blockdev is used depending on the capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBuildHostdevCommandLine: Extract (i)SCSI code
Peter Krempa [Wed, 17 Jun 2020 15:06:35 +0000 (17:06 +0200)] 
qemuBuildHostdevCommandLine: Extract (i)SCSI code

Move all (i)SCSI related code into a new function named
'qemuBuildHostdevSCSICommandLine'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: hotplug: Don't regenerate iSCSI secret alias
Peter Krempa [Wed, 17 Jun 2020 09:58:58 +0000 (11:58 +0200)] 
qemu: hotplug: Don't regenerate iSCSI secret alias

We now store the alias of the secrets in the status XML so there's no
need to generate it again.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Regenerate hostdev source private data
Peter Krempa [Wed, 17 Jun 2020 07:29:13 +0000 (09:29 +0200)] 
qemu: domain: Regenerate hostdev source private data

When upgrading from a libvirt which didn't format private data of a
virStorageSource representing an iSCSI hostdev source, we might need to
generate some internal data so that the code still works as if it was
present in the status XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainSecretHostdevDestroy: Don't clear secinfo alias
Peter Krempa [Fri, 10 Jul 2020 12:54:09 +0000 (14:54 +0200)] 
qemuDomainSecretHostdevDestroy: Don't clear secinfo alias

We need the alias to deal with hot-unplug of the hostdev. Use
qemuDomainSecretInfoDestroy which clears only the secrets and not the
alias. The same function is used also for handling disk secrets.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemustatusxml2xmltest: Add tests for iSCSI hostdev private data handling
Peter Krempa [Wed, 17 Jun 2020 09:27:02 +0000 (11:27 +0200)] 
qemustatusxml2xmltest: Add tests for iSCSI hostdev private data handling

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevSubsysSCSIiSCSIDefParseXML: Parse private data of virStorageSource
Peter Krempa [Tue, 16 Jun 2020 14:00:15 +0000 (16:00 +0200)] 
virDomainHostdevSubsysSCSIiSCSIDefParseXML: Parse private data of virStorageSource

We store the config of an iSCSI hostdev in a virStorageSource structure.
Parse the private data portion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirDomainHostdevDefFormatSubsys: Format private data for a virStorageSource
Peter Krempa [Tue, 16 Jun 2020 14:22:50 +0000 (16:22 +0200)] 
virDomainHostdevDefFormatSubsys: Format private data for a virStorageSource

iSCSI subsystem hostdevs store the data as a virStorageSource. Format
the private data part of the virStorageSource in the appropriate place.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name
Peter Krempa [Fri, 19 Jun 2020 14:47:08 +0000 (16:47 +0200)] 
qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name

SCSI hostdevs don't have a virStorageSource associated with the backend
in certain cases. Adding a separate field to hold memory for a copy of
the nodename of the storage backend will allow reusing the blockdev
machinery also for SCSI hostdevs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBlockStorageSourceGetBackendProps: Allow skipping "discard":"unmap"
Peter Krempa [Fri, 19 Jun 2020 14:37:43 +0000 (16:37 +0200)] 
qemuBlockStorageSourceGetBackendProps: Allow skipping "discard":"unmap"

It doesn't make sense to format "discard" when doing a -blockdev backend
of scsi-generic used with SCSI hostdevs. Add a way to skip it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuBlockStorageSourceGetBackendProps: Convert boolean arguments to flags
Peter Krempa [Fri, 19 Jun 2020 14:28:12 +0000 (16:28 +0200)] 
qemuBlockStorageSourceGetBackendProps: Convert boolean arguments to flags

Upcoming commit will need to add another flag for the function so
convert it to a bitwise-or'd array of flags to prevent having 4
booleans.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirNetSocketCheckProtocols: Confirm IPv4 by lookup too
Michal Privoznik [Wed, 15 Jul 2020 11:48:46 +0000 (13:48 +0200)] 
virNetSocketCheckProtocols: Confirm IPv4 by lookup too

Historically, if we found an interface with an IPv6 address we
did not blindly trust that host is IPv6 capable (as in we can
successfully translate IPv4 addresses) but used getaddrinfo() to
confirm it. Turns out, we have use the same argument for IPv4.
For instance, in an namespace created by the following steps,
getaddrinfo("127.0.0.1", ...) fails (demonstrating by "Socket
TCP/IPv4 Accept" test case failing in virnetsockettest):

  unshare -n
  ip link set lo up
  ip link add dummy0 type dummy
  ip link set dummy0 up

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirNetSocketCheckProtocols: lookup IPv6 only if suspecting IPv6
Michal Privoznik [Wed, 15 Jul 2020 11:48:45 +0000 (13:48 +0200)] 
virNetSocketCheckProtocols: lookup IPv6 only if suspecting IPv6

There is not much sense trying to disprove host is IPv6 capable
if we know after first round (getifaddrs()) that is is not.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirNetSocketCheckProtocols: Separate out checking family via getaddrinfo()
Michal Privoznik [Wed, 15 Jul 2020 11:48:44 +0000 (13:48 +0200)] 
virNetSocketCheckProtocols: Separate out checking family via getaddrinfo()

The virNetSocketCheckProtocols() function is supposed to tell
caller whether IPv4 and/or IPv6 is supported on the system. In
the initial round, it uses getifaddrs() to see if an interface
has IPv4/IPv6 address assigned and then to double check IPv6 it
uses getaddrinfo() to lookup IPv6 loopback address. Separate out
this latter code because it is going to be reused.

Since the original code lived under an #ifdef and the new
function doesn't it is marked as unused - because on some systems
it may be so.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoSubstitute security_context_t with char *
Michal Privoznik [Wed, 15 Jul 2020 10:32:48 +0000 (12:32 +0200)] 
Substitute security_context_t with char *

Historically, we've used security_context_t for variables passed
to libselinux APIs. But almost 7 years ago, libselinux developers
admitted in their API that in fact, it's just a 'char *' type
[1]. Ever since then the APIs accept 'char *' instead, but they
kept the old alias just for API stability. Well, not anymore [2].

1: https://github.com/SELinuxProject/selinux/commit/9eb9c9327563014ad6a807814e7975424642d5b9
2: https://github.com/SELinuxProject/selinux/commit/7a124ca2758136f49cc38efc26fb1a2d385ecfd9

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agotests: Minimize variable scope
Andrea Bolognani [Tue, 14 Jul 2020 19:52:10 +0000 (21:52 +0200)] 
tests: Minimize variable scope

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: Don't assume IPv4 connectivity is available
Andrea Bolognani [Tue, 14 Jul 2020 19:39:50 +0000 (21:39 +0200)] 
tests: Don't assume IPv4 connectivity is available

If the host doesn't have a single IPv4 address assigned to any of
its interfaces, not even the loopback one, then virnetsockettest
will fail with

  Cannot identify IPv4/6 availability

because, while the IPv6 bind attempt is conditional, the IPv4 one
is not, and in this case it will always fail.

This commit is better viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoci: Drop Debian 9 containers
Andrea Bolognani [Tue, 14 Jul 2020 16:50:04 +0000 (18:50 +0200)] 
ci: Drop Debian 9 containers

The corresponding libvirt-ci commit is 5abf5e7e2326.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoci: Drop Debian 9 jobs
Andrea Bolognani [Tue, 14 Jul 2020 16:49:41 +0000 (18:49 +0200)] 
ci: Drop Debian 9 jobs

The existing cross-compilation jobs are carefully redistributed
among Debian 10 and Debian sid to ensure we don't use the latter
for aarch64, mipsel or mips64el, since those architectures are
currently broken.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Choose TPM 2 for backend as default for CRB interface
Stefan Berger [Thu, 9 Jul 2020 20:46:20 +0000 (16:46 -0400)] 
qemu: Choose TPM 2 for backend as default for CRB interface

Choose a TPM 2 device for the backend as default for the CRB interface
since TPM 1.2 would not work.

This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?id=1781913

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5 years agoqemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
Stefan Berger [Thu, 9 Jul 2020 20:46:19 +0000 (16:46 -0400)] 
qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice

The firmware (SLOF) on QEMU for ppc64 does not support TPM 1.2, so
prevent the choice of TPM 1.2 when the SPAPR device model is chosen
and use a default of '2.0' (TPM 2) for the backend.

This patch addresses BZ 1781913: https://bugzilla.redhat.com/show_bug.cgi?id=1781913

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5 years agoqemu: Move setting of TPM default to post parse function
Stefan Berger [Thu, 9 Jul 2020 20:46:18 +0000 (16:46 -0400)] 
qemu: Move setting of TPM default to post parse function

Move setting the TPM default version out of the validation function into
the post parse function.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5 years agodocs: platforms: Mention Windows API target
Andrea Bolognani [Tue, 14 Jul 2020 12:39:11 +0000 (14:39 +0200)] 
docs: platforms: Mention Windows API target

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: platforms: Clarify stance on third-party LTS efforts
Andrea Bolognani [Tue, 14 Jul 2020 12:38:41 +0000 (14:38 +0200)] 
docs: platforms: Clarify stance on third-party LTS efforts

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: platforms: Simplify support policy
Andrea Bolognani [Tue, 14 Jul 2020 12:38:17 +0000 (14:38 +0200)] 
docs: platforms: Simplify support policy

We discuss Linux, FreeBSD and macOS separately, and we even go as
far as splitting Linux distros into short-lifetime and long-lifetime,
when ultimately the same two priciples apply everywhere: we don't
want to support a platform longer than its vendor does, and in cases
where the vendor support is extremely long we need to have a
time-based escape hatch.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: platforms: Convert to reStructuredText
Andrea Bolognani [Tue, 14 Jul 2020 12:18:40 +0000 (14:18 +0200)] 
docs: platforms: Convert to reStructuredText

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: platforms: Add brief outline
Andrea Bolognani [Tue, 14 Jul 2020 12:25:00 +0000 (14:25 +0200)] 
docs: platforms: Add brief outline

This will make the document look nicer, especially after we have
converted it to reStructuredText.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
5 years agodocs: bhyve: document ignoring unknown MSRs
Roman Bogorodskiy [Tue, 14 Jul 2020 15:41:10 +0000 (19:41 +0400)] 
docs: bhyve: document ignoring unknown MSRs

Ignoring unknown MSRs using <features> element
<msrs unknown='ignore'/> was supported for quite some already,
so add documentation for it for completeness of flags coverage,
as some guests can be extra picky about flags passed to bhyve,
and it's useful to know how to control those.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu_domainjob: Move PrivateXML parse-job and format-job
Prathamesh Chavan [Mon, 13 Jul 2020 18:03:39 +0000 (23:33 +0530)] 
qemu_domainjob: Move PrivateXML parse-job and format-job

Functions `qemuDomainObjPrivateXMLParseJob` and
`qemuDomainObjPrivateXMLFormatJob` are moved from
`qemu_domain` to `qemu_domainjob`.

Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu_domain: remove passing `qemuDomainObjPrivatePtr` as param
Prathamesh Chavan [Mon, 13 Jul 2020 18:03:38 +0000 (23:33 +0530)] 
qemu_domain: remove passing `qemuDomainObjPrivatePtr` as param

`qemuDomainObjPrivatePtr` parameter was avoided being passed
as a paramter in functions `qemuDomainObjPrivateXMLParseJob`
and `qemuDomainObjPrivateXMLFormatJob`, as we already pass
`virDomainObjPtr`, which can be used to get `privateData`
pointer.

Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>