]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agovirnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl
Michal Privoznik [Mon, 3 Jan 2022 15:24:58 +0000 (16:24 +0100)]
virnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl

As described in the previous commit, the units for 'burst' are
kibibytes and not kilobytes, i.e. multiples of 1024 not 1000.
Therefore, when constructing ovs-vsctl command the burst value
must be multiplied by 1024 and not just 1000. And because ovs
expects this size in bits the value has to be multiplied again by
8.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510237#c26
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: Clarify 'burst' units for QoS
Michal Privoznik [Mon, 3 Jan 2022 14:56:43 +0000 (15:56 +0100)]
docs: Clarify 'burst' units for QoS

The burst attribute for bandwidth specifies how much bytes can be
transmitted in a single burst. Therefore, the unit is in
multiples of 1024 (thus kibibytes) not SI-like 1000. It has
always been like that.

The 'tc' output is still confusing though, for instance:

  # tc class add dev $DEV parent 1: classid 1:1 htb rate 1000kbps burst 2097152
  # tc class show dev vnet2
  class htb 1:1 root rate 8Mbit ceil 8Mbit burst 2Mb cburst 1600b

Please note that 2097152 = 2*1024*1024. Even the man page is
confusing. From tc(8):

  kb or k        Kilobytes
  mb or m        Megabytes

But I guess this is because 'tc' predates IEC standardisation of
binary multiples and thus can't change without breaking scripts
parsing its output.

And while at it, adjust _virNetDevBandwidthRate struct member
description, to make it obvious which members use SI/IEC units.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodomain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()
Michal Privoznik [Tue, 14 Dec 2021 12:54:44 +0000 (13:54 +0100)]
domain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()

There are few places in virDomainDefFormatFeatures() which can
use virXMLFormatElement() or virXMLFormatElementEmpty() instead
of writing directly into the output buffer.

After this, there are still a lot of places left, but that is
much bigger task.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemuxml2xmloutdata: Turn kvm-features*.xml into symlinks
Michal Privoznik [Tue, 14 Dec 2021 11:28:34 +0000 (12:28 +0100)]
qemuxml2xmloutdata: Turn kvm-features*.xml into symlinks

There's no real difference between input and output XMLs for
kvm-features and kvm-features-off test cases. Do what we usually
do in such case - turn the output file into a symlink of the
input file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodocs: Move font definitions with other CSS files
Andrea Bolognani [Tue, 21 Dec 2021 15:21:35 +0000 (16:21 +0100)]
docs: Move font definitions with other CSS files

We have a subdirectory specifically for CSS files now, so it makes
sense to have the stylesheet that defines fonts to be there too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all CSS files to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 15:10:13 +0000 (16:10 +0100)]
docs: Move all CSS files to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all images to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 11:11:25 +0000 (12:11 +0100)]
docs: Move all images to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Drop structures.svg
Andrea Bolognani [Tue, 21 Dec 2021 11:13:39 +0000 (12:13 +0100)]
docs: Drop structures.svg

It was introduced in ff4ede005567 but it doesn't seem to have
ever actually been used anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agospec: Drop BuildRequires on xfsprogs-devel
Andrea Bolognani [Tue, 28 Dec 2021 17:11:32 +0000 (18:11 +0100)]
spec: Drop BuildRequires on xfsprogs-devel

We no longer need its contents.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agomeson: Don't look for btrfs and xfs headers
Andrea Bolognani [Tue, 28 Dec 2021 18:08:08 +0000 (19:08 +0100)]
meson: Don't look for btrfs and xfs headers

We no longer use them anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage: Use the FICLONE ioctl unconditionally on Linux
Andrea Bolognani [Tue, 28 Dec 2021 18:08:00 +0000 (19:08 +0100)]
storage: Use the FICLONE ioctl unconditionally on Linux

According to ioctl_ficlonerange(2)

  These ioctl operations [FICLONE and FICLONERANGE] first
  appeared in Linux 4.5. They were previously known as
  BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE, and were private
  to Btrfs.

We no longer target any distro that comes with a kernel older
than 4.5, so we can stop looking for the btrfs and xfs
specific versions of the constant and just use the generic
version directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agorpc: Require dtrace sources to be generated first
Michal Privoznik [Mon, 20 Dec 2021 11:02:41 +0000 (12:02 +0100)]
rpc: Require dtrace sources to be generated first

The virt_socket_lib is built from virnetsocket.c (among others).
But this file includes virprobe.h which includes libvirt_probes.h
which is a generated file. But this dependency is not recorded in
meson which may lead to a failed build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoconf: Make virDomainTPMDefFormat() return void
Michal Privoznik [Tue, 4 Jan 2022 07:57:47 +0000 (08:57 +0100)]
conf: Make virDomainTPMDefFormat() return void

The virDomainTPMDefFormat() function can't fail really. There's
no point in it returning an integer then. Make it return void and
fix both places which check for its retval.

And while at it, turn @def into a const pointer to make it
obvious the function does not modify passed struct.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2xmloutdata: Turn tpm-*.xml files into symlinks
Michal Privoznik [Tue, 4 Jan 2022 07:24:35 +0000 (08:24 +0100)]
qemuxml2xmloutdata: Turn tpm-*.xml files into symlinks

Make the tpm-*.xml files symlinks to their respective input XMLs
from qemuxml2argvdata/ directory. Neither of the XMLs relies on
autofill of any TPM data.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: Rework <tpm/> formatting
Michal Privoznik [Tue, 4 Jan 2022 07:24:25 +0000 (08:24 +0100)]
conf: Rework <tpm/> formatting

The <tpm/> element formatting is handled in
virDomainTPMDefFormat() which uses the "old style" - appending
strings directly into the output buffer. With this, it's easy to
get conditions that tell when an element has ended wrong. In this
particular case, if both <encryption/> and <active_pcr_banks/>
are to be formatted the current code puts a stray '>' into the
output buffer, resulting in invalid XML.

Rewrite the function to use virXMLFormatElement() which is more
clever.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2016599#c15
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2xmltest: Introduce tpm-emulator-spapr test
Michal Privoznik [Tue, 4 Jan 2022 07:38:37 +0000 (08:38 +0100)]
qemuxml2xmltest: Introduce tpm-emulator-spapr test

We already have the input xml because of xml2arg test. However,
the corresponding xml2xml test case is missing. Make the expected
XML a symlink to the input XML and clean the latter up a bit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: Extend TPM ABI stability check for <active_pcr_banks/>
Michal Privoznik [Tue, 4 Jan 2022 08:26:08 +0000 (09:26 +0100)]
conf: Extend TPM ABI stability check for <active_pcr_banks/>

Changing <active_pcr_banks/> means changing the guest ABI and as
such must be prevented on both restoring from a file or
migration.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2035888
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoci: Refresh configuration
Andrea Bolognani [Mon, 3 Jan 2022 15:48:18 +0000 (16:48 +0100)]
ci: Refresh configuration

Notable changes:

  * drop libdbus and radvd;
  * add codespell.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: Remove 'qemucapsfixreplies'
Peter Krempa [Wed, 22 Dec 2021 13:01:07 +0000 (14:01 +0100)]
tests: Remove 'qemucapsfixreplies'

The 'qemucapabilitiesnumbering' tool now replaces the role of this
script and provides way to programmatically modify the replies file on
top.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Tool for programatic modification of qemucapabilitiesdata/*.replies
Peter Krempa [Wed, 7 Apr 2021 14:53:20 +0000 (16:53 +0200)]
tests: Tool for programatic modification of qemucapabilitiesdata/*.replies

The tool is assembled from individual bits used for tests and actual
capturing of the replies files. The tool ensures correct numbering and
formatting of entries.

In normal usage mode it masks as a test which validates formatting and
numbering of the tests/qemucapabilitiesdata/*.replies files. This tool
was actually used to produce commits 096ac87a1a46 and aa21615ccbc.

In case a manual modification of the replies file is needed the
'modify()' function provides a convenient way to do programatic
modification of the caps file.

As an example the modify() function has commented-out code which
provides a basic scaffold to do modifications along with a how-to.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemumonitortestutils: Extract parser for the monitor conversation dump file
Peter Krempa [Tue, 21 Dec 2021 13:51:26 +0000 (14:51 +0100)]
qemumonitortestutils: Extract parser for the monitor conversation dump file

Make the parser reusable by extracting it and making it parse into
command,reply tuples.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemumonitortestutils.h: Reformat header file
Peter Krempa [Tue, 21 Dec 2021 14:10:45 +0000 (15:10 +0100)]
tests: qemumonitortestutils.h: Reformat header file

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: json: Introduce virJSONValueObjectReplaceValue
Peter Krempa [Mon, 20 Dec 2021 14:55:26 +0000 (15:55 +0100)]
util: json: Introduce virJSONValueObjectReplaceValue

The new helper replaces the 'value' part of the key-value tuple in an
object. The advantage of this new helper is that it preserves the
ordering of the key in the object when compared to a combination of
stealing the old key and adding a new value. This will be needed for a
new test/helper for validating and modifying qemu capabilities data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agomeson: Don't require the parted command at build time
Andrea Bolognani [Tue, 28 Dec 2021 10:47:56 +0000 (11:47 +0100)]
meson: Don't require the parted command at build time

We need libparted to be available at build time otherwise we
can't link against it; we don't, however, need the parted
command to be present until runtime and, just as is the case
for other commands, we already perform a lookup through the
virCommand API so making sure it's available at build time
is unnecessary.

This doesn't make any difference for platform such as Fedora
and CentOS, where both the library and the command are in the
same package, but others like Debian, Ubuntu and openSUSE
have separate packages for the two components and this change
means that we can install one less package at build time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agospec: Drop BuildRequires on ZFS
Andrea Bolognani [Tue, 28 Dec 2021 15:58:32 +0000 (16:58 +0100)]
spec: Drop BuildRequires on ZFS

We're no longer performing build time detection.

Fixes: 506c3a39d6e645c8414c278ceaba97935f90cb95
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()
Michal Privoznik [Tue, 21 Dec 2021 09:04:21 +0000 (10:04 +0100)]
virnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()

As encryption norms get more strict it's easy to fall on the
insecure side. For instance, so far we are generating 2048 bits
long prime for Diffie-Hellman keys. Some systems consider this
not long enough. While we may just keep increasing the value
passed to the corresponding gnutls_* function, that is not well
maintainable. Instead, we may do what's recommended in the
gnutls_* manpage. From gnutls_dh_params_generate2(3):

  It is recommended not to set the number of bits directly, but
  use gnutls_sec_param_to_pk_bits() instead.

Looking into the gnutls_sec_param_to_pk_bits() then [1], 2048
bits corresponds to parameter MEDIUM.

1: https://www.gnutls.org/manual/gnutls.html#tab_003akey_002dsizes

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirnettlscontext: Drop gnutls_dh_set_prime_bits()
Michal Privoznik [Tue, 21 Dec 2021 09:05:00 +0000 (10:05 +0100)]
virnettlscontext: Drop gnutls_dh_set_prime_bits()

According to the gnutls_dh_set_prime_bits() manpage:

  The function has no effect in server side.

Therefore, don't call it when creating server side context.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: virtimetest: Mention GLib version containing fix
Andrea Bolognani [Sat, 1 Jan 2022 18:50:21 +0000 (19:50 +0100)]
tests: virtimetest: Mention GLib version containing fix

We now know exactly which GLib version we need to depend on
for the workaround to no longer be necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: virtimetest: Skip more tests near year's end
Andrea Bolognani [Sat, 1 Jan 2022 18:39:40 +0000 (19:39 +0100)]
tests: virtimetest: Skip more tests near year's end

All of these are affected by the same issue as the ones that
we're already skipping during this specific time interval.

Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: virtimetest: Move comment
Andrea Bolognani [Sat, 1 Jan 2022 18:38:57 +0000 (19:38 +0100)]
tests: virtimetest: Move comment

Will keep things reasonable as we perform further code
movements.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agospec: Demote netcat to Recommends
Andrea Bolognani [Fri, 24 Dec 2021 09:56:04 +0000 (10:56 +0100)]
spec: Demote netcat to Recommends

It is only needed if compatibility with clients that have
libvirt < 6.9.0 is required, and can be uninstalled otherwise.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: Fix indentation in shell snippet
Andrea Bolognani [Fri, 24 Dec 2021 09:46:50 +0000 (10:46 +0100)]
docs: Fix indentation in shell snippet

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agospec: relocate pre script of daemon-driver-qemu
Olaf Hering [Tue, 21 Dec 2021 11:22:43 +0000 (12:22 +0100)]
spec: relocate pre script of daemon-driver-qemu

Reduce the delta in an upcoming change.
No change in behavior intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agospec: fix %preun of virtnetworkd
Olaf Hering [Tue, 21 Dec 2021 11:22:42 +0000 (12:22 +0100)]
spec: fix %preun of virtnetworkd

Fixes: 50eae3f8859c746aa474401b38902fa500f23fad
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agoci: Refresh dockerfiles
Peter Krempa [Wed, 22 Dec 2021 16:24:43 +0000 (17:24 +0100)]
ci: Refresh dockerfiles

Apart from some churn, the important is the removal of 'netcf-devel'
from the fedora rawhide container.

Update to state as of 174fe4999204afcae (libvirt-ci).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Fix typo in comment
Tim Wiederhake [Mon, 20 Dec 2021 12:02:59 +0000 (13:02 +0100)]
qemu: Fix typo in comment

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: virjson.h: Reformat headers to conform with new style
Peter Krempa [Mon, 20 Dec 2021 14:16:23 +0000 (15:16 +0100)]
util: virjson.h: Reformat headers to conform with new style

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Remove virJSONValueIsNull/virJSONValueObjectIsNull
Peter Krempa [Mon, 20 Dec 2021 14:17:40 +0000 (15:17 +0100)]
util: json: Remove virJSONValueIsNull/virJSONValueObjectIsNull

If needed 'virJSONValueIsNull' can be easily replaced by
'virJSONValueGetType(obj) == VIR_JSON_TYPE_NULL'.

'virJSONValueObjectIsNull' has confusing name because it checks that a
virJSONValue of OBJECT type has a key which is NULL, not that the object
itself is NULL. This can be replaced according to the needs e.g. by
virJSONValueObjectHasKey or the above check.

Both are unused.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Open-code only call of virJSONValueNewStringLen
Peter Krempa [Mon, 20 Dec 2021 13:56:13 +0000 (14:56 +0100)]
util: json: Open-code only call of virJSONValueNewStringLen

Replace the function by a call to virJSONValueNewString, when we copy
the string using g_strndup. Remove the unused helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Don't copy string in virJSONValueNewString
Peter Krempa [Mon, 20 Dec 2021 13:52:13 +0000 (14:52 +0100)]
util: json: Don't copy string in virJSONValueNewString

With 'g_strdup' not needing error handling we can ask callers to pass a
copy of the string which will be adopted by the JSON value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoReplace open coded virJSONValueArrayAppendString
Peter Krempa [Mon, 20 Dec 2021 13:41:03 +0000 (14:41 +0100)]
Replace open coded virJSONValueArrayAppendString

In two instances we've created a string virJSONValue just to append it
to the array. Replace it by use of the virJSONValueArrayAppendString
helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes
Peter Krempa [Mon, 20 Dec 2021 13:22:06 +0000 (14:22 +0100)]
qemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes

The auth mode array is static, parse it from a JSON string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuBlockStorageSourceCreateDetectSize: Propagate 'extended_l2' feature to new overlays
Peter Krempa [Thu, 16 Dec 2021 17:35:34 +0000 (18:35 +0100)]
qemuBlockStorageSourceCreateDetectSize: Propagate 'extended_l2' feature to new overlays

In cases where the qcow2 image is using subclusters/extended_l2 entries
we should propagate them to the new images which are based on such
images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: monitor: Extract whether qcow2 image uses extended L2 allocation data
Peter Krempa [Thu, 16 Dec 2021 10:00:55 +0000 (11:00 +0100)]
qemu: monitor: Extract whether qcow2 image uses extended L2 allocation data

In order to be able to propagate image configuration to newly formatted
images we need to be able to query it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBlockStorageSourceCreateGetFormatPropsQcow2: Add support for 'extended-l2' feature
Peter Krempa [Thu, 16 Dec 2021 11:46:51 +0000 (12:46 +0100)]
qemuBlockStorageSourceCreateGetFormatPropsQcow2: Add support for 'extended-l2' feature

Allow creating the qcow2 with the new subcluster format if required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage_file_probe: Add support for probing qcow2's incompatible features
Peter Krempa [Fri, 17 Dec 2021 09:21:04 +0000 (10:21 +0100)]
storage_file_probe: Add support for probing qcow2's incompatible features

Add machinery for probing the incompatible feature flags field and
specifically extract whether the extended l2 feature (1 << 4) is
present.

For now we don't care abot the other features.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqcow2GetFeatures: Extract population of features bitmap
Peter Krempa [Fri, 17 Dec 2021 09:09:14 +0000 (10:09 +0100)]
qcow2GetFeatures: Extract population of features bitmap

Prepare for extraction of features from the 'incompatible features'
group.

This is done by moving the extraction loop into a new function called
qcow2GetFeaturesProcessGroup. The new function also allows to ingore
features we don't care about by passing VIR_STORAGE_FILE_FEATURE_LAST as
the target flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage: Introduce 'extended_l2' feature for storage volume
Peter Krempa [Tue, 14 Dec 2021 15:05:09 +0000 (16:05 +0100)]
storage: Introduce 'extended_l2' feature for storage volume

QCOW2 images now support 'extended_l2' which splits the default clusters
into 32 subcluster allocation units. This allows the allocation units to
be smaller without increasing the size of L2 table too much and thus also
the cache requirements for holding the full L2 table in memory.

Unfortunately it's incompatible with qemu versions older than 5.2 thus
can't be used as default.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: formatstorage: Convert to RST
Peter Krempa [Tue, 14 Dec 2021 14:35:41 +0000 (15:35 +0100)]
docs: formatstorage: Convert to RST

Apart from the bulk conversion itself, the section names 'general
metadata' and 'target elements' were duplicated between the storage pool
and storage volume sections. To prevent heading name clashes they were
renamed appropriately.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Remove dependency on external resources
Andrea Bolognani [Thu, 9 Dec 2021 14:27:35 +0000 (15:27 +0100)]
docs: Remove dependency on external resources

The internals/eventloop document uses two images for
illustrative purposes, but unlike other graphics included
in the documentation these are not part of libvirt.git but
rather were added to libvirt-media.git with

  commit fae5622074cf5e18d190496f8a43260c614599b2
  Author: Michal Privoznik <mprivozn@redhat.com>
  Date:   Mon Jun 6 17:27:50 2016 +0200

    Add two event loop images

    These images are going to be used in our documentation of the
    event loop.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
  https://gitlab.com/libvirt/libvirt-media/-/commit/fae5622074cf5e18d190496f8a43260c614599b2

and are requested directly from there. Specifically, the
URLs point to the libvirt.org mirror of libvirt-media.git
instead of the primary repository hosted on GitLab.

Import the images into libvirt.git so that the website
doesn't rely on external resources and can, if desired, be
browsed entirely offline from installed packages.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoTranslated using Weblate (Japanese)
Yasuhiko Kamata [Sat, 18 Dec 2021 10:16:25 +0000 (11:16 +0100)]
Translated using Weblate (Japanese)

Currently translated at 49.7% (5198 of 10439 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ja/

Co-authored-by: Yasuhiko Kamata <belphegor@belbel.or.jp>
Signed-off-by: Yasuhiko Kamata <belphegor@belbel.or.jp>
3 years agovirt-host-validate: Fix IOMMU output on S390
Boris Fiuczynski [Fri, 17 Dec 2021 15:20:37 +0000 (16:20 +0100)]
virt-host-validate: Fix IOMMU output on S390

Commit 93e9e92c1e eliminated the option for skipping but left code in
the s390 check which makes use of a skip. This leads to an output
without result destroying the correct format. e.g.

  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         :   QEMU: Checking for secure guest support                                    : PASS

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuGetSEVInfoToParams: Reformat to standard coding style
Peter Krempa [Thu, 16 Dec 2021 17:24:58 +0000 (18:24 +0100)]
qemuGetSEVInfoToParams: Reformat to standard coding style

The function was formatted weirdly which prompted additions to conform
to the unusual style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agovsh-table: Ensure NULL terminated arguments to vshTable*()
Michal Privoznik [Tue, 14 Dec 2021 14:26:47 +0000 (15:26 +0100)]
vsh-table: Ensure NULL terminated arguments to vshTable*()

There are two functions that take variable arguments:
vshTableNew() and vshTableRowAppend(). Both expect the list of
arguments to be NULL terminated. Annotate them with
G_GNUC_NULL_TERMINATED to enable compile time check for this.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh-table.h: Modernize declarations
Michal Privoznik [Wed, 15 Dec 2021 09:37:25 +0000 (10:37 +0100)]
vsh-table.h: Modernize declarations

Use modern style of function declarations where the return type
and function name are on two separate lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh-table: Hide vshTableRow typedef
Michal Privoznik [Wed, 15 Dec 2021 09:35:50 +0000 (10:35 +0100)]
vsh-table: Hide vshTableRow typedef

There's no need for any caller to know vshTableRow typedef.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovshtabletest: Fix potential memleak
Michal Privoznik [Wed, 15 Dec 2021 09:23:15 +0000 (10:23 +0100)]
vshtabletest: Fix potential memleak

In testVshTableNew() we test whether vshTableNew(NULL) allocates
a table. This is expected to fail (and return NULL), because
passing nothing but NULL to vshTableNew() is viewed as error.
Nevertheless, if vshTableNew() did not fail and returned an
allocated table it would be leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: Document recent numatune change
Michal Privoznik [Thu, 16 Dec 2021 15:36:47 +0000 (16:36 +0100)]
NEWS: Document recent numatune change

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu_command: do use host-nodes for system memory
Michal Privoznik [Wed, 15 Dec 2021 15:46:27 +0000 (16:46 +0100)]
qemu_command: do use host-nodes for system memory

After previous commit, it's no longer possible to change nodeset
for strict numatune. Therefore, we can start generating
host-nodes onto command line again.

This partially reverts d73265af6ec41104c20633b5c0a23688a62105e6.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Explicitly forbid live changing nodeset for strict numatune
Michal Privoznik [Wed, 15 Dec 2021 13:20:21 +0000 (14:20 +0100)]
qemu: Explicitly forbid live changing nodeset for strict numatune

Let's imagine a guest that's configured with strict numatune:

  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>

For guests with NUMA:
Depending on machine type used (see commit v6.4.0-rc1~75) we
generate either:

  1) -object '{"qom-type":"memory-backend-ram","id":"ram-node0",\
               "size":20971520,"host-nodes":[0],"policy":"preferred"}' \
     -numa node,nodeid=0,cpus=0,memdev=ram-node0

or

  2) -numa node,nodeid=0,cpus=0,mem=20480

Later, when QEMU boots up and cpuset CGroup controller is
available we further restrict QEMU there too. But there's a
behaviour difference hidden: while in case 1) QEMU is restricted
from beginning, in case 2) it is not and thus it may happen that
it will allocate memory from different NUMA node and even though
CGroup will try to migrate it, it may fail to do so (e.g. because
memory is locked). Therefore, one can argue that case 2) is
broken. NB, case 2) is exactly what mode 'restrictive' is for.
However, in case 1) we are unable to update QEMU with new
host-nodes, simply because it's lacking a command to do so.

For guests without NUMA:
It's very close to case 2) from above. We have commit
v7.10.0-rc1~163 that prevents us from outputting host-nodes when
generating memory-backend-* for system memory, but that simply
allows QEMU to allocate memory anywhere and then relies on
CGroups to move it to desired location.

Due to all of this, there is no reliable way to change nodeset
for mode 'strict'. Let's forbid it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive()
Michal Privoznik [Wed, 15 Dec 2021 15:11:28 +0000 (16:11 +0100)]
qemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive()

The whole idea of VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE is that the
memory location is restricted only via CGroups and thus can be
changed on the fly (which is exactly what
qemuDomainSetNumaParamsLive() does. Allow this mode there then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agovirsh-completer: Provide completer for numatune --mode
Michal Privoznik [Thu, 16 Dec 2021 14:46:31 +0000 (15:46 +0100)]
virsh-completer: Provide completer for numatune --mode

The completer is trivial, just iterate over
virDomainNumatuneMemMode enum and convert each integer into its
string comrade.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agomanpages: Document 'restrictive' mode for numatune
Michal Privoznik [Thu, 16 Dec 2021 14:49:03 +0000 (15:49 +0100)]
manpages: Document 'restrictive' mode for numatune

While we document possibility of passing an integer from
virDomainNumatuneMemMode enum, we list string variants to only
the first three enum members. The fourth (and so far the last)
member is called 'restrictive' and thus should be documented.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemucapabilitiesdata: Fix command name in caps_3.0.0.ppc64.replies
Michal Privoznik [Fri, 17 Dec 2021 08:29:38 +0000 (09:29 +0100)]
qemucapabilitiesdata: Fix command name in caps_3.0.0.ppc64.replies

Under the qemucapabilitiesdata we have a replies file for
QEMU-3.0.0.ppc64. At least we think so. In fact, the file
contains replies from a development snapshot release that
predates 3.0.0 (specifically it's v2.12.0-1689-g518d23a) and as
such does not reflect any change that was made to QEMU after the
snapshot and before the official relase. One of such changes was
renaming 'exit-preconfig' command to 'x-exit-preconfig' (QEMU
commit v3.0.0-rc1~21^2~3). Ideally, we would just regenerate
capabilities using the official release but since this is a PPC64
machine and pretty old version anyway let's just fix the command
name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: format sev-guest.kernel-hashes property
Daniel P. Berrangé [Thu, 9 Dec 2021 14:57:05 +0000 (09:57 -0500)]
qemu: format sev-guest.kernel-hashes property

Set the kernel-hashes property on the sev-guest object if the config
asked for it explicitly. While QEMU machine types currently default to
having this setting off, it is not guaranteed to remain this way.

We can't assume that the QEMU capabilities were generated on an AMD host
with SEV, so we must force set the QEMU_CAPS_SEV_GUEST. This also means
that the 'sev' info in the qemuCaps struct might be NULL, but this is
harmless from POV of testing the CLI generator.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotests: allow setting extra capabilities on top of versioned caps
Daniel P. Berrangé [Thu, 9 Dec 2021 14:57:05 +0000 (09:57 -0500)]
tests: allow setting extra capabilities on top of versioned caps

In the QEMU tests a test can either use an explicitly listed set of
capabilities, or can request those matching a particular QEMU
version. Sometimes it is desirable to be able to list extra caps
on top of those implied by a particular version.

This is useful, for example, when QEMU won't report certain features
unless it was run on particular hardware or kernels, and those were
not used when a caps snapshot was imported to the libvirt source tree.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: probe for sev-guest.kernel-hashes property
Daniel P. Berrangé [Thu, 9 Dec 2021 14:39:22 +0000 (09:39 -0500)]
qemu: probe for sev-guest.kernel-hashes property

This sev-guest object property indicates whether QEMU should
expose the kernel, ramdisk, cmdline hashes to the firmware
for measurement.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoconf: add support for setting SEV kernel hashes
Daniel P. Berrangé [Thu, 9 Dec 2021 10:21:04 +0000 (05:21 -0500)]
conf: add support for setting SEV kernel hashes

Normally the SEV measurement only covers the firmware
loader contents. When doing a direct kernel boot, however,
with new enough OVMF it is possible to ask for the
measurement to cover the kernel, ramdisk and command line.

It can't be done automatically as that would break existing
guests using direct kernel boot with old firmware, so there
is a new XML setting allowing this behaviour to be toggled.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: validate VNC password length
Daniel P. Berrangé [Thu, 16 Dec 2021 10:20:37 +0000 (10:20 +0000)]
qemu: validate VNC password length

The VNC password authentication scheme is quite horrendous in that it
takes the user password and directly uses it as a DES case. DES is a
byte 8 keyed cipher, so the VNC password can never be more than 8
characters long. Anything over that length will be silently dropped.

We should validate this length restriction when accepting user XML
configs and report an error. For the global VNC password we don't
really want to break daemon startup by reporting an error, but
logging a warning is worthwhile.

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

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: qemu_command: clean up includes
Ján Tomko [Wed, 15 Dec 2021 14:53:27 +0000 (15:53 +0100)]
qemu: qemu_command: clean up includes

Over time, the code using them got split into other files.
(Mostly qemu_interface.c and qemu_process.c)

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
3 years agoqemuxml2argvtest: disk-missing-target: Add two disks with same bus
Peter Krempa [Thu, 16 Dec 2021 13:07:48 +0000 (14:07 +0100)]
qemuxml2argvtest: disk-missing-target: Add two disks with same bus

A recent code movement introduced a bug which reproduces only when there
are two disks on the same bus missing the target. Improve the test case
for the missing target test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainDiskInsert: Don't access NULL disk target
Peter Krempa [Thu, 16 Dec 2021 13:14:43 +0000 (14:14 +0100)]
virDomainDiskInsert: Don't access NULL disk target

'virDomainDiskInsert' orders the inserted disks by target. If the target
is not provided though it would try to parse it anyways. This lead to a
crash when parsing a definition where there are multiple disks and of
two disks sharing the bus at least one also misses the target.

Since we want to actually use the parser for stuff which doesn't
necessarily need the disk target, we make virDomainDiskInsert tolerant
of missing target instead. The definition will be rejected by the
validator regardless of the order the disks were inserted in.

Fixes: 61fd7174
Closes: https://gitlab.com/libvirt/libvirt/-/issues/257
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agorpm: don't start/stop -ro.socket units for virtlockd/virtlogd
Daniel P. Berrangé [Tue, 14 Dec 2021 16:21:44 +0000 (16:21 +0000)]
rpm: don't start/stop -ro.socket units for virtlockd/virtlogd

These daemons do not have any support for unprivileged readonly
access, so we must not reference -ro.socket units in scripts.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpm: fix typo in daemon name in %post/%preun scripts
Daniel P. Berrangé [Tue, 14 Dec 2021 16:17:10 +0000 (16:17 +0000)]
rpm: fix typo in daemon name in %post/%preun scripts

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: fix missing cleanup on error in qemuSaveImageStartVM
Ani Sinha [Wed, 15 Dec 2021 13:07:21 +0000 (18:37 +0530)]
qemu: fix missing cleanup on error in qemuSaveImageStartVM

Commit 52521de8332c2323bd ("qemu: Use qemuDomainSaveStatus") replaced a call
to virDomainObjSave() with qemuDomainSaveStatus() as a part of cleanup. Since
qemuDomainSaveStatus() does not indicate any failure through its return code,
the error handling cleanup code got eliminated in the process. Thus upon
failure, we will no longer killing the started qemu process. This commit fixes
this by reverting the change that was introduced with the above commit.

Fixes: 52521de8332c2323bd ("qemu: Use qemuDomainSaveStatus")
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoqemucapstest: Update qemu capabilities probe dump for qemu-6.2 release
Peter Krempa [Fri, 26 Nov 2021 09:25:09 +0000 (10:25 +0100)]
qemucapstest: Update qemu capabilities probe dump for qemu-6.2 release

qemu-6.2 is out, update the caps dump for the final time.

Notable changes:
- 'unstable' feature flag for various QMP schema entries
- 'aio-max-batch' iothread property
- 'kernel-hashes' knob for the 'sev-guest' object
- 'native-hotplug' of 'pcie-root-port' is now unstable again
- 'page-sampling/dirty-ring/dirty-bitmap' mode for 'calc-dirty-rate'
- 'toolsversion' field for the 'vmdk' disk format driver
- CPU changes resulting in 'core-capability' being present on the cpu
  of the machine this dump was done on

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonetwork: remove unused 'driver' parameter
Ján Tomko [Tue, 14 Dec 2021 18:47:56 +0000 (19:47 +0100)]
network: remove unused 'driver' parameter

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: dnsmasq: remove caps completely
Ján Tomko [Tue, 14 Dec 2021 18:45:14 +0000 (19:45 +0100)]
util: dnsmasq: remove caps completely

Now that we only check whether the dnsmasq version is new enough,
there is no need for the caps field.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: remove dnsmasqCapsGetVersion
Ján Tomko [Tue, 14 Dec 2021 18:41:26 +0000 (19:41 +0100)]
util: remove dnsmasqCapsGetVersion

It has no callers anymore.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agospec: do not require radvd
Ján Tomko [Tue, 14 Dec 2021 18:31:32 +0000 (19:31 +0100)]
spec: do not require radvd

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agobuild: do not search for radvd binary
Ján Tomko [Tue, 14 Dec 2021 18:31:15 +0000 (19:31 +0100)]
build: do not search for radvd binary

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoconf: remove radvdPid from virNetworkObj
Ján Tomko [Tue, 14 Dec 2021 18:30:16 +0000 (19:30 +0100)]
conf: remove radvdPid from virNetworkObj

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: driver: remove unused radvdStateDir variable
Ján Tomko [Tue, 14 Dec 2021 18:28:19 +0000 (19:28 +0100)]
network: driver: remove unused radvdStateDir variable

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: remove any code dealing with radvd
Ján Tomko [Tue, 14 Dec 2021 18:26:38 +0000 (19:26 +0100)]
network: remove any code dealing with radvd

Since dnsmasq supports --ra-param for a long time, this code is now
unused.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: dnsmasq: delete assumed capability flags
Ján Tomko [Tue, 14 Dec 2021 18:40:41 +0000 (19:40 +0100)]
util: dnsmasq: delete assumed capability flags

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: assume DNSMASQ_CAPS_RA_PARAM
Ján Tomko [Tue, 14 Dec 2021 16:59:09 +0000 (17:59 +0100)]
network: assume DNSMASQ_CAPS_RA_PARAM

Introduced by dnsmasq commit:
commit c4cd95df68b573b63d234ecdb675228657d65353
Author:     Simon Kelley <simon@thekelleys.org.uk>
CommitDate: 2013-10-10 20:58:11 +0100

    Add --ra-param and remove --force-fast-ra

git describe: v2.67rc3-3-gc4cd95d contains: v2.67rc4~12

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: assume DNSMASQ_CAPS_BIND_DYNAMIC
Ján Tomko [Tue, 14 Dec 2021 16:57:45 +0000 (17:57 +0100)]
network: assume DNSMASQ_CAPS_BIND_DYNAMIC

Introduced by dnsmasq commit:
commit 54dd393f3938fc0c19088fbd319b95e37d81a2b0
CommitDate: 2012-06-20 11:23:38 +0100

    Add --bind-dynamic

git describe: v2.63test1 contains: v2.63test1^0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: remove DNSMASQ_RA_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:55:42 +0000 (17:55 +0100)]
util: remove DNSMASQ_RA_SUPPORT

Now that the macro is unused, delete it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: assume DNSMASQ_RA_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:54:44 +0000 (17:54 +0100)]
network: assume DNSMASQ_RA_SUPPORT

Delete the code that is only run without the capability.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agonetwork: assume DNSMASQ_DHCPv6_SUPPORT
Ján Tomko [Tue, 14 Dec 2021 16:46:24 +0000 (17:46 +0100)]
network: assume DNSMASQ_DHCPv6_SUPPORT

Remove the (now unreachable) error message and the macro.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: dnsmasq: mandate at least version 2.67
Ján Tomko [Tue, 14 Dec 2021 16:36:23 +0000 (17:36 +0100)]
util: dnsmasq: mandate at least version 2.67

All the capabilities should be supported in 2.67.
Make this the minimum version, since even the oldest
distros we support have moved on:

Debian 8: 2.72
CentOS 7: 2.76
Ubuntu 18.04: 2.79

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: do not test dnsmasq older than 2.67
Ján Tomko [Tue, 14 Dec 2021 18:10:29 +0000 (19:10 +0100)]
tests: do not test dnsmasq older than 2.67

Prepare to retire older versions by droping older tests.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: dnsmasqCapsSetFromBuffer: use error label
Ján Tomko [Tue, 14 Dec 2021 16:35:07 +0000 (17:35 +0100)]
util: dnsmasqCapsSetFromBuffer: use error label

Rename 'fail' to 'error' to match the prevalent usage.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agomeson: Detect XDR only when needed
Michal Privoznik [Wed, 8 Dec 2021 08:32:55 +0000 (09:32 +0100)]
meson: Detect XDR only when needed

If remote driver was disabled there is no need to check whether
host has a XDR library installed.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/196
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agomeson: Require XDR for wireshark
Michal Privoznik [Wed, 8 Dec 2021 12:12:17 +0000 (13:12 +0100)]
meson: Require XDR for wireshark

The way our wireshark dissector works is by providing decoders
for primitive types (like integers, string, double, etc.) and
then parsing virsomethingprotocol.x files and generating complex
decoders for RPC. This obviously means that XDR is required for
the dissector, but corresponding check was missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoadmin: Build only when RPC is available
Michal Privoznik [Wed, 8 Dec 2021 11:16:28 +0000 (12:16 +0100)]
admin: Build only when RPC is available

The admin module is very closely tied to RPC. If we are
building without RPC support there's not much use for the
admin module, in fact it fails to build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agologging: Build log manager only when RPC is available
Michal Privoznik [Wed, 8 Dec 2021 11:14:44 +0000 (12:14 +0100)]
logging: Build log manager only when RPC is available

The logging manager is very closely tied to RPC. If we are
building without RPC support there's not much use for the
manager, in fact it fails to build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agorpc: Build only when XDR is available
Michal Privoznik [Wed, 8 Dec 2021 11:26:10 +0000 (12:26 +0100)]
rpc: Build only when XDR is available

Our RPC layer is as tied to XDR as possible. Therefore, if we
haven't detected and XDR library there's not much sense in trying
to build RPC layer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agorpc: Separate out socket code into another static lib
Michal Privoznik [Wed, 8 Dec 2021 11:25:30 +0000 (12:25 +0100)]
rpc: Separate out socket code into another static lib

There's nothing RPC specific about virnettlscontext.c or
virnetsocket.c. We use TLS for other things than just RPC
encryption (e.g. for generating random numbers) and sockets can
be used even without RPC.

Move these two sources into a static library (virt_socket) so
that other areas can use it even when RPC is disabled.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibvirt-stream: Don't require RPC module
Michal Privoznik [Wed, 8 Dec 2021 11:12:27 +0000 (12:12 +0100)]
libvirt-stream: Don't require RPC module

When implementing sparse streams, one of improvements I did was
to increase client buffer size for sending/receiving stream data
(commit v1.3.5-rc1~502). Previously, we were using 64KiB buffer
while packets on RPC are 256KiB (usable data is slightly less
because of the header). This meant that it took multiple calls of
virStreamRecv()/virStreamSend() to serve a single packet of data.
In my fix, I've included the virnetprotocol.h file which provides
VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX macro which is the exact size
of data in a single packet. However, including the file from
libvirt-stream.c which implements public APIs is not right. If
RPC module is not built then the file doesn't exists.

Redefine the macro and drop the include. The size can never
change anyways.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>