]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agorun: gracefully handle SIGHUP, SIGQUIT, SIGTERM
Daniel P. Berrangé [Wed, 9 Mar 2022 10:52:12 +0000 (10:52 +0000)]
run: gracefully handle SIGHUP, SIGQUIT, SIGTERM

When using thue 'run' script to launch a daemon, it is intended to
temporarily stop the systemd units and re-start them again after.

When using this script over an SSH connection, it will get SIGHUP
if the connection goes away, and in this case it fails to re-start
the systemd units. We need to catch SIGHUP and turn it into a
normal python exception. For good measure we do the same for
SIGQUIT and SIGTERM too.  SIGINT already gets turned into an
exception by default which we handle.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorun: include 'src' in $PATH for the daemons
Daniel P. Berrangé [Wed, 9 Mar 2022 10:51:36 +0000 (10:51 +0000)]
run: include 'src' in $PATH for the daemons

Currently the 'run' script modifies $PATH to add the 'tools'
directly to pick up client programs. It fails to add the 'src'
directory to pick up the daemons.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoconf: remove misleading comments about access being 'lockless'
Daniel P. Berrangé [Tue, 8 Mar 2022 16:56:05 +0000 (16:56 +0000)]
conf: remove misleading comments about access being 'lockless'

For the various structs storing lists of objects, the access
to the hash tables is not lockless. The mutex on the object
owning the hash table must be held.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agovirsh: fflush(stdout) after fputs()
Michal Privoznik [Wed, 9 Mar 2022 13:01:49 +0000 (14:01 +0100)]
virsh: fflush(stdout) after fputs()

We are not guaranteed that the string we are printing onto stdout
contains '\n' and thus that the stdout is flushed. In fact, I've
met this problem when virsh asked me whether I want to edit the
domain XML again (vshAskReedit()) but the prompt wasn't displayed
(as it does not contain a newline character) and virsh just sat
there waiting for my input, I sat there waiting for virsh's
output. Flush stdout after all fputs()-s  which do not flush
stdout.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: support multiqueue for vdpa net device
Jonathon Jongsma [Tue, 1 Mar 2022 22:55:21 +0000 (16:55 -0600)]
qemu: support multiqueue for vdpa net device

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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agonews: Document that we build with musl
Martin Kletzander [Wed, 9 Mar 2022 10:19:02 +0000 (11:19 +0100)]
news: Document that we build with musl

A bit of effort by me and Michal helped make this the case, and it helped us
uncover some potential issues.  I am not documenting it as supported or adding
an Alpine container into the CI, but since there were some distribution bugs
mentioning libvirt issues I thing it would be nice of us to notify those
distribution maintainers that read our release news.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonwfilter: drop support for legacy iptables conntrack direction
Daniel P. Berrangé [Fri, 25 Feb 2022 16:28:32 +0000 (16:28 +0000)]
nwfilter: drop support for legacy iptables conntrack direction

Long ago we adapted to Linux kernel changes which inverted the
behaviour of the conntrack --ctdir setting:

  commit a6a04ea47a8143ba46150889d8dae1c861df6389
  Author: Stefan Berger <stefanb@us.ibm.com>
  Date:   Wed May 15 21:02:11 2013 -0400

    nwfilter: check for inverted ctdir

    Linux netfilter at some point (Linux 2.6.39) inverted the meaning of the
    '--ctdir reply' and newer netfilter implementations now expect
    '--ctdir original' instead and vice-versa.
    We check for the kernel version and assume that all Linux kernels with version
    2.6.39 have the newer inverted logic.

    Any distro backporting the Linux kernel patch that inverts the --ctdir logic
    (Linux commit 96120d86f) must also backport this patch for Linux and
    adapt the kernel version being tested for.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Given our supported platform targets, we no longer need to
consider a version of Linux before 2.6.39, so can drop
support for the old direction behaviour.

The test suite updates are triggered because that never
probed for the ctdir direction, and so the iptables syntax
generator unconditionally dropped the ctdir args.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonwfilter: drop support for legacy iptables match syntax
Daniel P. Berrangé [Fri, 25 Feb 2022 16:24:21 +0000 (16:24 +0000)]
nwfilter: drop support for legacy iptables match syntax

Long ago we adapted to iptables changes by introducing support
for '-m conntrack':

  commit 06844ccbaa8544d7d08d568aff37bc4e3648f304
  Author: Stefan Berger <stefanb@us.ibm.com>
  Date:   Tue Aug 6 20:30:46 2013 -0400

    nwfilter: Use -m conntrack rather than -m state

    Since iptables version 1.4.16 '-m state --state NEW' is converted to
    '-m conntrack --ctstate NEW'. Therefore, when encountering this or later
    versions of iptables use '-m conntrack --ctstate'.

Given our supported platform targets, we no longer need to
consider a version of iptables before 1.4.16, so can drop
support for the old syntax.

The test suite updates are triggered because that never
probed for the new syntax, and so unconditionally
generated the old syntax.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoapparmor: Fix QEMU access for UEFI variable files
Martin Pitt [Fri, 25 Feb 2022 14:07:30 +0000 (14:07 +0000)]
apparmor: Fix QEMU access for UEFI variable files

QEMU needs to read, write, and lock the NVRAM *.fd files with UEFI
firmware.

Fixes: https://bugs.debian.org/1006324
Fixes: https://launchpad.net/bugs/1962035
Signed-off-by: Martin Pitt <mpitt@debian.org>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
3 years agodocs: meson: Restore alphabetical order
Peter Krempa [Mon, 7 Mar 2022 15:38:05 +0000 (16:38 +0100)]
docs: meson: Restore alphabetical order

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: formatsecret: Drop few unneeded empty lines
Peter Krempa [Mon, 7 Mar 2022 15:25:19 +0000 (16:25 +0100)]
docs: formatsecret: Drop few unneeded empty lines

The examples contain some whitespace and command prompts which just
waste space.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'formatsecret' page to rST
Peter Krempa [Mon, 7 Mar 2022 15:16:58 +0000 (16:16 +0100)]
docs: Convert 'formatsecret' page to rST

Also update the link from 'formatstorageencryption' to the
'usage-type-volume' anchor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'drivers' page to rST
Peter Krempa [Mon, 7 Mar 2022 15:09:03 +0000 (16:09 +0100)]
docs: Convert 'drivers' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: page.xsl: Update anchor to the 'Code of conduct' paragraph
Peter Krempa [Mon, 7 Mar 2022 15:05:23 +0000 (16:05 +0100)]
docs: page.xsl: Update anchor to the 'Code of conduct' paragraph

Use the anchor name as generated by rst2html.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'governance' page to rST
Peter Krempa [Mon, 7 Mar 2022 15:02:55 +0000 (16:02 +0100)]
docs: Convert 'governance' page to rST

Extra care is taken to preserve the 'codeofconduct' anchor which is used
in our page template. Upcoming patch will change that but we'll retain
the anchor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'securityprocess' page to rST
Peter Krempa [Mon, 7 Mar 2022 13:56:53 +0000 (14:56 +0100)]
docs: Convert 'securityprocess' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'support' page to rST
Peter Krempa [Mon, 7 Mar 2022 13:54:23 +0000 (14:54 +0100)]
docs: Convert 'support' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'errors' page to rST
Peter Krempa [Mon, 7 Mar 2022 13:46:22 +0000 (14:46 +0100)]
docs: Convert 'errors' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'bugs' page to rST
Peter Krempa [Mon, 7 Mar 2022 13:39:24 +0000 (14:39 +0100)]
docs: Convert 'bugs' page to rST

Special care is given to preserve the 'quality' anchor in the 'bugs'
page as we link to it directly from the gitlab issue template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'contribute' page to rST
Peter Krempa [Mon, 7 Mar 2022 13:29:40 +0000 (14:29 +0100)]
docs: Convert 'contribute' page to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'strategy' to rST
Peter Krempa [Fri, 4 Mar 2022 16:11:45 +0000 (17:11 +0100)]
docs: Convert 'strategy' to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Convert 'goals' to rST
Peter Krempa [Fri, 4 Mar 2022 16:08:31 +0000 (17:08 +0100)]
docs: Convert 'goals' to rST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: formatsnapshot: Convert to 'rst'
Peter Krempa [Fri, 4 Mar 2022 14:55:40 +0000 (15:55 +0100)]
docs: formatsnapshot: Convert to 'rst'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Drop 'devguide' page
Peter Krempa [Mon, 7 Mar 2022 13:14:46 +0000 (14:14 +0100)]
docs: Drop 'devguide' page

The page is not referenced from anywhere and contains dead links for the
output and links to old repos.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Remove 'virshcmdref' page
Peter Krempa [Fri, 4 Mar 2022 15:50:45 +0000 (16:50 +0100)]
docs: Remove 'virshcmdref' page

The page isn't linked from anywhere and the project was archived.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibvirt-qemu: Fix capitalization of QEMU
Michal Privoznik [Tue, 8 Mar 2022 14:12:04 +0000 (15:12 +0100)]
libvirt-qemu: Fix capitalization of QEMU

In plenty of places we mention qemu, Qemu but the correct form is
all capitals.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibvirt-qemu: Don't allow NULL cmd in virDomainQemuMonitorCommandWithFiles()
Michal Privoznik [Tue, 8 Mar 2022 14:09:59 +0000 (15:09 +0100)]
libvirt-qemu: Don't allow NULL cmd in virDomainQemuMonitorCommandWithFiles()

Nothing in daemon code is prepared for the command in
virDomainQemuMonitorCommandWithFiles() to be NULL. In fact, the
client side doesn't expect this either as our RPC describes the
argument as:

    remote_nonnull_string cmd;

Validate the argument in the public API implementation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonwfilter: make some gentech driver methods static
Daniel P. Berrangé [Fri, 25 Feb 2022 14:23:11 +0000 (14:23 +0000)]
nwfilter: make some gentech driver methods static

The virNWFilterTechDriverForName & virNWFilterUpdateInstantiateFilter
methods are only used within the same source file, so don't need to
be exported.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonwfilter: remove decl of virNWFilterCreateVarHashmap
Daniel P. Berrangé [Fri, 25 Feb 2022 14:21:56 +0000 (14:21 +0000)]
nwfilter: remove decl of virNWFilterCreateVarHashmap

This method doesn't exist since

  commit d1a7c08eb145d8b9d9c4a268f4ffff3b1590049a
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Thu Apr 26 12:26:51 2018 +0100

    nwfilter: convert the gentech driver code to use virNWFilterBindingDefPtr

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu,lxc: remove use to nwfilter update lock
Daniel P. Berrangé [Thu, 24 Feb 2022 19:02:32 +0000 (19:02 +0000)]
qemu,lxc: remove use to nwfilter update lock

Now that the virNWFilterBinding APIs are using the nwfilter
update lock directly, there is no need for the virt drivers
to do it themselves.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonwfilter: hold filter update lock when creating/deleting bindings
Daniel P. Berrangé [Thu, 24 Feb 2022 18:41:29 +0000 (18:41 +0000)]
nwfilter: hold filter update lock when creating/deleting bindings

The nwfilter update lock is historically acquired by the virt
drivers in order to achieve serialization between nwfilter
define/undefine, and instantiation/teardown of filters.

When running in the modular daemons, however, the mutex that
the virt drivers are locking is in a completely different
process from the mutex that the nwfilter driver is locking.

Serialization is lost and thus call from the virt driver to
virNWFilterBindingCreateXML can deadlock with a concurrent
call to the virNWFilterDefineXML method.

The solution is surprisingly easy, the update lock simply
needs acquiring in the virNWFilterBindingCreateXML method
and virNWFilterBindingUndefine method instead of in the
virt drivers.

The only semantic difference here is that when a virtual
machine has multiple NICs, the instantiation and teardown
of filters is no longer serialized for the whole VM, but
rather for each NIC. This should not be a problem since
the virt drivers already need to cope with tearing down
a partially created VM where only some of the NICs are
setup.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Thu, 3 Mar 2022 20:16:58 +0000 (21:16 +0100)]
Translated using Weblate (Finnish)

Currently translated at 22.9% (2389 of 10404 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agomeson: Detect newer fuse
Michal Privoznik [Tue, 22 Feb 2022 14:21:49 +0000 (15:21 +0100)]
meson: Detect newer fuse

Now that we have support for fuse-3 we can detect it during the
configure phase. Even better, we can detect fuse-3 first and
fallback to old fuse only if the newer version doesn't exist.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Implement support for FUSE3
Michal Privoznik [Mon, 13 Apr 2020 11:17:47 +0000 (13:17 +0200)]
lxc_fuse: Implement support for FUSE3

Plenty of projects switch from FUSE to FUSE3. This commit enables
libvirt to compile with newer fuse-3.1 which allows users to have
just one fuse package on their systems, allows us to set
O_CLOEXEC on the fuse session FD. In general, FUSE3 offers more
features, but apparently we don't need them right now. There is a
rewrite guide at [1] but I've took most inspiration from sshfs
[2].

1: https://github.com/libfuse/libfuse/releases/tag/fuse-3.0.0
2: https://github.com/libfuse/sshfs

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Tell FUSE that /proc/meminfo is nonseekable
Michal Privoznik [Tue, 1 Mar 2022 08:35:48 +0000 (09:35 +0100)]
lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable

If an app within a container wishes to read from /proc/meminfo
from a different position than the beginning of the file, we can
have FUSE keep track of all the lseek()-s and reflect them in
@offset argument of read callback (lxcProcRead()). This is done
by setting fuse_file_info::nonseekable. If we don't do this, then
FUSE reports errors back the app that does lseek().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Prefer fuse_file_info::direct_io over mount option
Michal Privoznik [Mon, 28 Feb 2022 12:26:14 +0000 (13:26 +0100)]
lxc_fuse: Prefer fuse_file_info::direct_io over mount option

When mounting a FUSE it is possible to bypass kernel cache by
specifying -odirect_io mount option. This is what we currently
do. However, FUSEv3 has a different approach - the open callback
(lxcProcOpen() in our case) can set direct_io member of
fuse_file_info struct. This results in the same behaviour, but
also works with both FUSEv1 and FUSEv3. The latter does not have
the mount option and uses per file approach.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcProcReadMeminfo: Fix case when @offset != 0
Michal Privoznik [Mon, 28 Feb 2022 15:30:08 +0000 (16:30 +0100)]
lxcProcReadMeminfo: Fix case when @offset != 0

The idea behind lxcProcReadMeminfo() is that we read the host's
/proc/meminfo and copy it line by line producing the content for
container, changing only those lines we need. Thus, when a
process inside container opens the file and lseek()-s to a
different position (or reads the content in small chunks), we
mirror the seek in host's /proc/meminfo. But this doesn't work
really. We are not guaranteed to end up aligned on the beginning
of new line. It's better if we construct the new content and then
mimic seeking in it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcProcReadMeminfo: Drop @new_meminfo variable
Michal Privoznik [Mon, 28 Feb 2022 14:29:58 +0000 (15:29 +0100)]
lxcProcReadMeminfo: Drop @new_meminfo variable

In the lxcProcReadMeminfo() function we have @buffer variable
which is statically allocated and then @new_meminfo which is just
a pointer to the @buffer. This is needless, the @buffer can be
accessed directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcProcReadMeminfo: Drop needless label
Michal Privoznik [Mon, 28 Feb 2022 14:27:24 +0000 (15:27 +0100)]
lxcProcReadMeminfo: Drop needless label

After previous cleanups, the cleanup label is no longer needed
and can be removed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Use automatic file closing
Michal Privoznik [Mon, 28 Feb 2022 14:21:31 +0000 (15:21 +0100)]
lxc_fuse: Use automatic file closing

There are two functions (lxcProcHostRead() and
lxcProcReadMeminfo()) that could benefit from automatic file
closing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcProcReadMeminfo: Rename @fd to @fp
Michal Privoznik [Mon, 28 Feb 2022 14:21:21 +0000 (15:21 +0100)]
lxcProcReadMeminfo: Rename @fd to @fp

In lxcProcReadMeminfo() there's a variable named @fd which would
suggest it's type of int, but in fact it's type of FILE *. Rename
it to @fp to avoid confusion.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcSetupFuse: Cleanup error paths
Michal Privoznik [Tue, 22 Feb 2022 12:47:36 +0000 (13:47 +0100)]
lxcSetupFuse: Cleanup error paths

In the lxcSetupFuse() function there are multiple cleanup labels,
but with a bit of rewrite they can be joined into one 'error'
label. And while at it, set the @f argument only in the
successful path (currently is set in error case too).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Prefer O_ACCMODE instead of & 3
Michal Privoznik [Mon, 28 Feb 2022 11:53:39 +0000 (12:53 +0100)]
lxc_fuse: Prefer O_ACCMODE instead of & 3

In lxcProcOpen() we want to check whether the /proc/memfile is
being opened only for read. For that we check the fi->flags which
correspond to flags open() call. Instead of explicitly masking
the last two bits use O_ACCMODE constant, which is deemed to be
more portable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse.c: Modernize function declarations
Michal Privoznik [Tue, 1 Mar 2022 08:58:18 +0000 (09:58 +0100)]
lxc_fuse.c: Modernize function declarations

Our style of writing function declarations has changed since the
time the file was introduced. Fix the whole file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Drop some G_GNUC_UNUSED attributes
Michal Privoznik [Mon, 28 Feb 2022 11:53:25 +0000 (12:53 +0100)]
lxc_fuse: Drop some G_GNUC_UNUSED attributes

There are few arguments that are marked as G_GNUC_UNUSED even
though they are clearly used within their respective functions.
Drop the annotation in such cases.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Move #include <fuse.h>
Michal Privoznik [Mon, 13 Apr 2020 14:01:42 +0000 (16:01 +0200)]
lxc_fuse: Move #include <fuse.h>

There is no need to include the fuse.h from the header file.
Move the include into the lxc_fuse.c then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse.h: Don't include lxc_conf.h
Michal Privoznik [Tue, 22 Feb 2022 11:51:32 +0000 (12:51 +0100)]
lxc_fuse.h: Don't include lxc_conf.h

Nothing in the lxc_fuse.h header file warrants inclusion of
lxc_conf.h. If anything, virconftypes.h must be included because
of virDomainDef required by lxcSetupFuse().

It's actually lxc_fuse.c that requires some macros from
lxc_fuse.h (e.g. LXC_STATE_DIR).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Move virLXCMeminfo struct into lxc_cgroup.h
Michal Privoznik [Tue, 22 Feb 2022 11:50:52 +0000 (12:50 +0100)]
lxc_fuse: Move virLXCMeminfo struct into lxc_cgroup.h

The function that fills virLXCMeminfo struct
(virLXCCgroupGetMeminfo()) lives in lxc_cgroup.h. Move the struct
there too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_fuse: Hide struct virLXCFuse
Michal Privoznik [Mon, 13 Apr 2020 13:59:55 +0000 (15:59 +0200)]
lxc_fuse: Hide struct virLXCFuse

This structure is not used outside of lxc_fuse.c. There is no need
to define it in the header file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agowireshark: Fix dissector for quad types
Martin Kletzander [Mon, 7 Mar 2022 09:08:49 +0000 (10:08 +0100)]
wireshark: Fix dissector for quad types

This uses the right type that is expected to make it work even on platforms
where gint64 != quad_t.

Due to indentation changes it is best to view this patch with -w.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: remove extra closing tag
Ján Tomko [Mon, 7 Mar 2022 09:37:19 +0000 (10:37 +0100)]
docs: remove extra closing tag

Reported-by: Юлій В. Чирков <juliyvchirkov@gmail.com>
Closes: https://gitlab.com/libvirt/libvirt/-/merge_requests/143
Fixes: d3ac12e3a1c01d1205b4db3f6cd640f3da98579b
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Allow expansion of mocked stat symbols
Martin Kletzander [Mon, 7 Mar 2022 08:21:26 +0000 (09:21 +0100)]
tests: Allow expansion of mocked stat symbols

When libc uses a define to rewrite stat64 to stat our mocks do not work if they
are chained because the symbol that we are looking up is being stringified and
therefore preventing the stat64->stat expansion per C-preprocessor rules.  One
stringification macro is just enough to make it work.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agonwfilter: Avoid memory alignment issues
Martin Kletzander [Thu, 3 Mar 2022 12:18:14 +0000 (13:18 +0100)]
nwfilter: Avoid memory alignment issues

The returned packet can have less strict alignment (u_char) than the struct
(ether_header) we are casting it to, so to avoid alignment issues just copy the
header into the struct on the stack.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoInclude sys/wait.h instead of wait.h
Martin Kletzander [Thu, 3 Mar 2022 12:17:02 +0000 (13:17 +0100)]
Include sys/wait.h instead of wait.h

That is the proper POSIX way.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoInclude poll.h instead of sys/poll.h
Martin Kletzander [Thu, 3 Mar 2022 12:16:35 +0000 (13:16 +0100)]
Include poll.h instead of sys/poll.h

That is the proper POSIX way.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agosyntax-check: Rework mock-noinline to get all files at once
Martin Kletzander [Thu, 3 Mar 2022 12:14:18 +0000 (13:14 +0100)]
syntax-check: Rework mock-noinline to get all files at once

The script can break if the number of files does not fit one invocation and
xargs has to split it.  Instead pipe the list of files directly into the script
and in the script read them from stdin instead of the arguments.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Update IPv4-in-IPv6 addresses
Michal Privoznik [Thu, 3 Mar 2022 15:57:30 +0000 (16:57 +0100)]
tests: Update IPv4-in-IPv6 addresses

We have couple of tests where the obsolete IPv4-in-IPv6 notation
is used (::10.1.2.3). Change them to the correct format
(::ffff:10.1.2.3).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agosockettest: Check for IPv4-in-IPv6 parsing and formatting
Michal Privoznik [Thu, 3 Mar 2022 15:43:18 +0000 (16:43 +0100)]
sockettest: Check for IPv4-in-IPv6 parsing and formatting

There are two standards how IPv4 address in IPv6 can be
expressed:

  ::10.1.2.3
  ::ffff:10.1.2.3

The former is obsolete and the latter should be used instead [1].
Add test cases to our sockettest to exercise parsing/formatting
of the valid address format.

1: https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.1

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovircgroupmock: Make global variables static
Michal Privoznik [Thu, 3 Mar 2022 15:23:48 +0000 (16:23 +0100)]
vircgroupmock: Make global variables static

Apparently clang was fixed as it no longer considers having
global variables static a problem. Make the variables static to
be sure they aren't used outside of the source file.

This effectively reverts v1.0.6-rc1~198 which started the trend.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovircgroupmock: Be wiser about detecting fakerootdir change
Michal Privoznik [Thu, 3 Mar 2022 14:42:17 +0000 (15:42 +0100)]
vircgroupmock: Be wiser about detecting fakerootdir change

The way that vircgroupmock works is that the vircgrouptest
creates a temporary directory and sets LIBVIRT_FAKE_ROOT_DIR env
variable which is then checked by the mock at the beginning of
basically every function it overrides (access(), stat in all its
flavours, mkdir(), etc.). The mock then creates a CGroup dir
structure. But the test is allowed to change the directory, to
accommodate environment for the particular test case. This is
done by changing the environment variable which is then detected
by the mock and the whole process repeats.

However, the way the mock detect changes is buggy. After it got
the environment variable it compares it to the last known value
(global variable @fakerootdir) and if they don't match the last
known value is set to point to the new value. Problem is that the
result of getenv() is assigned to the @fakerootdir directly.
Therefore, @fakerootdir points somewhere into the buffer of
environment variables. In turn, when the test sets new value (via
g_setenv()) it may be placed at the very same position in the env
var buffer and thus the mock fails to detect the change.

The solution is to keep our private copy of the value (by
g_strdup()) which makes the variable not rely on
getenv()/setenv() placing values at random positions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoremote: dispatch: free and close infiles too
Ján Tomko [Thu, 3 Mar 2022 13:02:28 +0000 (14:02 +0100)]
remote: dispatch: free and close infiles too

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoremote: close outfiles faster
Ján Tomko [Thu, 3 Mar 2022 13:01:16 +0000 (14:01 +0100)]
remote: close outfiles faster

Switch the operands in the loop condition to make it converge.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agorpc: Fix memory leak of fds
Peng Liang [Wed, 2 Mar 2022 09:22:05 +0000 (17:22 +0800)]
rpc: Fix memory leak of fds

In virSystemdActivationClaimFDs, the memory of ent->fds has been stolen
and stored in fds, but fds is never freed, which causes a memory leak.
Fix it by declaring fds as g_autofree.

Reported-by: Jie Tang <tangjie18@huawei.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolibxl: Turn on user aliases
Michal Privoznik [Thu, 17 Feb 2022 11:51:27 +0000 (12:51 +0100)]
libxl: Turn on user aliases

When I implemented user aliases I've invented this
virDomainDefFeatures flag so that individual drivers can signal
support for user provided aliases. The reasoning was that a
device alias might be part of guest ABI, or used in a different
way then in QEMU. Well, neither applies to the libxl driver, so
it's safe to allow user aliases there.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/231
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agovirsh: cmdDesc: Fix logic when '-edit' is used along with 'desc' argument
Peter Krempa [Wed, 2 Mar 2022 12:47:09 +0000 (13:47 +0100)]
virsh: cmdDesc: Fix logic when '-edit' is used along with 'desc' argument

Historically the use of the '-desc' multiple argument parameter was not
forbidden toghether with '-edit', but use of both together has some
unexpected behaviour. Specifically the editor is filled with the
contents passed via '-desc' but if the user doesn't change the text in
any way virsh will claim that the description was not chaged even if it
differs from the currently set description. Similarly, when the user
would edit the description provided via 'desc' so that it's identical
with the one configured for the domain, virsh would claim that it was
updated:

  # virsh desc cd
  No description for domain: cd
  # EDITOR=true virsh desc cd --edit "test desc"
  Domain description not changed

After the fix:

  # virsh desc cd
  No description for domain: cd
  # EDITOR=true virsh desc cd --edit "test desc"
  Domain description updated successfully
  # EDITOR=true virsh desc cd --edit "test desc"
  Domain description not changed

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: domain: Don't use ternaries inside vshPrint/vshError functions
Peter Krempa [Mon, 28 Feb 2022 17:40:01 +0000 (18:40 +0100)]
virsh: domain: Don't use ternaries inside vshPrint/vshError functions

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDesc: Remove unneeded 'cleanup'
Peter Krempa [Tue, 1 Mar 2022 16:31:00 +0000 (17:31 +0100)]
virsh: cmdDesc: Remove unneeded 'cleanup'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDesc: Automatically free memory
Peter Krempa [Tue, 1 Mar 2022 16:29:04 +0000 (17:29 +0100)]
virsh: cmdDesc: Automatically free memory

Decrease scope of variables and use automatic freeing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDesc: Use 'vshTempFile' type to simplify cleanup
Peter Krempa [Tue, 1 Mar 2022 16:02:59 +0000 (17:02 +0100)]
virsh: cmdDesc: Use 'vshTempFile' type to simplify cleanup

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh: Add helper for auto-removing temporary file
Peter Krempa [Tue, 1 Mar 2022 16:00:56 +0000 (17:00 +0100)]
vsh: Add helper for auto-removing temporary file

The vsh helpers for user-editing of contents use temporary files.
Introduce 'vshTempFile' type which automatically removes the file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDesc: Use separate flags variable for getters
Peter Krempa [Mon, 28 Feb 2022 17:32:30 +0000 (18:32 +0100)]
virsh: cmdDesc: Use separate flags variable for getters

The getters have a different set of flags. Add a variable for the getter
to avoid having to construct flags when calling the getter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdSchedinfo: Add separate variable for holding flags used for query
Peter Krempa [Mon, 28 Feb 2022 17:21:48 +0000 (18:21 +0100)]
virsh: cmdSchedinfo: Add separate variable for holding flags used for query

Instead of having two ad-hoc places which decide whether the original
flags can be used add another variable specifically for flags used for
query.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirshGetOneDisplay: Refactor formatting of URI params
Peter Krempa [Mon, 28 Feb 2022 16:59:40 +0000 (17:59 +0100)]
virshGetOneDisplay: Refactor formatting of URI params

Unconditionally format the start of the query ('?') and make delimiters
('&') part of the arguments. At the end we can trim off 1 char from the
end of the buffer unconditionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirshGetOneDisplay: Don't reuse 'xpath' variable
Peter Krempa [Mon, 28 Feb 2022 16:45:53 +0000 (17:45 +0100)]
virshGetOneDisplay: Don't reuse 'xpath' variable

Add autofreed per-xpath variables to simplify the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirshGetOneDisplay: Automaticaly free extracted data
Peter Krempa [Mon, 28 Feb 2022 16:04:35 +0000 (17:04 +0100)]
virshGetOneDisplay: Automaticaly free extracted data

Use automatic memory freeing for the temporary variables holding the
data extracted from the XML.

The code in this function was originally extracted from a loop so we can
also drop pre-clearing of the pointers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDomDisplay: Remove unneeded 'cleanup' label
Peter Krempa [Mon, 28 Feb 2022 15:35:09 +0000 (16:35 +0100)]
virsh: cmdDomDisplay: Remove unneeded 'cleanup' label

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdDomDisplay: Extract loop body fetching display URIs into 'virshGetOneDisplay'
Peter Krempa [Mon, 28 Feb 2022 15:32:50 +0000 (16:32 +0100)]
virsh: cmdDomDisplay: Extract loop body fetching display URIs into 'virshGetOneDisplay'

Separate the code so that the function is not as massive. Note that this
is a minimal extraction which does not clean up the code meant for
looping.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdEvent: Rewrite questionable event registration
Peter Krempa [Mon, 21 Feb 2022 15:52:54 +0000 (16:52 +0100)]
virsh: cmdEvent: Rewrite questionable event registration

The code registering the event handlers in 'cmdEvent' had too many
blocks of code conditional on whether just one event is being listened
to or all events.

The code can be greatly simplified by uniting the code paths and having
only one branch when filling the list of events we want to listen for.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Move 'cmdEvent' and all of its machinery to virsh-domain-event.c
Peter Krempa [Mon, 21 Feb 2022 13:02:19 +0000 (14:02 +0100)]
virsh: Move 'cmdEvent' and all of its machinery to virsh-domain-event.c

'cmdEvent' along with all the helper functions it needs is ~950 LOC.
Move it out from virsh-domain.c to virsh-domain-event.c along with the
completer function so that the new module doesn't have to expose any new
types.

Semantically this creates a new category in 'virsh help' but all other
behaviour stays the same.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Move 'virshDomainBlockJobToString' to virsh-util
Peter Krempa [Mon, 21 Feb 2022 15:12:59 +0000 (16:12 +0100)]
virsh: Move 'virshDomainBlockJobToString' to virsh-util

The helper function is used in virshBlockJobInfo and also in the
callbacks of cmdEvent. Upcoming patch is going to move out the event
code into a helper so this needs to be in a shared place.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirshEventPrint: Use automatic memory clearing
Peter Krempa [Thu, 27 Jan 2022 12:54:57 +0000 (13:54 +0100)]
virshEventPrint: Use automatic memory clearing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Use NULLSTR_EMPTY instead of ternary operator
Peter Krempa [Mon, 28 Feb 2022 14:02:41 +0000 (15:02 +0100)]
virsh: Use NULLSTR_EMPTY instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary operator
Peter Krempa [Mon, 28 Feb 2022 14:00:00 +0000 (15:00 +0100)]
virsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdRestore: Use if-else instead of ternary operator
Peter Krempa [Mon, 28 Feb 2022 14:00:00 +0000 (15:00 +0100)]
virsh: cmdRestore: Use if-else instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: doSave: Use if-else instead of ternary operator
Peter Krempa [Mon, 28 Feb 2022 14:00:00 +0000 (15:00 +0100)]
virsh: doSave: Use if-else instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdStart: Rewrite ternary operator use to standard if conditions
Peter Krempa [Mon, 28 Feb 2022 13:50:19 +0000 (14:50 +0100)]
virsh: cmdStart: Rewrite ternary operator use to standard if conditions

Rewrite the invocation of the virDomainCreate(WithFiles/Flags) APIs
based on the arguments into if-else instead of (nested) ternary
operators.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: cmdBlockcopy: Use virXMLFormatElement
Peter Krempa [Mon, 28 Feb 2022 13:48:37 +0000 (14:48 +0100)]
virsh: cmdBlockcopy: Use virXMLFormatElement

Rewrite the formatting of the block copy target xml using
virXMLFormatElement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: segmentation fault in virtqemud executing qemuDomainUndefineFlags
Boris Fiuczynski [Tue, 1 Mar 2022 17:47:59 +0000 (18:47 +0100)]
qemu: segmentation fault in virtqemud executing qemuDomainUndefineFlags

Commit 5adfb3472342741c443ac91dee0abb18b5a3d038 causes a segmentation fault.

Stack trace of thread 664419:
 #0  0x000003ff62ec553c in qemuDomainUndefineFlags (dom=0x3ff6c002810, flags=<optimized out>) at ../src/qemu/qemu_driver.c:6618
 #1  0x000003ff876a7e5c in virDomainUndefineFlags (domain=domain@entry=0x3ff6c002810, flags=<optimized out>) at ../src/libvirt-domain.c:6519
 #2  0x000002aa2b64a808 in remoteDispatchDomainUndefineFlags (server=0x2aa2c3d7880, msg=0x2aa2c3d2770, args=<optimized out>, rerr=0x3ff8287b950, client=<optimized out>)
        at src/remote/remote_daemon_dispatch_stubs.h:13080
 #3  remoteDispatchDomainUndefineFlagsHelper (server=0x2aa2c3d7880, client=<optimized out>, msg=0x2aa2c3d2770, rerr=0x3ff8287b950, args=<optimized out>, ret=0x0)
        at src/remote/remote_daemon_dispatch_stubs.h:13059
 #4  0x000003ff8758bbf4 in virNetServerProgramDispatchCall (msg=0x2aa2c3d2770, client=0x2aa2c3e3050, server=0x2aa2c3d7880, prog=0x2aa2c3d8010)
        at ../src/rpc/virnetserverprogram.c:428
 #5  virNetServerProgramDispatch (prog=0x2aa2c3d8010, server=server@entry=0x2aa2c3d7880, client=0x2aa2c3e3050, msg=0x2aa2c3d2770) at ../src/rpc/virnetserverprogram.c:302
 #6  0x000003ff8758c260 in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:140
 #7  virNetServerHandleJob (jobOpaque=0x2aa2c3e2d30, opaque=0x2aa2c3d7880) at ../src/rpc/virnetserver.c:160
 #8  0x000003ff874c49aa in virThreadPoolWorker (opaque=<optimized out>) at ../src/util/virthreadpool.c:164
 #9  0x000003ff874c3f62 in virThreadHelper (data=<optimized out>) at ../src/util/virthread.c:256
 #10 0x000003ff86c1cf8c in start_thread () from /lib64/libc.so.6
 #11 0x000003ff86c9650e in thread_start () from /lib64/libc.so.6

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoFix typo in NEWS
Tim Wiederhake [Wed, 2 Mar 2022 08:17:30 +0000 (09:17 +0100)]
Fix typo in NEWS

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
3 years agovirsh: Require option name for '--pass-fd' argument of 'qemu-monitor-command'
Peter Krempa [Tue, 1 Mar 2022 13:12:00 +0000 (14:12 +0100)]
virsh: Require option name for '--pass-fd' argument of 'qemu-monitor-command'

Require the option name for this argument as otherwise a part of the
'cmd' argument will be claimed.

Fixes: 43edde82afb8eb8b808fd985e01898a543a2ffbc
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Implement qemuDomainQemuMonitorCommandWithFiles
Peter Krempa [Fri, 28 Jan 2022 13:39:24 +0000 (14:39 +0100)]
qemu: Implement qemuDomainQemuMonitorCommandWithFiles

Add support for sending one FD from the client along with a monitor
command so that it's possible to use 'getfd' and 'add-fd' to use FDs
passed from the client with other QMP commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Implement support for virDomainQemuMonitorCommandWithFiles
Peter Krempa [Fri, 28 Jan 2022 08:24:03 +0000 (09:24 +0100)]
virsh: Implement support for virDomainQemuMonitorCommandWithFiles

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolib: Introduce 'virDomainQemuMonitorCommandWithFiles'
Peter Krempa [Thu, 27 Jan 2022 15:48:00 +0000 (16:48 +0100)]
lib: Introduce 'virDomainQemuMonitorCommandWithFiles'

This API has the same semantics as 'virDomainQemuMonitorCommand' but
accepts file descriptors which are then forwarded to qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirnetmessage: Introduce virNetMessageClearFDs
Peter Krempa [Thu, 17 Feb 2022 16:07:39 +0000 (17:07 +0100)]
virnetmessage: Introduce virNetMessageClearFDs

The helper splits out the clearing of the FDs transacted inside a
virNetMessage.

APIs transacting FDs both from and to the client at the same time will
need to clear the FDs stored in virNetMessage as the structure is
re-used for the reply and without clearing the list of FDs we'd return
the FDs sent by the client in addition to the new FDs sent by the API.t

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: block copy: Propagate 'detect_zeroes' properly into mirror definition
Peter Krempa [Wed, 23 Feb 2022 13:04:47 +0000 (14:04 +0100)]
qemu: block copy: Propagate 'detect_zeroes' properly into mirror definition

'qemuDomainPrepareDiskSourceData' propagates 'detect_zeroes' only for
the disk source image, but the mirror destination has the ambition to
replace the disk source when the job is finished, so we need to
propagate the 'detect_zeroes' setting also in that case.

Unfortunately it would become very hairy to either set 'disk->mirror'
sooner or propagate that we want this done into
'qemuDomainPrepareDiskSourceData', so the most straightforward solution
is to do the propagation inside 'qemuDomainBlockCopyCommon'.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/277
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibxl: remove redundant variable from libxlDomainJobObj
Kristina Hanicova [Mon, 28 Feb 2022 10:49:23 +0000 (11:49 +0100)]
libxl: remove redundant variable from libxlDomainJobObj

It makes no sense to have 'started' variable in the
libxlDomainJobObj as the same one is already in virDomainJobData,
but never used.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoPost-release version bump to 8.2.0
Jiri Denemark [Tue, 1 Mar 2022 09:15:17 +0000 (10:15 +0100)]
Post-release version bump to 8.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoRelease of libvirt-8.1.0
Jiri Denemark [Tue, 1 Mar 2022 09:08:21 +0000 (10:08 +0100)]
Release of libvirt-8.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoTranslated using Weblate (Korean)
Kim InSoo [Sun, 27 Feb 2022 02:16:57 +0000 (03:16 +0100)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10404 of 10404 strings)

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

Co-authored-by: Kim InSoo <simmon@nplob.com>
Signed-off-by: Kim InSoo <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
Kim InSoo [Fri, 25 Feb 2022 03:17:03 +0000 (04:17 +0100)]
Translated using Weblate (Korean)

Currently translated at 99.5% (10362 of 10404 strings)

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

Co-authored-by: Kim InSoo <simmon@nplob.com>
Signed-off-by: Kim InSoo <simmon@nplob.com>