]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agoqemuDomainSupportsVideoVga: Fix const correctness
Michal Privoznik [Fri, 11 Jun 2021 11:24:14 +0000 (13:24 +0200)] 
qemuDomainSupportsVideoVga: Fix const correctness

This function doesn't modify passed video definition. Make the
argument const.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agotests: Tests for virtio-vga-gl and virtio-gpu-gl-pci device
Han Han [Wed, 9 Jun 2021 08:32:27 +0000 (16:32 +0800)] 
tests: Tests for virtio-vga-gl and virtio-gpu-gl-pci device

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Adapt to virtio-vga-gl device
Han Han [Wed, 9 Jun 2021 08:32:26 +0000 (16:32 +0800)] 
qemu: Adapt to virtio-vga-gl device

QEMU 6.1 will replace the virgl property of virtio-vga device to
virtio-vga-gl device. Adapt to that update.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/167

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Adapt to virtio-gpu-gl-pci device
Han Han [Wed, 9 Jun 2021 08:32:25 +0000 (16:32 +0800)] 
qemu: Adapt to virtio-gpu-gl-pci device

QEMU 6.1 will add virtio-gpu-gl-pci device to replace the virgl property
of virtio-gpu-pci device. Adapt to that change.

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

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu_validate: Validate virtio*gl* devices for 3d accerlation
Han Han [Wed, 9 Jun 2021 08:32:24 +0000 (16:32 +0800)] 
qemu_validate: Validate virtio*gl* devices for 3d accerlation

The devices virtio-gpu-gl-pci and virtio-vga-gl, aimed to replace the
virgl property, are valid for 3d accerlation as well.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu_capabilities: Add QEMU_CAPS_VIRTIO_VGA_GL
Han Han [Wed, 9 Jun 2021 08:32:23 +0000 (16:32 +0800)] 
qemu_capabilities: Add QEMU_CAPS_VIRTIO_VGA_GL

It will be used for virtio-vga-gl device later.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu_capabilities: Add QEMU_CAPS_VIRTIO_GPU_GL_PCI
Han Han [Wed, 9 Jun 2021 08:32:22 +0000 (16:32 +0800)] 
qemu_capabilities: Add QEMU_CAPS_VIRTIO_GPU_GL_PCI

This flag will be used for the device virtio-gpu-gl-pci which is introduced
since QEMU 6.1.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agocpu_map: Add cpu feature avx-vnni
Tim Wiederhake [Thu, 10 Jun 2021 07:45:41 +0000 (09:45 +0200)] 
cpu_map: Add cpu feature avx-vnni

"avx-vvni" was introduced to qemu in commit
c1826ea6a052084f2e6a0bae9dd5932a727df039, adding it Cooperlake.

This feature is currently not used by any libvirt CPU models, but its
addition silences a warning from sync_qemu_i386.py:

```
warning: Unknown feature 'CPUID_7_1_EAX_AVX_VNNI'
warning: Feature unknown to libvirt: CPUID_7_1_EAX_AVX_VNNI
```

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoopenvswitch: don't delete existing OVS port prior to recreating same port
Laine Stump [Mon, 7 Jun 2021 20:27:49 +0000 (16:27 -0400)] 
openvswitch: don't delete existing OVS port prior to recreating same port

Connecting a tap device to an Open vSwitch is done by adding a "port"
to the switch with the ovs-vsctl "add-port" command. The port will
have the same name as the tap device, but it is a separate entity, and
can survive beyond the destruction of the tap device (although under
normal circumstances the port will be deleted around the same time the
tap device is deleted).

This makes it possible for a port of a particular name to already
exist at the time libvirt calls ovs-vsctl to add that port. The
original commit of Open vSwitch support (commit df81004632, libvirt
0.9.10, Feb. 2012) used the "--may-exist" option to the add-port
command to indicate that a port of the desired name might already
exist, and that it was okay to simply re-use this port (rather than
failing with an error message).

Then in commit 33445ce8446d9 (libvirt 1.2.7, April 2014) the command
was changed to use "--if-exists del-port blah" instead of
"--may-exist". The reason given was that there was a bug in OVS where
a stale port would be unusable even though it still existed; the
workaround was to forcibly delete any existing port prior to adding
the new port (of the same name). This is the ovs-vsctl command still
in use by libvirt today.

It recently came up in the discussion of a bug concerning guest packet
loss during OpenStack upgrades (https://bugzilla.redhat.com/1963164)
that the bug in OVS that necessitated the del-port workaround was
fixed quite a long time ago (August 2015):

  https://github.com/openvswitch/ovs/commit/e21c6643a02c6b446d2fbdfde366ea303b4c2730

thus rendering the workaround in libvirt unnecessary. The assertion in
that discussion is that this workaround is now the cause of the packet
loss being experienced during OpenStack upgrades. I'm not convinced
this is the case, but it does appear that there is no reason to carry
this workaround in libvirt any longer, so this patch reverts the code
back to the original behavior (using "--may-exist" instead of
"--if-exists del-port").

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodomain_conf: Use virXMLFormatElement() more
Michal Privoznik [Thu, 3 Jun 2021 11:31:22 +0000 (13:31 +0200)] 
domain_conf: Use virXMLFormatElement() more

I've identified some places (mostly by looking for
virBufferUse()) that can use virXMLFormatElement() instead of
open coded version of it. I'm sure there are many more places
that could use the same treatment. Let's cure them some other
time.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: switch ci status page to use Go -module repos
Daniel P. Berrangé [Mon, 7 Jun 2021 13:49:14 +0000 (14:49 +0100)] 
docs: switch ci status page to use Go -module repos

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agocpu_map: sync_qemu_i386.py: Remove superfluous semicolon
Tim Wiederhake [Wed, 9 Jun 2021 11:04:29 +0000 (13:04 +0200)] 
cpu_map: sync_qemu_i386.py: Remove superfluous semicolon

The semicolon in question makes the pipeline fail over a style checker
complaint.

Introduced-in: 360b8eb2d2cb1b6a8c9a78fa2c5be31dd7c74487
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirt-host-validate: Fix IOMMU output on aarch64
Fabiano Fidêncio [Tue, 8 Jun 2021 20:16:42 +0000 (22:16 +0200)] 
virt-host-validate: Fix IOMMU output on aarch64

virt-host-validate should print "Checking for device assignment IOMMU
support" for all architectures, not only for Intel / AMD.

This is the output without the patch:
```
[fidencio@dentola libvirt]$ virt-host-validate
  QEMU: comprobando if device /dev/kvm exists                                   : PASA
  QEMU: comprobando if device /dev/kvm is accessible                            : PASA
  QEMU: comprobando if device /dev/vhost-net exists                             : PASA
  QEMU: comprobando if device /dev/net/tun exists                               : PASA
  QEMU: comprobando for cgroup 'cpu' controller support                         : PASA
  QEMU: comprobando for cgroup 'cpuacct' controller support                     : PASA
  QEMU: comprobando for cgroup 'cpuset' controller support                      : PASA
  QEMU: comprobando for cgroup 'memory' controller support                      : PASA
  QEMU: comprobando for cgroup 'devices' controller support                     : ADVERTENCIA (Enable 'devices' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: comprobando for cgroup 'blkio' controller support                       : PASA
ADVERTENCIA (Unknown if this platform has IOMMU support)
  QEMU: comprobando for secure guest support                                    : ADVERTENCIA (Unknown if this platform has Secure Guest support)

```

This is the output with the patch:
```
[fidencio@dentola libvirt]$ ./build/tools/virt-host-validate
  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                     : WARN (Enable 'devices' in kernel Kconfig file or mount/enable cgroup controller in your system)
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         : WARN (Unknown if this platform has IOMMU support)
  QEMU: Checking for secure guest support                                    : WARN (Unknown if this platform has Secure Guest support)
```

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agocpu_map: sync_qemu_i386.py: Allow begin mark to contain `const`
Tim Wiederhake [Mon, 7 Jun 2021 12:01:24 +0000 (14:01 +0200)] 
cpu_map: sync_qemu_i386.py: Allow begin mark to contain `const`

This was introduced in qemu commit
e11fd68996fb27c040552320f01a7d30a15a7cc1.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agocpu_map: sync_qemu_i386.py: Use regex to look for begin mark
Tim Wiederhake [Mon, 7 Jun 2021 12:01:23 +0000 (14:01 +0200)] 
cpu_map: sync_qemu_i386.py: Use regex to look for begin mark

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirCHDriverConfig: Drop @uri member
Michal Privoznik [Mon, 7 Jun 2021 13:32:34 +0000 (15:32 +0200)] 
virCHDriverConfig: Drop @uri member

This member is unused (apart from only being set in
virCHDriverConfigNew()), and never freed really (leading to a
memleak).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoch: set driver to NULL after freeing it
Daniel P. Berrangé [Fri, 4 Jun 2021 14:59:50 +0000 (15:59 +0100)] 
ch: set driver to NULL after freeing it

If the chStateInitialize method fails, we call chStateCleanup
which free's all global state. It fails to set the global
'ch_driver' to NULL, however, so a later attempt to open the
cloud hypervisor driver will succeed and then crash attempting
to access freed memory.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirHostValidateSecureGuests: Drop useless 'return 0' at the end
Michal Privoznik [Tue, 8 Jun 2021 07:39:33 +0000 (09:39 +0200)] 
virHostValidateSecureGuests: Drop useless 'return 0' at the end

Previous patches rendered 'return 0' at the end of the function a
dead code. Therefore, the code can be rearranged a bit and the
line can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
4 years agovirt-host-validate: Call VIR_HOST_VALIDATE_FAILURE() more frequently
Michal Privoznik [Tue, 8 Jun 2021 07:20:32 +0000 (09:20 +0200)] 
virt-host-validate: Call VIR_HOST_VALIDATE_FAILURE() more frequently

Ideally, every virHostMsgFail() would be coupled with
VIR_HOST_VALIDATE_FAILURE() so that the failure is correctly
propagated to the caller. However, in
virHostValidateSecureGuests() we are either ignoring @level and
returning 0 directly (no error), or not returning at all, relying
on 'return 0' at the end of the function. Neither of these help
propagate failure correctly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
4 years agovirt-host-validate: Turn failure to read /proc/cmdline into an error
Michal Privoznik [Tue, 8 Jun 2021 07:21:27 +0000 (09:21 +0200)] 
virt-host-validate: Turn failure to read /proc/cmdline into an error

When validating secure guests support on s390(x) we may read
/proc/cmdline and look for "prot_virt" argument. Reading the
kernel command line is done via virFileReadValueString() which
may fail. In such case caller won't see any error message. But we
can produce the same warning/error as if "prot_virt" argument
wasn't found.  Not only this lets users know about the problem,
it also terminates the "Checking for ...." line correctly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
4 years agovirt-host-validate: Report an error if failed to detect CGroups
Michal Privoznik [Tue, 8 Jun 2021 07:17:52 +0000 (09:17 +0200)] 
virt-host-validate: Report an error if failed to detect CGroups

As a part of its checks, virt-host-validate calls virCgroupNew()
to detect CGroup controllers which are then printed out. However,
virCgroupNew() can fail (with appropriate error message set).
Let's print an error onto stderr if that happens.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
4 years agovirt-host-validate: Initialize the error object
Michal Privoznik [Tue, 8 Jun 2021 06:53:14 +0000 (08:53 +0200)] 
virt-host-validate: Initialize the error object

Several libvirt functions are called from virt-host-validate.
Some of these functions do report an error on failure. But
reporting an error is coupled with freeing previous error (by
calling virResetError()). But we've never called
virErrorInitialize() and thus resetting error object frees some
random pointer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
4 years agostorage: Don't overwrite error in virISCSIDirectDisconnect()
Michal Privoznik [Wed, 2 Jun 2021 08:34:46 +0000 (10:34 +0200)] 
storage: Don't overwrite error in virISCSIDirectDisconnect()

The iscsi-direct storage pool backend works merely like this: a
connection is established to the target (usually done via
virStorageBackendISCSIDirectSetConnection()), intended action is
executed (e.g. reporting LUNs, volume wiping), and at the end the
connection is closed via virISCSIDirectDisconnect().

The problem is that virISCSIDirectDisconnect() reports its own
errors which may overwrite error that occurred during LUN
reporting, or volume wiping or whatever.

To fix this, use virErrorPreserveLast() + virErrorRestore()
combo, which either preserves previously reported error message,
or is NOP if there's no error reported.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1797879
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agolibxl: Support firmware autoselection
Jim Fehlig [Thu, 3 Jun 2021 20:04:30 +0000 (14:04 -0600)] 
libxl: Support firmware autoselection

Xen only supports one firmware, making autoselection easy to implement.
In fact, <os firmware='efi'> is probably preferable in the Xen driver,
where libxl supports a firmware setting with accepted values such as
bios, ovmf, uefi (currently same semantics as ovmf), seabios, etc.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolibxl: Forbid domain definition with secure boot enabled
Jim Fehlig [Wed, 2 Jun 2021 20:39:43 +0000 (14:39 -0600)] 
libxl: Forbid domain definition with secure boot enabled

Xen+ovmf does not support secure boot. Fail domain def validation
if secure boot is enabled.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolibxl: Introduce domain def validate callback
Jim Fehlig [Wed, 2 Jun 2021 20:04:35 +0000 (14:04 -0600)] 
libxl: Introduce domain def validate callback

Introduce libxlDomainDefValidate and move the existing validation
check from libxlDomainDefPostParse. Additional validation will be
introduced in subsequent patches.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoapparmor: Permit new capabilities required by libvirtd
Jim Fehlig [Mon, 7 Jun 2021 22:21:28 +0000 (16:21 -0600)] 
apparmor: Permit new capabilities required by libvirtd

The audit log contains the following denials from libvirtd

apparmor="DENIED" operation="capable" profile="libvirtd" pid=6012 comm="daemon-init" capability=17  capname="sys_rawio"
apparmor="DENIED" operation="capable" profile="libvirtd" pid=6012 comm="rpc-worker" capability=39  capname="bpf"
apparmor="DENIED" operation="capable" profile="libvirtd" pid=6012 comm="rpc-worker" capability=38  capname="perfmon"

Squelch the denials and allow the capabilities in the libvirtd
apparmor profile.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomeson.build: Compile with -Walloca
Thomas Huth [Thu, 27 May 2021 10:45:54 +0000 (12:45 +0200)] 
meson.build: Compile with -Walloca

We are already compiling libvirt with -Wvla - so it does not make
too much sense to still allow people to use alloca() instead. Thus
put it on the list of things we want to warn about. Fortunately,
there is currently no warning with this flag, so the current
sources should be clean.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agomeson.build: Remove the -Wvla-larger-then flag
Thomas Huth [Thu, 27 May 2021 10:37:36 +0000 (12:37 +0200)] 
meson.build: Remove the -Wvla-larger-then flag

The flag has a typo in it, it's "...-than=..." and not "...-then=...",
so this was in fact never used. Since we're also using -Wvla (without
size), we should already get warnings about any variable length arrays
anyway, so the additional "-Wvla-larger-than" does not make much sense
and thus we can simply drop this.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agotools: only fail validations if VIR_HOST_VALIDATE_FAIL is set
Fabiano Fidêncio [Mon, 7 Jun 2021 16:22:18 +0000 (18:22 +0200)] 
tools: only fail validations if VIR_HOST_VALIDATE_FAIL is set

Currently `virt-host-validate` will fail whenever one of its calls fail,
regardless of virHostValidateLevel set.

This behaviour is not optimal and makes it not exactly reliable as a
command line tool as other tools or scripts using it would have to check
its output to figure out whether something really failed or if a warning
was mistakenly treated as failure.

With this change, the behaviour of whether to fail or not, is defined by
the caller of those functions, based on the virHostValidateLevel passed
to them.

https://gitlab.com/libvirt/libvirt/-/issues/175

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: introduce stubs for new libvirt Go packages
Daniel P. Berrangé [Tue, 25 May 2021 10:42:32 +0000 (11:42 +0100)] 
docs: introduce stubs for new libvirt Go packages

Currently we expose libvirt Go packages at

  libvirt.org/libvirt-go
  libvirt.org/libvirt-go-xml

These packages have not supported Go modules historically and when we
tried to introduce modules, we hit the problem that we're not using
semver for versioning.

The only way around this is to introduce new packages under a different
namespace, that will have the exact same code, but be tagged with a
different version numbering scheme.

This change proposes:

  libvirt.org/go/libvirt
  libvirt.org/go/libvirtxml

Note the hyphen is removed so that the import basename matches the
Go package name.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: formatdomain: Document disk serial truncation status quo
Peter Krempa [Fri, 4 Jun 2021 12:08:40 +0000 (14:08 +0200)] 
docs: formatdomain: Document disk serial truncation status quo

Disk serials are truncated arbitrarily and silently by qemu depending on
the device type and how they are configured. Since changing the current
state would lead to more regressions than we have now, document that the
truncation is arbitrary.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: virtiofs: describe memfd memory backend
Stefan Hajnoczi [Mon, 7 Jun 2021 13:50:24 +0000 (14:50 +0100)] 
docs: virtiofs: describe memfd memory backend

Nowadays memfd is the most convenient memory backend for vhost-user
devices. Compared to file-backend memory and hugepages, there is no need
to worry about configuring the location of the shm directory or
allocating hugepages.

Cc: Michal Prívozník <mprivozn@redhat.com>
Cc: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Add coredump format completion to dump command
Lin Ma [Mon, 7 Jun 2021 03:14:18 +0000 (11:14 +0800)] 
virsh: Add coredump format completion to dump command

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh: Use VIR_ENUM_* for --format argument in doDump
Lin Ma [Mon, 7 Jun 2021 03:14:17 +0000 (11:14 +0800)] 
virsh: Use VIR_ENUM_* for --format argument in doDump

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: Small fixes for daemons.rst
Jim Fehlig [Fri, 4 Jun 2021 21:59:44 +0000 (15:59 -0600)] 
docs: Small fixes for daemons.rst

Remove some dupicate text and replace in incorrect occurance of
monolithic with modular.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoTranslated using Weblate (Korean)
simmon [Mon, 7 Jun 2021 08:46:26 +0000 (10:46 +0200)] 
Translated using Weblate (Korean)

Currently translated at 44.2% (4563 of 10314 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
4 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 7 Jun 2021 08:46:25 +0000 (10:46 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 27.6% (2855 of 10314 strings)

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

Translated using Weblate (Swedish)

Currently translated at 27.1% (2796 of 10314 strings)

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

Translated using Weblate (Swedish)

Currently translated at 26.9% (2777 of 10314 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
4 years agoremoteGetUNIXSocket: Complete variable rename for WIN32
Michal Privoznik [Sat, 5 Jun 2021 04:46:48 +0000 (06:46 +0200)] 
remoteGetUNIXSocket: Complete variable rename for WIN32

In fcdcf8f70cf the remoteGetUNIXSocket() function was changed and
one new variable was introduced (among other things): @env_name.
However, for WIN32 case the variable changed name to @env_path
which builds mingw builds.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirnetsocket: Mark @spawnDaemonPath of virNetSocketNewConnectUNIX() unused
Michal Privoznik [Sat, 5 Jun 2021 04:38:32 +0000 (06:38 +0200)] 
virnetsocket: Mark @spawnDaemonPath of virNetSocketNewConnectUNIX() unused

The virNetSocketNewConnectUNIX() function was changed in
48f66cfe3e. And its WIN32 version (which just reports an error)
was updated too, but this new argument @spawnDaemonPath was not
marked as unused.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodoRemoteOpen: Drop @daemonPath
Michal Privoznik [Sat, 5 Jun 2021 04:05:27 +0000 (06:05 +0200)] 
doRemoteOpen: Drop @daemonPath

The @daemonPath variable in doRemoteOpen() is no longer used
after faf8354674. Remove it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoch: set shared drivers
Wei Liu [Fri, 4 Jun 2021 14:50:52 +0000 (14:50 +0000)] 
ch: set shared drivers

We want to use those shared drivers provided by libvirt to avoid
implementing our own.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Wei Liu <liuwe@microsoft.com>
4 years agochExtractVersion: Drop @ret
Michal Privoznik [Fri, 4 Jun 2021 13:08:32 +0000 (15:08 +0200)] 
chExtractVersion: Drop @ret

After previous patches, the @ret variable and the 'cleanup'
label are redundant. Remove them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agochExtractVersion: use g_auto*
Michal Privoznik [Fri, 4 Jun 2021 13:06:34 +0000 (15:06 +0200)] 
chExtractVersion: use g_auto*

There are two variables that can be freed automatically: @cmd
(which allows us to drop explicit virCommandFree() call at the
end of the function) and @help which was never freed (and thus
leaked).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoch_driver: Don't error out if CH_CMD was not found
Michal Privoznik [Fri, 4 Jun 2021 12:55:04 +0000 (14:55 +0200)] 
ch_driver: Don't error out if CH_CMD was not found

The CH driver needs "cloud-hypervisor" binary. And if none was
found then the initialization of the driver fails as
chStateInitialize() returns VIR_DRV_STATE_INIT_ERROR. This in
turn means that whole daemon fails to initialize. Let's return
VIR_DRV_STATE_INIT_SKIPPED in this particular case, which
disables the CH drvier but lets the daemon run.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoch_conf: Dissolve chExtractVersionInfo() in chExtractVersion()
Michal Privoznik [Fri, 4 Jun 2021 12:21:40 +0000 (14:21 +0200)] 
ch_conf: Dissolve chExtractVersionInfo() in chExtractVersion()

After previous patches, there's not much value in
chExtractVersion(). Rename chExtractVersionInfo() to
chExtractVersion() and have it use virCHDriver directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agochExtractVersionInfo: Don't check for retversion != NULL
Michal Privoznik [Fri, 4 Jun 2021 12:19:15 +0000 (14:19 +0200)] 
chExtractVersionInfo: Don't check for retversion != NULL

The only caller, chExtractVersion() passes not NULL. Therefore,
it's redundant to check for NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoch_conf: Move error reporting into chExtractVersionInfo()
Michal Privoznik [Fri, 4 Jun 2021 12:18:50 +0000 (14:18 +0200)] 
ch_conf: Move error reporting into chExtractVersionInfo()

If chExtractVersionInfo() fails, in some cases it reports error
and in some it doesn't. Fix those places and drop reporting error
from chExtractVersion() which would just overwrite more specific
error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add missing docs for some sound devices
Daniel P. Berrangé [Thu, 3 Jun 2021 11:43:30 +0000 (12:43 +0100)] 
docs: add missing docs for some sound devices

Closes: https://gitlab.com/libvirt/libvirt/-/issues/173
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: tweak heading name for <audio> element
Daniel P. Berrangé [Thu, 3 Jun 2021 11:36:51 +0000 (12:36 +0100)] 
docs: tweak heading name for <audio> element

The <audio> element is configuring exclusively a backend, not a device.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: wire up support for timer period audio setting
Daniel P. Berrangé [Thu, 3 Jun 2021 08:15:36 +0000 (09:15 +0100)] 
qemu: wire up support for timer period audio setting

Closes: https://gitlab.com/libvirt/libvirt/-/issues/171
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: add support for timer period audio setting
Daniel P. Berrangé [Thu, 3 Jun 2021 08:15:19 +0000 (09:15 +0100)] 
conf: add support for timer period audio setting

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoremote: use virtproxyd if no URI is given
Daniel P. Berrangé [Mon, 24 May 2021 11:23:12 +0000 (12:23 +0100)] 
remote: use virtproxyd if no URI is given

When the default driver mode requests the modular daemons, we still
defaulted to spawning libvirtd if the URI was NULL, because we don't
know which driver specific daemon to spawn. virtproxyd has logic
that can handle this as it is used for compatibility when accepting
incoming TCP connections with a NULL URI.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agorpc: remove "spawnDaemon" parameter
Daniel P. Berrangé [Mon, 24 May 2021 14:07:19 +0000 (15:07 +0100)] 
rpc: remove "spawnDaemon" parameter

The "spawnDaemon" and "binary" parameters are co-dependant, with the
latter non-NULL, if-and-only-if the former is true. Getting rid of the
"spawnDaemon" parameter simplifies life for the callers and eliminates
an error checking scenario.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoremote: don't populate daemon path if autostart is not required
Daniel P. Berrangé [Mon, 24 May 2021 13:58:12 +0000 (14:58 +0100)] 
remote: don't populate daemon path if autostart is not required

When deciding what socket to connect to, we build the daemon path
that we need to autostart. This path only needs to be populated
if we actually intend to use autostart.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoremote: change socket helper to return full daemon path
Daniel P. Berrangé [Mon, 24 May 2021 13:08:44 +0000 (14:08 +0100)] 
remote: change socket helper to return full daemon path

The remoteGetUNIXSocket method currently just returns the daemon name
and the caller then converts this to a path. Except the SSH helper
didn't do this, so it was relying on later code expanding $PATH, and
this doesn't allow for build root overrides.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoremote: consistently use flags for passing ro/user/autostart props
Daniel P. Berrangé [Mon, 24 May 2021 13:02:07 +0000 (14:02 +0100)] 
remote: consistently use flags for passing ro/user/autostart props

We have helper methods that return boolans for ro/user/autostart
properties. We then pack them into a flags parameter, and later
unpack them again. This makes the code consistently use flags
throughout.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoremote: move open flags enum to sockets header
Daniel P. Berrangé [Mon, 24 May 2021 12:53:26 +0000 (13:53 +0100)] 
remote: move open flags enum to sockets header

This enum will shortly be used by the remote driver sockets helper
methods too.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agovirfile: Use g_build_filename() when building paths
Luke Yue [Mon, 31 May 2021 01:48:22 +0000 (09:48 +0800)] 
virfile: Use g_build_filename() when building paths

The g_build_filename() would decide which separator
to use instead of hardcoding in g_strdup_printf().

Related issue: https://gitlab.com/libvirt/libvirt/-/issues/12

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agoAdd basic driver for the Cloud-Hypervisor
William Douglas [Wed, 12 May 2021 17:01:31 +0000 (10:01 -0700)] 
Add basic driver for the Cloud-Hypervisor

Cloud-Hypervisor is a KVM virtualization using hypervisor. It
functions similarly to qemu and the libvirt Cloud-Hypervisor driver
uses a very similar structure to the libvirt driver.

The biggest difference from the libvirt perspective is that the
"monitor" socket is seperated into two sockets one that commands are
issued to and one that events are notified from. The current
implementation only uses the command socket (running over a REST API
with json encoded data) with future changes to add support for the
event socket (to better handle shutdowns from inside the VM).

This patch adds support for the following initial VM actions using the
Cloud-Hypervsior API:
 * vm.create
 * vm.delete
 * vm.boot
 * vm.shutdown
 * vm.reboot
 * vm.pause
 * vm.resume

To use the Cloud-Hypervisor driver, the v15.0 release of
Cloud-Hypervisor is required to be installed.

Some additional notes:
 * The curl handle is persistent but not useful to detect ch process
 shutdown/crash (a future patch will address this shortcoming)
 * On a 64-bit host Cloud-Hypervisor needs to support PVH and so can
 emulate 32-bit mode but it isn't fully tested (a 64-bit kernel and
 32-bit userspace is fine, a 32-bit kernel isn't validated)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
4 years agotests: Update expected output of virsh-optparse
Michal Privoznik [Wed, 2 Jun 2021 14:14:57 +0000 (16:14 +0200)] 
tests: Update expected output of virsh-optparse

In the previous commit I've changed what API is called from
'virsh setmem' command. However, since virsh-optparse test is ran
only when expensive tests are enabled I've completely missed that
the expected output for virsh-optparse test must be updated too
as it contains the API.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirsh-domain: Drop support for old APIs in cmdSetmem and cmdSetmaxmem
Michal Privoznik [Wed, 19 May 2021 09:58:27 +0000 (11:58 +0200)] 
virsh-domain: Drop support for old APIs in cmdSetmem and cmdSetmaxmem

Some of our really old APIs are missing @flags argument. We
introduced their variants with "Flags" suffix and wired some
logic into virsh to call the new variant only if necessary. This
enables virsh to talk to older daemon which may be lacking new
APIs.

However, in case of cmdSetmem() we are talking about v0.1.1
(virDomainSetMemory()) vs. v0.9.0 (virDomainSetMemoryFlags()) and
in case of cmdSetmaxmem() we are talking about v0.0.3
(virDomainSetMaxMemory()) vs v0.9.0 (virDomainSetMemoryFlags()).

Libvirt v0.9.0 was released more than 10 years ago and recently
we dropped support for RHEL-7 which has v4.5.0 (released ~3 years
ago). Thus it is not really necessary to have support in virsh
for such old daemons.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonode_device_udev: Also process ID_TYPE=cd/dvd in udevProcessStorage()
Michal Privoznik [Mon, 31 May 2021 14:42:13 +0000 (16:42 +0200)] 
node_device_udev: Also process ID_TYPE=cd/dvd in udevProcessStorage()

When processing node devices, the udevProcessStorage() will be
called if the device is some form of storage. In here, ID_TYPE
attribute is queried and depending on its value one of more
specialized helper functions is called. For instance, for
ID_TYPE=="cd" the udevProcessCDROM() is called, for
ID_TYPE=="disk" the udevProcessDisk() is called, and so on.

But there's a problem with ID_TYPE and its values. Coming from
udev, we are not guaranteed that ID_TYPE will contain "cd" for
CDROM devices. In fact, there's a rule installed by sg3_utils
that will overwrite ID_TYPE to "cd/dvd" leaving us with an
unhandled type. Fortunately, this was fixed in their upstream,
but there are still versions out there, on OS platforms that we
aim to support that contain the problematic rule. Therefore, we
should accept both strings.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1848875
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonode_device_udev: Don't overwrite @ret in udevProcessStorage()
Michal Privoznik [Mon, 31 May 2021 14:22:42 +0000 (16:22 +0200)] 
node_device_udev: Don't overwrite @ret in udevProcessStorage()

Let's use a different variable for storing retvals of helper
functions. This way the usual function pattern can be restored.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonode_device_udev: Make udevGetStringProperty() return void
Michal Privoznik [Mon, 31 May 2021 14:24:18 +0000 (16:24 +0200)] 
node_device_udev: Make udevGetStringProperty() return void

This function can't fail really as it's returning 0 no matter
what. This is probably a residue from old days when we cared
about propagating OOM errors. Now we just abort. Make its return
type void then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonode_device_udev: Make udevGenerateDeviceName() return void
Michal Privoznik [Mon, 31 May 2021 14:19:12 +0000 (16:19 +0200)] 
node_device_udev: Make udevGenerateDeviceName() return void

This function can't fail really as it's returning 0 no matter
what. This is probably a residue from old days when we cared
about propagating OOM errors. Now we just abort. Make its return
type void then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agolibxl: adjust handling of libxl_device_nic objects
Jim Fehlig [Wed, 26 May 2021 20:05:05 +0000 (14:05 -0600)] 
libxl: adjust handling of libxl_device_nic objects

libxl objects are supposed to be initialized and disposed. Adjust
libxlMakeNic to use an already initialized object owned by the caller.

Adjust libxlMakeNicList to initialize the list of objects, before they
are filled by libxlMakeNic. The libxl_domain_config object passed to
libxlMakeNicList is owned by the caller and will be disposed with
libxl_domain_config_dispose, which also disposes embedded objects such
as libxl_device_nic.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Olaf Hering <olaf@aepfle.de>
4 years agovirDomainDiskDefParseSource: parse source bits from driver element
Pavel Hrdina [Thu, 27 May 2021 13:32:17 +0000 (15:32 +0200)] 
virDomainDiskDefParseSource: parse source bits from driver element

Before the mentioned commit we always parsed the whole disk definition
for qemuDomainBlockCopy API but we only used the @src part. Based on
that assumption the code was changed to parse only the disk <source>
element.

Unfortunately that is not correct as we need to parse some parts of
<driver> element as well.

Fixes: 0202467c4ba8663db2304b140af609f93a9b3091
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodomain_conf: extract disk driver source bits to its own function
Pavel Hrdina [Thu, 27 May 2021 13:25:51 +0000 (15:25 +0200)] 
domain_conf: extract disk driver source bits to its own function

Attribute `type` and sub-element `metadata_cache` are internally stored
in the `virStorageSource` structure. Sometimes we only care about the
disk source bits so we need a dedicated helper for that.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agomeson: Style tweaks
Andrea Bolognani [Wed, 26 May 2021 15:47:58 +0000 (17:47 +0200)] 
meson: Style tweaks

These checks look different than most similar ones for no
particular reason.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Switch to autodetection for driver_test
Andrea Bolognani [Wed, 26 May 2021 15:46:26 +0000 (17:46 +0200)] 
meson: Switch to autodetection for driver_test

Match the behavior of most other features.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Switch to autodetection for driver_remote
Andrea Bolognani [Wed, 26 May 2021 14:06:40 +0000 (16:06 +0200)] 
meson: Switch to autodetection for driver_remote

Match the behavior of most other features.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Switch to autodetection for apparmor_profiles
Andrea Bolognani [Thu, 27 May 2021 13:20:43 +0000 (15:20 +0200)] 
meson: Switch to autodetection for apparmor_profiles

Match the behavior of most other features.

This will result in a change in behavior, because profiles will
now be installed whenever AppArmor support is enabled; on the
other hand, this is probably the behavior users expected in the
first place.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Turn apparmor_profiles into a feature
Andrea Bolognani [Thu, 27 May 2021 13:20:24 +0000 (15:20 +0200)] 
meson: Turn apparmor_profiles into a feature

Similar knobs, such as firewalld_zone and sysctl_config, are
already features, so convert this one as well to comply with
expectations.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Rewrite apparmor_profiles check
Andrea Bolognani [Thu, 27 May 2021 13:17:19 +0000 (15:17 +0200)] 
meson: Rewrite apparmor_profiles check

Attempting to enable apparmor_profiles when apparmor support
is not enabled should result in an error.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Use dependency() when possible
Andrea Bolognani [Wed, 26 May 2021 16:46:20 +0000 (18:46 +0200)] 
meson: Use dependency() when possible

This is the preferred way to figure out whether a library is
available, and for the most part we can just adopt it right
away; in a few cases, unfortunately, we're stuck with using
cc.find_library() until further down the road, when all our
target platforms ship with pkg-config enabled versions of the
various libraries.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Rewrite libacl check
Andrea Bolognani [Wed, 26 May 2021 16:42:40 +0000 (18:42 +0200)] 
meson: Rewrite libacl check

libacl is Linux-only, so we don't need to explicitly check for
either the target platform or header availability, and we can
simply rely on cc.find_library() instead. The corresponding
preprocessor define is renamed to more accurately reflect the
nature of the check.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Fix firewalld check
Andrea Bolognani [Wed, 26 May 2021 15:33:08 +0000 (17:33 +0200)] 
meson: Fix firewalld check

firewalld is Linux-only, so it should be disabled by default
everywhere else and attempts to explicitly enable firewalld
support on non-Linux targets should result in an error.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Rewrite firewalld check
Andrea Bolognani [Wed, 26 May 2021 15:31:03 +0000 (17:31 +0200)] 
meson: Rewrite firewalld check

This makes it possible to explicitly disable firewalld support
regardless of the platform that's being targeted.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Fix disabling netcf
Andrea Bolognani [Thu, 27 May 2021 14:09:54 +0000 (16:09 +0200)] 
meson: Fix disabling netcf

If the feature is disabled, the corresponding flags should not
show up in the compiler command line.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Tweak XDR check
Andrea Bolognani [Wed, 26 May 2021 13:13:42 +0000 (15:13 +0200)] 
meson: Tweak XDR check

Keep all the platform-specific code in one place.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Rewrite polkit check
Andrea Bolognani [Tue, 25 May 2021 16:14:09 +0000 (18:14 +0200)] 
meson: Rewrite polkit check

The new version will report an error if the user asks for
polkit support to be enabled on Windows instead of silently
ignoring such requests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Fix sanlock detection
Andrea Bolognani [Thu, 27 May 2021 14:35:38 +0000 (16:35 +0200)] 
meson: Fix sanlock detection

If the user explicitly asked for sanlock support to be enabled,
then failure to find the corresponding library should result in
an error.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Fix vstorage detection
Andrea Bolognani [Wed, 26 May 2021 15:47:05 +0000 (17:47 +0200)] 
meson: Fix vstorage detection

We're supposed to error out if the user has explicitly asked
for vstorage support to be enabled and that can't be done, but
we've been looking at the wrong option.

Fixes: 2127d53f2f90443f3e4919c1082350ee2b3096f1
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Drop numactl_version
Andrea Bolognani [Wed, 26 May 2021 18:08:40 +0000 (20:08 +0200)] 
meson: Drop numactl_version

It's not used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Make libm a required dependency
Andrea Bolognani [Thu, 27 May 2021 17:34:50 +0000 (19:34 +0200)] 
meson: Make libm a required dependency

We use it unconditionally.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Use built-in pcap detection
Andrea Bolognani [Wed, 26 May 2021 16:20:04 +0000 (18:20 +0200)] 
meson: Use built-in pcap detection

Meson already knows how to look for pcap using pkg-config
first, and falling back to pcap-config if that didn't work.

https://mesonbuild.com/Dependencies.html#pcap

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Use get_pkgconfig_variable('cflags')
Andrea Bolognani [Wed, 26 May 2021 17:03:16 +0000 (19:03 +0200)] 
meson: Use get_pkgconfig_variable('cflags')

Meson offers a native convenience method that can be used to
fetch pkg-config variables from a dependency, so we can use
that instead of calling pkg-config manually.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Drop netinet workaround
Andrea Bolognani [Wed, 26 May 2021 16:30:06 +0000 (18:30 +0200)] 
meson: Drop netinet workaround

It appears to no longer be necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Drop curl workaround
Andrea Bolognani [Wed, 26 May 2021 17:10:17 +0000 (19:10 +0200)] 
meson: Drop curl workaround

It appears to no longer be necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Don't use 'required: true'
Andrea Bolognani [Thu, 27 May 2021 17:04:10 +0000 (19:04 +0200)] 
meson: Don't use 'required: true'

It's the default.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agomeson: Whitespace tweaks
Andrea Bolognani [Thu, 27 May 2021 16:29:02 +0000 (18:29 +0200)] 
meson: Whitespace tweaks

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agospec: Be explicit about more features
Andrea Bolognani [Thu, 27 May 2021 18:57:57 +0000 (20:57 +0200)] 
spec: Be explicit about more features

We want to be explicit about which features are enabled in our
RPM build instead of relying on default values.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoPost-release version bump to 7.5.0
Jiri Denemark [Tue, 1 Jun 2021 10:05:41 +0000 (12:05 +0200)] 
Post-release version bump to 7.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoRelease of libvirt-7.4.0 v7.4.0
Jiri Denemark [Tue, 1 Jun 2021 09:57:28 +0000 (11:57 +0200)] 
Release of libvirt-7.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoNEWS: disks: Mention <transient> improvements and <slice> XML fix
Peter Krempa [Tue, 1 Jun 2021 07:22:05 +0000 (09:22 +0200)] 
NEWS: disks: Mention <transient> improvements and <slice> XML fix

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoqemuProcessSetupDisksTransientSnapshot: Skip enabling transientOverlayCreated flag
Masayoshi Mizuma [Thu, 27 May 2021 16:55:12 +0000 (12:55 -0400)] 
qemuProcessSetupDisksTransientSnapshot: Skip enabling transientOverlayCreated flag

QEMU_DOMAIN_DISK_PRIVATE(disk)->transientOverlayCreated flag
gets true unexpectedly on qemuProcessSetupDisksTransientSnapshot() when
the disk has <transient shareBacking='yes'> option.

The flag should be enabled on qemuDomainAttachDiskGeneric() after the
overlay setup is completed.

Skip enabling transientOverlayCreated for the disk here.

Fixes: 75871da0ecb8b552f9e304d0f83e216839bbf82d
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonodedev: Revert auto-start property for mdevs v7.4.0-rc2
Jonathon Jongsma [Wed, 26 May 2021 15:40:26 +0000 (10:40 -0500)] 
nodedev: Revert auto-start property for mdevs

We supported autostart of node devices via an xml element, but this
is not consistent with other libvirt objects which use an explicit API
for setting autostart status. So revert this and implement it as an
official API in a future commit.

The initial support was refactored after merging, so this commit reverts
both of those previous commits.

Revert "virNodeDevCapMdevParseXML: Use virXMLPropEnum() for ./start/@type"
This reverts commit 9d4cd1d1cda84aa15b77a506f2ad6362a74edf1a.

Revert "nodedev: support auto-start property for mdevs"
This reverts commit 42a558549935336cbdb7cbfe8b239ffb0e3442e3.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoPartial Revert of "tests: nodedevxml2xmltest: test more mdev files"
Jonathon Jongsma [Wed, 26 May 2021 15:40:25 +0000 (10:40 -0500)] 
Partial Revert of "tests: nodedevxml2xmltest: test more mdev files"

This reverts parts of commit bb8c3b61208ed0f29dcbeca857529600f04b3146
that added tests for autostart functionality (which will be reverted in
the following commit)

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoremote: fix regression connecting to remote session daemon
Daniel P. Berrangé [Mon, 24 May 2021 15:36:15 +0000 (16:36 +0100)] 
remote: fix regression connecting to remote session daemon

While we couldn't historically connect to the remote session daemon
automatically, we do allow the user to set an explicit socket path
to enable the connections to work. This ability was accidentally
lost in

  commit f8ec7c842df9e40c6607eae9b0223766cb226336
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Jul 8 17:03:38 2020 +0100

    rpc: use new virt-ssh-helper binary for remote tunnelling

We need to force use of 'netcat' when a 'socket' path is given in
the URI parameters.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>