]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agoutil: delete VIR_ALLOC and VIR_ALLOC_N
Ján Tomko [Thu, 8 Oct 2020 11:50:06 +0000 (13:50 +0200)] 
util: delete VIR_ALLOC and VIR_ALLOC_N

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agotests: delete VIR_ALLOC tests cases
Ján Tomko [Thu, 8 Oct 2020 11:50:00 +0000 (13:50 +0200)] 
tests: delete VIR_ALLOC tests cases

There are no more users of VIR_ALLOC or VIR_ALLOC_N.
Delete their test cases.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agotests: use g_new0 instead of VIR_ALLOC
Ján Tomko [Thu, 8 Oct 2020 11:49:50 +0000 (13:49 +0200)] 
tests: use g_new0 instead of VIR_ALLOC

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agosrc: use g_new0 instead of VIR_ALLOC
Ján Tomko [Wed, 23 Sep 2020 18:44:29 +0000 (20:44 +0200)] 
src: use g_new0 instead of VIR_ALLOC

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoremote: remoteDispatchAuthList: remove useless 'rv'
Ján Tomko [Thu, 8 Oct 2020 10:47:00 +0000 (12:47 +0200)] 
remote: remoteDispatchAuthList: remove useless 'rv'

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoremote: use g_new0 instead of VIR_ALLOC
Ján Tomko [Sun, 4 Oct 2020 15:23:22 +0000 (17:23 +0200)] 
remote: use g_new0 instead of VIR_ALLOC

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agolibxl: xenParseXMOS: separate VIR_ALLOC call
Ján Tomko [Tue, 6 Oct 2020 14:45:20 +0000 (16:45 +0200)] 
libxl: xenParseXMOS: separate VIR_ALLOC call

To reduce churn in the following patches.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoremote: refactor remoteSerializeDHCPLease
Ján Tomko [Thu, 8 Oct 2020 10:21:01 +0000 (12:21 +0200)] 
remote: refactor remoteSerializeDHCPLease

Use g_new0 for allocation and remove all the temporary
variables.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agotests: commandhelper: Accept POLLNVAL on macOS
Roman Bolshakov [Thu, 8 Oct 2020 14:02:08 +0000 (17:02 +0300)] 
tests: commandhelper: Accept POLLNVAL on macOS

commandhelper hangs indefinitely in poll() on macOS on commandtest test2
and later because POLLNVAL is returned on revents for input file
descriptor opened from /dev/null, i.e this hangs:

  $ tests/commandhelper < /dev/null
  BEGIN STDOUT
  BEGIN STDERR
  ^C

But it works fine with regular stdin:

  $ tests/commandhelper <<< test
  BEGIN STDOUT
  BEGIN STDERR
  test
  test
  END STDOUT
  END STDERR

The issue is mentioned in poll(2):

  BUGS
    The poll() system call currently does not support devices.

With the change all 28 cases in commandtest pass.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agospec: Rework comment to avoid macro expansion
Andrea Bolognani [Thu, 8 Oct 2020 14:34:37 +0000 (16:34 +0200)] 
spec: Rework comment to avoid macro expansion

Without this, rpmbuild fails with

  warning: Macro expanded in comment on line 402: %firewalld_reload macro
  error: line 402: Unknown tag: test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agospec: Explain the BuildRequires on firewalld-filesystem
Andrea Bolognani [Thu, 8 Oct 2020 10:58:15 +0000 (12:58 +0200)] 
spec: Explain the BuildRequires on firewalld-filesystem

It's not immediately obvious why it is needed.

Suggested-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: bhyve: style improvements
Roman Bogorodskiy [Sun, 4 Oct 2020 02:20:11 +0000 (06:20 +0400)] 
docs: bhyve: style improvements

 - Wrap long lines in "domxml-to-native" example so it fits
   content width,
 - For changeset revision links, use "FreeBSD changeset rN" or
   "changeset rN" instead of just "rN" to make it more readable.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoqemu: Don't generate '-machine memory-backend' and '-numa memdev'
Michal Privoznik [Tue, 6 Oct 2020 07:04:55 +0000 (09:04 +0200)] 
qemu: Don't generate '-machine memory-backend' and '-numa memdev'

In 88957116c9 I've switched to -machine memory-backend=ID and
-object memory-backend-* because QEMU is obsoleting -mem-path
and -mem-prealloc. However, what I did not foresee was that using
-machine memory-backend in combination with -numa is not allowed
in QEMU. This was reported upstream and fortunately not released
yet.

The problem is that if domain has NUMA nodes then we will
generate memory-backend-* objects for NUMA nodes (because if QEMU
is new enough to expose default RAM ID it also supports -numa
memdev=) and adding non-NUMA memory backend is wrong.

Reported-by: Masayoshi Mizuma <msys.mizuma@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: agent: split out qemuAgentGetAllInterfaceAddresses
Ján Tomko [Wed, 7 Oct 2020 12:33:08 +0000 (14:33 +0200)] 
qemu: agent: split out qemuAgentGetAllInterfaceAddresses

Remove more logic from qemuAgentGetInterfaces.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemuAgentGetInterfaceOneAddress: check for errors early
Ján Tomko [Wed, 7 Oct 2020 12:04:04 +0000 (14:04 +0200)] 
qemuAgentGetInterfaceOneAddress: check for errors early

For readability, and to ensure we do allocation when
returning 0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: rename tmp_iface to iface_obj
Ján Tomko [Mon, 5 Oct 2020 20:45:08 +0000 (22:45 +0200)] 
qemu: agent: rename tmp_iface to iface_obj

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemuAgentGetInterfaceAddresses: turn ifname into char*
Ján Tomko [Mon, 5 Oct 2020 20:35:34 +0000 (22:35 +0200)] 
qemuAgentGetInterfaceAddresses: turn ifname into char*

We only care about the first part of the 'ifname' string,
splitting it is overkill.

Instead, just replace the ':' with a '\0' in a copy of the string.
This reduces the count of the varaibles containing some form
of the interface name to two.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: remove cleanup in qemuAgentGetInterfaces
Ján Tomko [Mon, 5 Oct 2020 20:05:55 +0000 (22:05 +0200)] 
qemu: agent: remove cleanup in qemuAgentGetInterfaces

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: use g_auto in qemuAgentGetInterfaces
Ján Tomko [Mon, 5 Oct 2020 20:04:34 +0000 (22:04 +0200)] 
qemu: agent: use g_auto in qemuAgentGetInterfaces

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: use GetArray to remove a check
Ján Tomko [Mon, 5 Oct 2020 20:09:08 +0000 (22:09 +0200)] 
qemu: agent: use GetArray to remove a check

The error check for ValueObjectGet("return") is redundant,
qemuAgentCommand already checked for us that the reply contains
a "return" object.

It does not guarantee, that it is an array.

Use virJSONValueObjectGetArray that combines getting the object
with checking for its type and return the more helpful of
the two error messages.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: split out qemuAgentGetInterfaceAddresses
Ján Tomko [Mon, 5 Oct 2020 19:48:12 +0000 (21:48 +0200)] 
qemu: agent: split out qemuAgentGetInterfaceAddresses

Convert one interface from the "return" array returned by
"guest-network-get-interfaces" to virDomainInterface.

Due to the functionality of squashing interface aliases together,
this is not a pure function - it either:
* Adds the interface to ifaces_ret, incrementing ifaces_count
  and adds a pointer to it into the ifaces_store hash table.
* Adds the additional IP addresses from the interface alias
  to the existing interface entry, found through the hash table.
  This does not increment ifaces_count or extend the array.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: simplify access to ifaces_ret
Ján Tomko [Mon, 5 Oct 2020 20:22:00 +0000 (22:22 +0200)] 
qemu: agent: simplify access to ifaces_ret

We have a local 'iface' variable that contains the same value
eventually. Initialize it early instead of indexing two more
times.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: use virHashNew
Ján Tomko [Mon, 5 Oct 2020 19:34:52 +0000 (21:34 +0200)] 
qemu: agent: use virHashNew

We're passing 'ifaces_count' to virHashCreate as the initial
hash table size just after we've initialized it to zero.
This translates to a default of 256 inside virHashCreateFull.

Instead of this obfuscation, use virHashNew (default of 32),
to make it obvious we don't care about the initial hash size.

Also remove the error handling, since neither of the functions
return any errors after switching to g_new0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: use g_auto for ifname
Ján Tomko [Mon, 5 Oct 2020 19:32:49 +0000 (21:32 +0200)] 
qemu: agent: use g_auto for ifname

This lets us conveniently reduce its scope to the outer loop.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: expand addrs upfront
Ján Tomko [Mon, 5 Oct 2020 19:26:01 +0000 (21:26 +0200)] 
qemu: agent: expand addrs upfront

qemuAgentGetInterfaceOneAddress returns exactly one address
for every iteration of the loop (and we error out if not).

Instead of expanding the addrs by one on every iteration,
do it upfront since we know how many times the loop will
execute.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: reduce scope of addrs_count
Ján Tomko [Mon, 5 Oct 2020 19:25:43 +0000 (21:25 +0200)] 
qemu: agent: reduce scope of addrs_count

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: remove impossible errors
Ján Tomko [Mon, 5 Oct 2020 19:21:07 +0000 (21:21 +0200)] 
qemu: agent: remove impossible errors

For both 'ip_addr_arr' and 'ret_array', we:
1) already checked that they are arrays
2) only iterate up to the array size

Remove the duplicate checks.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: split out qemuAgentGetInterfaceOneAddress
Ján Tomko [Mon, 5 Oct 2020 18:35:08 +0000 (20:35 +0200)] 
qemu: agent: split out qemuAgentGetInterfaceOneAddress

A function that takes one entry from the "ip-addresses" array
returned by "guest-network-get-interfaces" and converts it
into virDomainIPAddress.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agoqemu: agent: remove redundant checks
Ján Tomko [Mon, 5 Oct 2020 20:09:49 +0000 (22:09 +0200)] 
qemu: agent: remove redundant checks

virJSONValueObjectGetArray returns NULL if the object with
the supplied key is not an array.

Calling virJSONValueIsArray right after is redundant.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
4 years agotools: spell out the type instead of using typeof
Ján Tomko [Wed, 7 Oct 2020 18:54:13 +0000 (20:54 +0200)] 
tools: spell out the type instead of using typeof

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoconf: virDomainUSBAddressHubNew: refactor
Ján Tomko [Tue, 6 Oct 2020 14:42:51 +0000 (16:42 +0200)] 
conf: virDomainUSBAddressHubNew: refactor

Remove the pointless variable and pointer stealing.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:15:50 +0000 (21:15 +0200)] 
conf: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: cpu: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:15:39 +0000 (21:15 +0200)] 
conf: cpu: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: nwfilter_params: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:15:19 +0000 (21:15 +0200)] 
conf: nwfilter_params: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: virsecretobj: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:15:03 +0000 (21:15 +0200)] 
conf: virsecretobj: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: storage: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:14:47 +0000 (21:14 +0200)] 
conf: storage: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: numa: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:14:18 +0000 (21:14 +0200)] 
conf: numa: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: interface: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:13:54 +0000 (21:13 +0200)] 
conf: interface: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: domain_addr: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:13:27 +0000 (21:13 +0200)] 
conf: domain_addr: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: node_device: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:12:42 +0000 (21:12 +0200)] 
conf: node_device: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: network: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:12:20 +0000 (21:12 +0200)] 
conf: network: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: capabilities: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:12:01 +0000 (21:12 +0200)] 
conf: capabilities: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoconf: domain: use g_new0
Ján Tomko [Wed, 7 Oct 2020 19:11:43 +0000 (21:11 +0200)] 
conf: domain: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoschema: Make element "topology" in host CPU definition optional
Tim Wiederhake [Wed, 7 Oct 2020 08:54:54 +0000 (10:54 +0200)] 
schema: Make element "topology" in host CPU definition optional

This element is not always present, see e.g.
x86_64-cpuid-Xeon-X5460-host.xml, x86_64-cpuid-Pentium-P6100-host.xml,
or x86_64-cpuid-EPYC-7601-32-Core-ibpb-host.xml.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agospec: Install all schemas
Jiri Denemark [Thu, 8 Oct 2020 06:16:20 +0000 (08:16 +0200)] 
spec: Install all schemas

The main spec file was missing basictypes.rng and mingw did not install
cpu.rng. Let's just install all *.rng files in the schemas directory.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agocpu_map: Remove monitor feature from EPYC-Rome
Jiri Denemark [Wed, 7 Oct 2020 21:15:23 +0000 (23:15 +0200)] 
cpu_map: Remove monitor feature from EPYC-Rome

The feature is filtered by KVM and never automatically enabled. So even
though QEMU definition of EPYC-Rome contains this feature, the guest
won't see it. Also domain capabilities will show it as disabled for KVM
domains. Thus the feature should not really be included in our
definition of EPYC-Rome.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agospec: Add cpu.rng to %files
Cole Robinson [Wed, 7 Oct 2020 20:31:04 +0000 (16:31 -0400)] 
spec: Add cpu.rng to %files

Fixes: 51v5d325240c645ea6c1a0902c695cf299410b1f90c
Signed-off-by: Cole Robinson <crobinso@redhat.com>
4 years agowireshark: Fix missing bool_t on macOS
Roman Bolshakov [Wed, 7 Oct 2020 12:20:34 +0000 (15:20 +0300)] 
wireshark: Fix missing bool_t on macOS

The header has to be explicitly added to pull definition of bool_t and a
few other types. Otherwise packet-libvirt.c can't be compiled.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agocputest: Update QEMU data for Ryzen 9 3900X
Jiri Denemark [Wed, 7 Oct 2020 15:35:15 +0000 (17:35 +0200)] 
cputest: Update QEMU data for Ryzen 9 3900X

The CPU should be identified as EPYC-Rome, but the QEMU binary used to
gather the original test data did not support this model. Let's update
the supported models to QEMU 5.1.0.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agocpu_map: Defined and enable EPYC-Rome model
Markus Schade [Thu, 1 Oct 2020 10:22:02 +0000 (12:22 +0200)] 
cpu_map: Defined and enable EPYC-Rome model

Signed-off-by: Markus Schade <markus.schade@hetzner.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoAdd testdata for AMD EPYC 7502
Markus Schade [Thu, 1 Oct 2020 10:22:01 +0000 (12:22 +0200)] 
Add testdata for AMD EPYC 7502

Signed-off-by: Markus Schade <markus.schade@hetzner.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agotests: Rename some test files in cputestdata
Tim Wiederhake [Wed, 7 Oct 2020 08:54:56 +0000 (10:54 +0200)] 
tests: Rename some test files in cputestdata

The files contained the "-invalid" marker in their filename, marking
them as test cases that are supposed to fail in the virschematest.
Unfortunately, the "-invalid" marker does not discriminate between
different tests the files might be used in.

A later patch will introduce a new test validating the XML. This
test is not supposed to fail, as the files contain valid XML.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirsh: Add "validate" argument to [hypervisor-]cpu-compare
Tim Wiederhake [Wed, 7 Oct 2020 08:54:58 +0000 (10:54 +0200)] 
virsh: Add "validate" argument to [hypervisor-]cpu-compare

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agocpu: Wire in XML validation
Tim Wiederhake [Wed, 7 Oct 2020 08:54:55 +0000 (10:54 +0200)] 
cpu: Wire in XML validation

This adds a new value to virConnectCompareCPUFlags,
"VIR_CONNECT_CPU_VALIDATE_XML", that governs XML document validation in
virCPUDefParseXML.

In src/conf/cpu_conf.c, include configmake.h for PKGDATADIR and
virfile.h for virFileFindResource.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: Allow validation for single XML node
Tim Wiederhake [Wed, 30 Sep 2020 11:55:02 +0000 (13:55 +0200)] 
util: Allow validation for single XML node

Validation is usually performed on an entire document. If we are only
interested in validating a single nested node that can occur in
different contexts, this would require writing different schemas for
any of those different contexts.

By temporarily replacing the document's root node, we can validate the
relevant node only.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoschema: Add schema for guest or host cpu definition
Tim Wiederhake [Wed, 30 Sep 2020 11:55:01 +0000 (13:55 +0200)] 
schema: Add schema for guest or host cpu definition

`virsh cpu-compare` and `virsh hypervisor-cpu-compare` both accept
guest and host cpu definitions. This schema is able to validate both
possibilities.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoschema: Move guest cpu definition to cputypes.rng
Tim Wiederhake [Wed, 30 Sep 2020 11:55:00 +0000 (13:55 +0200)] 
schema: Move guest cpu definition to cputypes.rng

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoschema: Move host cpu definition to cputypes.rng
Tim Wiederhake [Wed, 30 Sep 2020 11:54:59 +0000 (13:54 +0200)] 
schema: Move host cpu definition to cputypes.rng

This also inlines the defintions for "cpufeature", "cpuspec",
"featureName" and "pagesHost", as "cpu" was the only user.

Doing so avoids a naming collision when cputypes.rng is included in
other schemas in a later patch.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoschema: Unify apostrophe and quotation mark usage
Tim Wiederhake [Wed, 30 Sep 2020 11:54:58 +0000 (13:54 +0200)] 
schema: Unify apostrophe and quotation mark usage

Quotation marks were used ~ 7000 times, apostrophes ~ 3000 times.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoexamples: fix storage volume size schema
Daniel P. Berrangé [Tue, 6 Oct 2020 09:21:49 +0000 (10:21 +0100)] 
examples: fix storage volume size schema

There is no such <storage> element, <capacity> and <allocation> exist at
the top level.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoFix incorrect g_new0 conversions
Ján Tomko [Tue, 6 Oct 2020 11:08:36 +0000 (13:08 +0200)] 
Fix incorrect g_new0 conversions

I left in a 'return' or 'goto cleanup' in a few places
where I did the conversion manually.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
4 years agoutil: o-z: use g_new0
Ján Tomko [Mon, 5 Oct 2020 17:13:12 +0000 (19:13 +0200)] 
util: o-z: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoutil: a-n: use g_new0
Ján Tomko [Mon, 5 Oct 2020 17:12:37 +0000 (19:12 +0200)] 
util: a-n: use g_new0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoutil: conf: use g_new0
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>
4 years agoutil: firewall: use g_new0
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>
4 years agoutil: systemd: use g_new0
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>
4 years agoutil: netdev: use g_new0
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>
4 years agoutil: command: use g_new0
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>
4 years agoutil: sysinfo: use g_new0
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>
4 years agoutil: storagefile: use g_new0
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>
4 years agoutil: resctrl: use g_new0
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>
4 years agoutil: split out VIR_ALLOC calls
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>
4 years agoutil: resctrl fix spacing in comment
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>
4 years agomailmap: consolidate my email addresses
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>
4 years agovirsh: network-port: remove pointless comment
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>
4 years agovirsh: delete vsh[CM]alloc
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>
4 years agovirsh: use g_new0 instead of vsh[CM]alloc
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>
4 years agovirsh: do not add bools into size calculations
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>
4 years agorpm: Enable Xen support on AArch64
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>
4 years agotests: cover disk, interface <backenddomain>
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>
4 years agocpu: Modify virCPUarmCompare to perform compare actions
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>
4 years agorpm: include aarch64 & riscv64 in systemtap 64-bit arch tapset rename
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>
4 years agoqemu: use g_new0
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>
4 years agoqemu: firmware: use g_new0
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>
4 years agoqemu: command: use g_new0
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>
4 years agoqemu: process: use g_new0
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>
4 years agoqemu: monitor: json: use g_new0
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>
4 years agoqemu: driver: use g_new0
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>
4 years agoqemu: domain: use g_new0
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>
4 years agoqemu: capabilities: use g_new0
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>
4 years agoqemu: separate out VIR_ALLOC calls
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>
4 years agoesx: switch esxUtil_ResolveHostname to return a new string
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>
4 years agoesx: call freeaddrinfo earlier in esxUtil_ResolveHostname
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>
4 years agoqemu: Taint cpu host-passthrough only after migration
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>
4 years agodocs: formatdomain: add spicevmc <redirdev> example
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>
4 years agodocs: formatdomain: fix net downscript 'since'
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>
4 years agodocs: formatdomain: fix incorrect 'Vsock' heading indent
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>
4 years agodocs: formatdomain: remove doubled filesystem <driver>
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>
4 years agoqemu: migration_cookie: s/VIR_FREE/g_free/
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>
4 years agoqemuMigrationCookieXMLParse: Avoid VIR_FREE when parsing lockstate
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>