]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agoqemu: Don't ignore resume events
Jiri Denemark [Wed, 7 Nov 2018 13:34:52 +0000 (14:34 +0100)]
qemu: Don't ignore resume events

Since commit v4.7.0-302-ge6d77a75c4 processing RESUME event is mandatory
for updating domain state. But the event handler explicitly ignored this
event in some cases. Thus the state would be wrong after a fake reboot
or when a domain was rebooted after it crashed.

BTW, the code to ignore RESUME event after SHUTDOWN didn't make sense
even before making RESUME event mandatory. Most likely it was there as a
result of careless copy&paste from qemuProcessHandleStop.

The corresponding debug message was clarified since the original state
does not have to be "paused" only and while we have a "resumed" event,
the state is called "running".

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 years agotests: Use correct function name in error path
John Ferlan [Wed, 7 Nov 2018 23:18:42 +0000 (18:18 -0500)]
tests: Use correct function name in error path

Commit id 5eb61e6846 neglected to change the name in the wrong value
output to virCgroupGetPercpuStats from virCgroupGetMemoryUsage.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agolxc: Clang is complaining about possible NULL pointer.
Julio Faracco [Wed, 7 Nov 2018 20:57:02 +0000 (18:57 -0200)]
lxc: Clang is complaining about possible NULL pointer.

The array "mount" inside lxc_container is not being checked before for
loop. Clang syntax scan is complaining about this segmentation fault.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Narrow the shutdown reconnection failure reason window
John Ferlan [Thu, 1 Nov 2018 15:19:02 +0000 (11:19 -0400)]
qemu: Narrow the shutdown reconnection failure reason window

The current qemuProcessReconnect logic paints a broad brush
determining that the shutdown reason must be crashed if it was
determined that the domain was started with -no-shutdown; however,
there's many other ways to get to the error label, so let's narrow
our reasoning window for using VIR_DOMAIN_SHUTOFF_CRASHED to the
period where we essentially know we've tried to create to the
monitor and before we were successful in opening the connection.

Failures that occur outside that window would thus be considered
as VIR_DOMAIN_SHUTOFF_UNKNOWN, at least for now.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: Restore lost shutdown reason
John Ferlan [Tue, 16 Oct 2018 12:38:27 +0000 (08:38 -0400)]
qemu: Restore lost shutdown reason

When qemuProcessReconnectHelper was introduced (commit d38897a5d)
reconnection failure used VIR_DOMAIN_SHUTOFF_FAILED; however, that
was changed in commit bda2f17d to either VIR_DOMAIN_SHUTOFF_CRASHED
or VIR_DOMAIN_SHUTOFF_UNKNOWN.

When QEMU_CAPS_NO_SHUTDOWN checking was removed in commit fe35b1ad6
the conditional state was just left at VIR_DOMAIN_SHUTOFF_CRASHED.

So introduce qemuDomainIsUsingNoShutdown which will manage the
condition when the domain was started with -no-shutdown so that
when/if reconnection failure occurs we can restore the decision
point used to determine whether CRASHED or UNKNOWN is provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolibxl: Properly dispose libxl_domain_config object
Jim Fehlig [Tue, 6 Nov 2018 22:21:19 +0000 (15:21 -0700)]
libxl: Properly dispose libxl_domain_config object

V2 of the libxl soft reset patch, which was pushed as commit da4b0fd9,
dropped the hunk that disposed of the libxl_domain_config object. Add
the missing hunk to properly dispose the object.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
6 years agolibxl: add support for soft reset
Jim Fehlig [Wed, 31 Oct 2018 17:03:37 +0000 (11:03 -0600)]
libxl: add support for soft reset

The pvops Linux kernel implements machine_ops.crash_shutdown as

static void xen_hvm_crash_shutdown(struct pt_regs *regs)
{
        native_machine_crash_shutdown(regs);
        xen_reboot(SHUTDOWN_soft_reset);
}

but currently the libxl driver does not handle the soft reset
shutdown event. As a result, the guest domain never proceeds
past xen_reboot(), making it impossible for HVM domains to save
a crash dump using kexec.

This patch adds support for handling the soft reset event by
calling libxl_domain_soft_reset() and re-enabling domain death
events, which is similar to the xl tool handling of soft reset
shutdown event.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolibxl: Remove some goto labels in libxlDomainShutdownThread
Jim Fehlig [Wed, 31 Oct 2018 16:54:14 +0000 (10:54 -0600)]
libxl: Remove some goto labels in libxlDomainShutdownThread

There are too many goto labels in libxlDomainShutdownThread. Convert the
'destroy' and 'restart' labels to helper functions, leaving only the
commonly used pattern of 'endjob' and 'cleanup' labels.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolibxl: remove redundant calls to virObjectEventStateQueue
Jim Fehlig [Wed, 31 Oct 2018 16:41:28 +0000 (10:41 -0600)]
libxl: remove redundant calls to virObjectEventStateQueue

In libxlDomainShutdownThread, virObjectEventStateQueue is needlessly
called in the destroy and restart labels. The cleanup label aready
queues whatever event was created based on libxl_shutdown_reason.
There is no need to handle destroy and restart differently.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemuBuildChrChardevStr: increase scope of qemuBuildChrChardevStr
Ján Tomko [Wed, 3 Oct 2018 15:35:40 +0000 (17:35 +0200)]
qemuBuildChrChardevStr: increase scope of qemuBuildChrChardevStr

Make it avaiable to other chardev types.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuBuildChrChardevStr: split attribute formatting
Ján Tomko [Wed, 3 Oct 2018 14:08:56 +0000 (16:08 +0200)]
qemuBuildChrChardevStr: split attribute formatting

Remove repetition of the 'socket' device and its alias.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuProcessPrepareDomain: pass xmlopt when creating monConfig
Ján Tomko [Wed, 3 Oct 2018 16:51:16 +0000 (18:51 +0200)]
qemuProcessPrepareDomain: pass xmlopt when creating monConfig

Pass the driver's xmlopt to allocate the chardev source private
data correctly.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agocheck-spacing: do not kill C++-style comments
Ján Tomko [Fri, 5 Oct 2018 11:39:03 +0000 (13:39 +0200)]
check-spacing: do not kill C++-style comments

Our HACKING guide forbids these.
There's no point in exempting these from the spacing check
if their existence is against our coding style.

Note that the non-usage of these comments itself is not enforced
by syntax check, probably because of the need to implement a C parser.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agosyntax-check: revert indentation checks
Ján Tomko [Fri, 5 Oct 2018 11:07:14 +0000 (13:07 +0200)]
syntax-check: revert indentation checks

Recent patches added indentation checks that discovered some cosmetic
issues at the cost of making this check last as long as the rest of
syntax-check combined on my system. Also, they're moving closer
to us implementing yet another C parser (docs/apibuild.py being the
other one).

Revert the following commits:
commit 11e1f11dd34f2688169c63c13ea8d99a64724369
    syntax-check: Check for incorrect indentation in function body
commit 2585a79e32e8b0d994ab35fd7c641eb9b96632e3
    build-aux:check-spacing: Introduce a new rule to check misaligned stuff in parenthesises
commit a033182f042a07ffbd4b9a50418670778ceddbf3
    build-aux:check-spacing: Add wrapper function of CheckCurlyBrackets
commit 6225626b6f0a4817d1f17de0bc5200c5d7986a3e
    build-aux:check-spacing: Add wrapper function of CheckWhiteSpaces
commit c3875129d9bd094ffe90d54fbec86624ae88c40b
    build-aux:check-spacing: Add wrapper function of KillComments
commit e995904c5691be3c21f4c6dbc1f067fe0c8e8515
    build-aux:check-spacing: Add wrapper function of CheckFunctionBody
commit 11e1f11dd34f2688169c63c13ea8d99a64724369
    syntax-check: Check for incorrect indentation in function body

This brings the speed of the script to a tolerable level and lets it
focus on the more visible issues.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agodocs: Enhance polkit documentation to describe secondary connection
John Ferlan [Sun, 23 Sep 2018 15:56:46 +0000 (11:56 -0400)]
docs: Enhance polkit documentation to describe secondary connection

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

Since commit 8259255 usage of a primary connection driver for
a virConnect has been modified to open (virConnectOpen) and use
a connection to the specific driver in order to handle the API
calls to/for that driver. This causes some confusion and issues
for ACL polkit rule scripts to know exactly which driver by
name will be used.

Add some documentation describing the processing of the primary
and secondary connection as well as the list of the connect_driver
names used for each driver.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoaccess: Modify the VIR_ERR_ACCESS_DENIED to include driverName
John Ferlan [Sun, 14 Oct 2018 14:09:32 +0000 (10:09 -0400)]
access: Modify the VIR_ERR_ACCESS_DENIED to include driverName

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

Changes made to manage and utilize a secondary connection
driver to APIs outside the scope of the primary connection
driver have resulted in some confusion processing polkit rules
since the simple "access denied" error message doesn't provide
enough of a clue when combined with the "authentication failed:
access denied by policy" as to which connection driver refused
or failed the ACL check.

In order to provide some context, let's modify the existing
"access denied" error returne from the various vir*EnsureACL
API's to provide the connection driver name that is causing
the failure. This should provide the context for writing the
polkit rules that would allow access via the driver.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agonwfilter: Instantiate active filter bindings during driver init
Nikolay Shirokovskiy [Mon, 15 Oct 2018 08:26:28 +0000 (11:26 +0300)]
nwfilter: Instantiate active filter bindings during driver init

Commit 57f5621f modified nwfilterInstantiateFilter to detect when
a filter binding was already present before attempting to add the
new binding and instantiate it. Additionally, the change to
nwfilterStateInitialize to call virNWFilterBindingObjListLoadAllConfigs
(from commit c21679fa3f) to load active domain filter bindings, but
not instantiate them eventually leads to a problem for the QEMU
driver reconnection logic after a daemon restart where the filter
bindings would no longer be instantiated.

Subsequent commit f14c37ce4c replaced the nwfilterInstantiateFilter
with virDomainConfNWFilterInstantiate which uses @ignoreExists to
detect presence of the filter and still did not restore the filter
instantiation call when making the new nwfilter bindings logic active.

Thus in order to instantiate any active domain filter, we will call
virNWFilterBuildAll with 'false' to indicate the need to go through
all the active bindings calling virNWFilterInstantiateFilter to
instantiate the filter bindings.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agonodedev: Document the udevEventHandleThread
John Ferlan [Thu, 18 Oct 2018 14:22:18 +0000 (10:22 -0400)]
nodedev: Document the udevEventHandleThread

Commit cdbe1332 neglected to document the API. So let's add some
details about the algorithm and why it was used to help future
readers understand the issues encountered.

NB: Management of the processing udev device notification is a
delicate balance between the udev process, the scheduler, and when
exactly the data from/for the socket is received. The balance is
particularly important for environments when multiple devices are
added into the system more or less simultaneously such as is done
for mdev or SRIOV. In these cases old libudev blocking on the udev
recv() occurs more frequently. It's expected that future devices
will follow similar algorithms. Even though the algorithm does
present some challenges for older OS's (such as Centos 6), trying
to rewrite the algorithm to fit both models would be more complex
and involve pulling the monitor object out of the private data
lockable object and would need to be guarded by a separate lock.
Devising such an algorithm to work around issues with older OS's
at the expense of more modern OS algorithms in newer event processing
code may result in unexpected issues, so the choice is to encourage
use of newer OS's with newer udev event processing code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemu: Dissolve qemuBuildVhostuserCommandLine in qemuBuildInterfaceCommandLine
Michal Privoznik [Thu, 1 Nov 2018 17:21:12 +0000 (18:21 +0100)]
qemu: Dissolve qemuBuildVhostuserCommandLine in qemuBuildInterfaceCommandLine

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

The qemuBuildVhostuserCommandLine builds command line for
vhostuser type interfaces. It is duplicating some code of the
function it is called from (qemuBuildInterfaceCommandLine)
because of the way it's called. If we merge it into the caller
not only we save a few lines but we also enable checks that we
would have to duplicate otherwise (e.g. QoS availability).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemuBuildInterfaceCommandLine: Reorder VIR_FREE
Michal Privoznik [Fri, 2 Nov 2018 15:12:45 +0000 (16:12 +0100)]
qemuBuildInterfaceCommandLine: Reorder VIR_FREE

When we have variables A, B, C then there are two ways to free
them. Either in the order they are declared or the reversed one.
Any other ordering is confusing. In this commit I'm reordering
calls to VIR_FREE in the reversed order.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoPost-release version bump to 4.10.0
Michal Privoznik [Mon, 5 Nov 2018 07:46:39 +0000 (08:46 +0100)]
Post-release version bump to 4.10.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoLibvirt release 4.9.0
Daniel Veillard [Sun, 4 Nov 2018 16:50:44 +0000 (17:50 +0100)]
Libvirt release 4.9.0

* docs/news.xml: updated for release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
6 years agonews: Update for 4.9.0 release
Andrea Bolognani [Fri, 2 Nov 2018 13:53:40 +0000 (14:53 +0100)]
news: Update for 4.9.0 release

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
6 years agorpc: fix handling of SSH auth failure code
Daniel P. Berrangé [Fri, 31 Aug 2018 10:13:39 +0000 (11:13 +0100)]
rpc: fix handling of SSH auth failure code

The result of libssh2_userauth_password is being assigned to 'ret' in
one branch and 'rc' in the other branch. Checks are all done against the
'ret' variable, so one branch never does the correct check.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agonews: Update news for vfio-ap support
Boris Fiuczynski [Thu, 18 Oct 2018 14:54:08 +0000 (16:54 +0200)]
news: Update news for vfio-ap support

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Chris Venteicher <cventeic@redhat.com>
6 years agoqemu: vfio-ap device support
Boris Fiuczynski [Thu, 18 Oct 2018 14:54:07 +0000 (16:54 +0200)]
qemu: vfio-ap device support

Adjusting domain format documentation, adding device address
support and adding command line generation for vfio-ap.
Since only one mediated hostdev with model vfio-ap is supported a check
disallows to define domains with more than one such hostdev device.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Chris Venteicher <cventeic@redhat.com>
6 years agoqemu: add vfio-ap capability
Boris Fiuczynski [Thu, 18 Oct 2018 14:54:06 +0000 (16:54 +0200)]
qemu: add vfio-ap capability

Introduce vfio-ap capability.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Chris Venteicher <cventeic@redhat.com>
6 years agodocs: fix repology link for qemu-kvm package
Pavel Hrdina [Tue, 23 Oct 2018 15:16:36 +0000 (16:16 +0100)]
docs: fix repology link for qemu-kvm package

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agodocs: Fix minimum supported version
Martin Kletzander [Tue, 23 Oct 2018 09:21:04 +0000 (10:21 +0100)]
docs: Fix minimum supported version

We already have that in the code (commit c1bc9c662b411), we just forgot to
mention that in the docs.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoutil: Fix typo vcups -> vcpus
Martin Kletzander [Mon, 22 Oct 2018 13:37:54 +0000 (14:37 +0100)]
util: Fix typo vcups -> vcpus

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoqemu: Fix IOThread pids lost after qemuProcessReconnect
Jie Wang [Wed, 17 Oct 2018 17:14:42 +0000 (01:14 +0800)]
qemu: Fix IOThread pids lost after qemuProcessReconnect

IOThread pids info will lost after libvirtd restart, then
if we call pinIOThread, sched_setaffinity will be called with
pid 0, not IOThread pid. So pinIOThread cannot work normally.

Signed-off-by: Jie Wang <wangjie88.huawei.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Avoid memleak on failure to format blockjobs
Eric Blake [Thu, 18 Oct 2018 20:05:22 +0000 (15:05 -0500)]
qemu: Avoid memleak on failure to format blockjobs

virXMLFormatElement() frees attrBuf on success, but not necessarily
on failure. Most other callers of this function take the time to
reset attrBuf afterwords, but qemuDomainObjPrivateXMLFormatBlockjobs()
was relying on it succeeding, and could thus result in a memory leak.

Signed-off-by: Eric Blake <eblake@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirfile: Take symlink into account in virFileIsSharedFixFUSE
Michal Privoznik [Thu, 18 Oct 2018 12:57:19 +0000 (14:57 +0200)]
virfile: Take symlink into account in virFileIsSharedFixFUSE

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

Weirdly enough, there can be symlinks in the path we are trying
to fix. If it is the case our clever algorithm that finds matches
against mount table won't work. Canonicalize path at the
beginning then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agovirFileInData: Preserve errno on error
Michal Privoznik [Mon, 8 Oct 2018 15:36:10 +0000 (17:36 +0200)]
virFileInData: Preserve errno on error

The virFileInData() function should return to the caller if the
current position the passed file is in is a data section or a
hole (and also how long the current section is). At any rate,
upon return from this function (be it successful or not) the
original position in the file is restored. This may mess up with
errno which might have been set earlier. Save the errno into a
local variable so it can be restored for the caller's sake.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
6 years agoqemu: qemuProcessInit: Drop unused config variable
Bjoern Walk [Thu, 18 Oct 2018 08:08:04 +0000 (10:08 +0200)]
qemu: qemuProcessInit: Drop unused config variable

The QEMU @cfg config variable is unused in context of qemuProcessInit,
let's drop it.

Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agonwfilter: Fix learning address thread shutdown
Nikolay Shirokovskiy [Fri, 12 Oct 2018 07:23:07 +0000 (10:23 +0300)]
nwfilter: Fix learning address thread shutdown

If the learning thread is configured to learn on all ethernet frames
(which is hardcoded) then chances are high that there is a packet on
every iteration of inspecting frames loop. As result we will hang on
shutdown because we don't check threadsTerminate if there is packet.

Let's just check termination conditions on every iteration. Since
we'll check each iteration, the check after pcap_next essentially
is unnecessary since on failure we'd loop back to the top and timeout
and then fail.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoutil: Fix a typo in comments of virresctrl.c
Wang Huaqiang [Wed, 17 Oct 2018 08:27:36 +0000 (16:27 +0800)]
util: Fix a typo in comments of virresctrl.c

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoconf: Fix typos in pcie controllers' name
Han Han [Wed, 17 Oct 2018 01:10:57 +0000 (09:10 +0800)]
conf: Fix typos in pcie controllers' name

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoqemu: Put format=raw onto cmd line for SCSI passthrough
Michal Privoznik [Fri, 12 Oct 2018 09:09:56 +0000 (11:09 +0200)]
qemu: Put format=raw onto cmd line for SCSI passthrough

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

When doing a SCSI passthrough we don't put format= onto the
command line. This causes qemu to probe the format automatically
which ends up in a warning in the domain log and possible qemu
disabling writes to the first block (according to the warning
message).

Based-on-work-of: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoconf: Fix bug in finding alloc through matching vcpus
Wang Huaqiang [Fri, 12 Oct 2018 10:24:54 +0000 (18:24 +0800)]
conf: Fix bug in finding alloc through matching vcpus

The @alloc object returned by virDomainResctrlVcpuMatch is not
properly referenced and un-referenced in virDomainCachetuneDefParse.

This patch fixes this problem.

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agotests: use real capabilities for net-vhostuser
Ján Tomko [Thu, 4 Oct 2018 17:44:55 +0000 (19:44 +0200)]
tests: use real capabilities for net-vhostuser

Commit ed5aa85f371aebb0103e712f9a103d011ab9ae43
    qemu: don't use chardev FD passing for vhostuser backend
altered the legacy DO_TEST macro.

Run the test against capabilities of QEMU 2.5.0 (which did not
support QEMU_CAPS_CHARDEV_FD_PASS) as well as the latest version.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add virtio-rng-egd-unix
Ján Tomko [Thu, 4 Oct 2018 17:27:17 +0000 (19:27 +0200)]
tests: add virtio-rng-egd-unix

Test RNG devices connected to EGD via UNIX sockets.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add usb-redir-unix
Ján Tomko [Thu, 4 Oct 2018 17:24:01 +0000 (19:24 +0200)]
tests: add usb-redir-unix

Test USB redirdevs backed by UNIX sockets.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add console-virtio-unix
Ján Tomko [Thu, 4 Oct 2018 17:15:15 +0000 (19:15 +0200)]
tests: add console-virtio-unix

Test a virtio console backed by a UNIX socket.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add channel-unix-guestfwd
Ján Tomko [Thu, 4 Oct 2018 17:11:43 +0000 (19:11 +0200)]
tests: add channel-unix-guestfwd

Test guestfwd channels backed by UNIX sockets.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add parallel-unix-chardev
Ján Tomko [Thu, 4 Oct 2018 17:03:12 +0000 (19:03 +0200)]
tests: add parallel-unix-chardev

Test creating a parallel port backed by a UNIX socket.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: add smartcard-passthrough-unix
Ján Tomko [Thu, 4 Oct 2018 16:24:53 +0000 (18:24 +0200)]
tests: add smartcard-passthrough-unix

Test CCID smartcard passthrough from a unix listen socket.
Use the capabilities of QEMU 2.5.0 which did not support
chardev FD passing and the latest one, which (at the time
of this commit) it does.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoutil: storage: Properly parse URIs with missing trailing slash
Peter Krempa [Thu, 11 Oct 2018 10:22:21 +0000 (12:22 +0200)]
util: storage: Properly parse URIs with missing trailing slash

The URI parser used by libvirt does not populate uri->path if the
trailing slash is missing. The code virStorageSourceParseBackingURI
would then not populate src->path.

As only NBD network disks are allowed to have the 'name' field in the
XML defining the disk source omitted we'd generate an invalid XML which
we'd not parse again.

Fix it by populating src->path with an empty string if the uri is
lacking slash.

As pointed out above NBD is special in this case since we actually allow
it being NULL. The URI path is used as export name. Since an empty
export does not make sense the new approach clears the src->path if the
trailing slash is present but nothing else.

Add test cases now to cover all the various cases for NBD and non-NBD
uris as there was to time only 1 test abusing the quirk witout slash for
NBD and all other URIs contained the slash or in case of NBD also the
export name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoutil: storage: Rename '@path' argument of virStorageSourceParseBackingURI
Peter Krempa [Thu, 11 Oct 2018 10:18:39 +0000 (12:18 +0200)]
util: storage: Rename '@path' argument of virStorageSourceParseBackingURI

The name is misleading. Change it to 'uristr' so that 'path' can be
reused in the proper context later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agovirsh: Fix regression with duplicated error messages
Eric Blake [Thu, 11 Oct 2018 16:29:58 +0000 (11:29 -0500)]
virsh: Fix regression with duplicated error messages

Commit 4f4c3b13 (v3.3) fixed an issue where performing cleanup of
libvirt objects could sometimes lose error messages, by adding code
to copy the libvirt error into last_error prior to cleanup paths.
However, it caused a regression: on other paths, some errors are now
printed twice, if libvirt still remembers in its thread-local
storage that an error was set even after virsh cleared last_error.
For example:

$ virsh -c test:///default snapshot-delete test blah
error: Domain snapshot not found: no domain snapshot with matching name 'blah'
error: Domain snapshot not found: no domain snapshot with matching name 'blah'

Fix things by telling libvirt to discard any thread-local errors at
the same time virsh prints an error message (whether or not the libvirt
error is the same as what is stored in last_error).

Update the virsh-undefine testsuite (partially reverting portions of
commit b620bdee, by removing -q, to more easily pinpoint which commands
are causing which messages), now that there is only one error message
instead of two.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agorpc: reproducible genprotocol output
Olaf Hering [Wed, 10 Oct 2018 09:15:37 +0000 (11:15 +0200)]
rpc: reproducible genprotocol output

If the same source gets built twice ('build same source on different
hosts at different times') the resulting files may differ.
Fix this by sorting the hash keys before usage.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
6 years agoqemu: Remove unused qemuProcessAutostartAll
John Ferlan [Thu, 11 Oct 2018 22:26:00 +0000 (18:26 -0400)]
qemu: Remove unused qemuProcessAutostartAll

The function was never defined in source, just the protoype.

Signed-off-by: John Ferlan <jferlan@redhat.com>
6 years agovirfiletest: Load mock on Linux only
Michal Privoznik [Thu, 11 Oct 2018 08:36:02 +0000 (10:36 +0200)]
virfiletest: Load mock on Linux only

The mock is built on Linux only. Therefore we should load it only
on Linux too. This fixes the FreeBSD build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agovirfile: Rework virFileIsSharedFixFUSE
Michal Privoznik [Tue, 9 Oct 2018 11:08:07 +0000 (13:08 +0200)]
virfile: Rework virFileIsSharedFixFUSE

There are couple of things wrong with the current implementation.
The first one is that in the first loop the code tries to build a
list of fuse.glusterfs mount points. Well, since the strings are
allocated in a temporary buffer and are not duplicated this
results in wrong decision made later in the code.

The second problem is that the code does not take into account
subtree mounts. For instance, if there's a fuse.gluster mounted
at /some/path and another FS mounted at /some/path/subdir the
code would not recognize this subdir mount.

Reported-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovirFileIsSharedFSType: Detect direct mount points
Michal Privoznik [Tue, 9 Oct 2018 13:23:10 +0000 (15:23 +0200)]
virFileIsSharedFSType: Detect direct mount points

If the given path is already a mount point (e.g. a bind mount of
a file, or simply a direct mount point of a FS), then our code
fails to detect that because the first thing it does is cutting
off part after last slash '/'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovirfiletst: Test virFileIsSharedFS
Michal Privoznik [Tue, 9 Oct 2018 11:06:00 +0000 (13:06 +0200)]
virfiletst: Test virFileIsSharedFS

Introduce some basic test cases for virFileIsSharedFS(). More
will be added later. In order to achieve desired result, mocks
for setmntent() and statfs() need to be invented because the
first thing that virFileIsSharedFS() does is calling the latter.
If it finds a FUSE mount it'll call the former.

The mock might look a bit complicated, but in fact it's quite
simple. The test sets LIBVIRT_MTAB env variable to hold the
absolute path to a file containing mount table. Then, statfs()
returns matching FS it finds, and setmntent() is there just to
replace /proc/mounts with the file the test wants to load.

Adding this test also exposed a bug we have - because we assume
the given path points to a file we cut off what we assume is a
file name to obtain directory path and only then we call
statfs(). This is buggy because the passed path could be already
a mount point.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovirfiletest: Fix test name prefix for virFileInData test
Michal Privoznik [Tue, 9 Oct 2018 12:50:53 +0000 (14:50 +0200)]
virfiletest: Fix test name prefix for virFileInData test

Because of lacking virTestCounterReset() call, the old test cases
name was preserved.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovirfile: fix cast-align error
Marc Hartmayer [Wed, 10 Oct 2018 08:04:04 +0000 (10:04 +0200)]
virfile: fix cast-align error

On s390x the struct member f_type of statsfs is hard coded to 'unsigned
int'. Change virFileIsSharedFixFUSE() to take a 'long long int' and use
a temporary to avoid pointer-casting.

This fixes the following error:
../../src/util/virfile.c:3578:38: error: cast increases required alignment of target type [-Werror=cast-align]
         virFileIsSharedFixFUSE(path, (long *) &sb.f_type);

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
6 years agovirresctrl: remove bogus virResetLastError
Ján Tomko [Fri, 5 Oct 2018 14:34:51 +0000 (16:34 +0200)]
virresctrl: remove bogus virResetLastError

virFileReadValueUint does not log errors for non-existient files,
it merely returns -2.

Commit 12093f1 introduced this.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: use "id" instead of deprecated "name" for -net
Ján Tomko [Mon, 8 Oct 2018 14:36:05 +0000 (16:36 +0200)]
qemu: use "id" instead of deprecated "name" for -net

-net name= will be deprecated in QEMU 3.1:
commit 101625a4d4ac7e96227a156bc5f6d21a9cc383cd
    net: Deprecate the "name" parameter of -net
git describe: v3.0.0-791-g101625a4d4

Use the id option instead, supported since QEMU 1.2:
commit 6687b79d636cd60ed9adb1177d0d946b58fa7717
    convert net_client_init() to OptsVisitor
git describe: v1.0-3564-g6687b79d63 contains: v1.2.0-rc0~142^2~8

Thankfully, libvirt only uses -net for non-PCI, non-virtio NICs
on ARM.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
6 years agoqemu: hotplug: Refactor qemuDomainAttachDeviceDiskLiveInternal
Peter Krempa [Tue, 25 Sep 2018 13:07:01 +0000 (15:07 +0200)]
qemu: hotplug: Refactor qemuDomainAttachDeviceDiskLiveInternal

We now explicitly handle media change elsewhere so we can drop the
switch statement. This will also make it more intuitive once CDROM
device hotplug might be supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Split out media change code from disk hotplug
Peter Krempa [Tue, 25 Sep 2018 12:47:36 +0000 (14:47 +0200)]
qemu: hotplug: Split out media change code from disk hotplug

Disk hotplug has slightly different semantics from media changing. Move
the media change code out and add proper initialization of the new
source object and proper cleanups if something fails.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: conf: Export qemuAddSharedDisk
Peter Krempa [Tue, 25 Sep 2018 13:02:25 +0000 (15:02 +0200)]
qemu: conf: Export qemuAddSharedDisk

In cases where we know the device is a disk we can avoid using the full
device definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Add wrapper for disk hotplug code
Peter Krempa [Tue, 25 Sep 2018 12:23:08 +0000 (14:23 +0200)]
qemu: hotplug: Add wrapper for disk hotplug code

The disk hotplug code also overloads media change which is not ideal.
This will allow splitting out of the media change code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Prepare disk source for media changing
Peter Krempa [Thu, 27 Sep 2018 14:50:55 +0000 (16:50 +0200)]
qemu: hotplug: Prepare disk source for media changing

The disk storage source needs to be prepared if we want to use -blockdev
or secrets for the new media image. It does not hurt to do the same for
the legacy hotplug code as well.

Unfortunately helpers like qemuDomainPrepareDiskSource take
virDomainDiskDef as an argument and it would be hard to fix them to take
an explicit source, so the function also temporarily replaces disk->src
for the new source in this function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Be explicit about old/new sources when changing media
Peter Krempa [Thu, 4 Oct 2018 15:56:46 +0000 (17:56 +0200)]
qemu: hotplug: Be explicit about old/new sources when changing media

Some functions require us to replace disk->src with the new source for
them to work properly. To avoid confusion all places which allow
explicit virStorageSource should get the appropriate definition.

The legacy code fortunately does not need anything from the old source
so that does not require modifications.

Blockdev does require the old definition so we'll pass it explicitly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Allow specifying explicit source for disk backend hotplug code
Peter Krempa [Thu, 4 Oct 2018 15:49:00 +0000 (17:49 +0200)]
qemu: hotplug: Allow specifying explicit source for disk backend hotplug code

Since the code is also used when changing media we need to allow
specifying explicit source for which we are going to prepare. With this
change callers don't have to replace disk->src with the new source
definition for generating these.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Remove code handling possible missing disk source format
Peter Krempa [Thu, 4 Oct 2018 13:32:37 +0000 (15:32 +0200)]
qemu: hotplug: Remove code handling possible missing disk source format

qemu media changing code tried to assume old media's format for the new
one if that was not specified. Since the format will always be present
it does not make sense to keep the code around.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: hotplug: Don't pretend that we support secrets for media change
Peter Krempa [Thu, 4 Oct 2018 12:34:01 +0000 (14:34 +0200)]
qemu: hotplug: Don't pretend that we support secrets for media change

Old media changing code does not bother setting up the secrets for new
media or actually removing/adding of the corresponding objects.

Additionally it uses secrets setup for the old image to be removed as
the secret for the new image which is wrong.

Remove the support for secrets while changing media for the legacy
approach. The only reasonable way to fix it is when using blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoRevert "qemu: hotplug: consolidate media change code paths"
Peter Krempa [Tue, 25 Sep 2018 12:21:27 +0000 (14:21 +0200)]
Revert "qemu: hotplug: consolidate media change code paths"

While the idea was good the implementation not so much as we need to
take into account the old disk data and the new source. The code will be
consolidated later in a different way.

This reverts commit 663b1d55de652201b19d875f0eff730dc28e689e.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoRevert "qemu: hotplug: Prepare disk source in qemuDomainAttachDeviceDiskLive"
Peter Krempa [Mon, 24 Sep 2018 14:49:01 +0000 (16:49 +0200)]
Revert "qemu: hotplug: Prepare disk source in qemuDomainAttachDeviceDiskLive"

Preparing the storage source prior to assigning the alias will not work
as the names of the certain objects depend on the alias for the legacy
hotplug case as we generate the object names for the secrets based on
the alias.

This reverts commit 192fdaa614e3800255048a8a70c1292ccf18397a.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agovirt-host-validate: Fix build on non-Linux
Michal Privoznik [Mon, 8 Oct 2018 07:10:07 +0000 (09:10 +0200)]
virt-host-validate: Fix build on non-Linux

For non-Linux platforms we have
virHostValidateCGroupControllers() stub which only reports an
error. But we are not marking the ignored arguments the way we
should.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovirt-host-validate: require freezer for LXC
Pavel Hrdina [Sat, 29 Sep 2018 19:47:50 +0000 (21:47 +0200)]
virt-host-validate: require freezer for LXC

Cgroup freezer support for LXC was added in libvirt-0.7.2.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovirt-host-validate: rewrite cgroup detection to use util/vircgroup
Pavel Hrdina [Sat, 29 Sep 2018 19:37:22 +0000 (21:37 +0200)]
virt-host-validate: rewrite cgroup detection to use util/vircgroup

This removes code duplication and simplifies cgroup detection.
As a drawback we will not have separate messages to enable cgroup
controller in kernel or to mount it.  On the other side the rewrite
adds support for cgroup v2.

The kernel config support was wrong because it was parsing
'/proc/self/cgroup' instead of '/proc/cgroups/' file.

The mount suggestion is removed as well because it will not work
with cgroup v2.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: add hybrid tests
Pavel Hrdina [Tue, 18 Sep 2018 07:43:47 +0000 (09:43 +0200)]
vircgrouptest: add hybrid tests

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: add cgroup v2 tests
Pavel Hrdina [Tue, 18 Sep 2018 07:43:09 +0000 (09:43 +0200)]
vircgrouptest: add cgroup v2 tests

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: prepare validateCgroup for cgroupv2
Pavel Hrdina [Tue, 18 Sep 2018 07:41:44 +0000 (09:41 +0200)]
vircgrouptest: prepare validateCgroup for cgroupv2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: add detect mounts test for hybrid cgroups
Pavel Hrdina [Tue, 18 Sep 2018 08:09:20 +0000 (10:09 +0200)]
vircgrouptest: add detect mounts test for hybrid cgroups

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: add detect mounts test for cgroup v2
Pavel Hrdina [Tue, 18 Sep 2018 08:08:35 +0000 (10:08 +0200)]
vircgrouptest: add detect mounts test for cgroup v2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: prepare testCgroupDetectMounts for cgroup v2
Pavel Hrdina [Mon, 24 Sep 2018 10:28:04 +0000 (12:28 +0200)]
vircgrouptest: prepare testCgroupDetectMounts for cgroup v2

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgrouptest: introduce initFakeFS and cleanupFakeFS helpers
Pavel Hrdina [Mon, 24 Sep 2018 10:22:54 +0000 (12:22 +0200)]
vircgrouptest: introduce initFakeFS and cleanupFakeFS helpers

We need to configure multiple env variables for each set of tests so
create helper functions to do that.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroupmock: add support to test cgroup v2
Pavel Hrdina [Tue, 18 Sep 2018 10:33:21 +0000 (12:33 +0200)]
vircgroupmock: add support to test cgroup v2

We need to create the cgroup v2 sysfs the same way as we do for
cgroup v1.

This introduces new VIR_CGROUP_MOCK_MODE env variable which will
configure which cgroup mode each test requires.  There are three
different modes:

    - legacy: only cgroup v1 is available and it's the default mode
    - hybrid: both cgroup v1 and cgroup v2 are available and have some
        controllers
    - unified: only cgroup v2 is available

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroupmock: change cgroup prefix
Pavel Hrdina [Tue, 18 Sep 2018 07:28:54 +0000 (09:28 +0200)]
vircgroupmock: change cgroup prefix

Remove the trailing '/' from prefix.  This change is required in order
to introduce tests for unified cgroups.  They are usually mounted in
'/sys/fs/cgroup'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: add support for hybrid configuration
Pavel Hrdina [Fri, 28 Sep 2018 17:53:05 +0000 (19:53 +0200)]
vircgroup: add support for hybrid configuration

This enables to use both cgroup v1 and v2 at the same time together
with libvirt.  It is supported by kernel and there is valid use-case,
not all controllers are implemented in cgroup v2 so there might be
configurations where administrator would enable these missing
controllers in cgroup v1.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: register cgroup v2 backend
Pavel Hrdina [Sat, 15 Sep 2018 09:13:13 +0000 (11:13 +0200)]
vircgroup: register cgroup v2 backend

All mandatory callbacks are implemented for cgroup v2 backend so we
can register it now.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetCpuacctStat
Pavel Hrdina [Fri, 17 Aug 2018 15:00:00 +0000 (17:00 +0200)]
vircgroup: introduce virCgroupV2GetCpuacctStat

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetCpuacctUsage
Pavel Hrdina [Fri, 17 Aug 2018 14:59:49 +0000 (16:59 +0200)]
vircgroup: introduce virCgroupV2GetCpuacctUsage

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2SupportsCpuBW
Pavel Hrdina [Fri, 17 Aug 2018 14:59:27 +0000 (16:59 +0200)]
vircgroup: introduce virCgroupV2SupportsCpuBW

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)CpuCfsQuota
Pavel Hrdina [Fri, 17 Aug 2018 14:59:02 +0000 (16:59 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)CpuCfsQuota

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)CpuCfsPeriod
Pavel Hrdina [Fri, 17 Aug 2018 14:58:40 +0000 (16:58 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)CpuCfsPeriod

In order to set CPU cfs period using cgroup v2 'cpu.max' interface
we need to load the current value of CPU cfs quota first because
format of 'cpu.max' interface is '$quota $period' and in order to
change 'period' we need to write 'quota' as well.  Writing only one
number changes only 'quota'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)CpuShares
Pavel Hrdina [Fri, 17 Aug 2018 14:58:15 +0000 (16:58 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)CpuShares

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetMemSwapUsage
Pavel Hrdina [Fri, 17 Aug 2018 14:57:52 +0000 (16:57 +0200)]
vircgroup: introduce virCgroupV2GetMemSwapUsage

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)MemSwapHardLimit
Pavel Hrdina [Fri, 17 Aug 2018 14:57:30 +0000 (16:57 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)MemSwapHardLimit

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)MemorySoftLimit
Pavel Hrdina [Fri, 17 Aug 2018 14:57:00 +0000 (16:57 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)MemorySoftLimit

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)MemoryHardLimit
Pavel Hrdina [Fri, 17 Aug 2018 14:56:31 +0000 (16:56 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)MemoryHardLimit

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetMemoryUsage
Pavel Hrdina [Fri, 17 Aug 2018 14:56:00 +0000 (16:56 +0200)]
vircgroup: introduce virCgroupV2GetMemoryUsage

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetMemoryStat
Pavel Hrdina [Fri, 17 Aug 2018 14:55:34 +0000 (16:55 +0200)]
vircgroup: introduce virCgroupV2GetMemoryStat

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2SetMemory
Pavel Hrdina [Fri, 17 Aug 2018 14:54:59 +0000 (16:54 +0200)]
vircgroup: introduce virCgroupV2SetMemory

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceWriteBps
Pavel Hrdina [Fri, 17 Aug 2018 14:54:36 +0000 (16:54 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceWriteBps

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceReadBps
Pavel Hrdina [Fri, 17 Aug 2018 14:54:11 +0000 (16:54 +0200)]
vircgroup: introduce virCgroupV2(Set|Get)BlkioDeviceReadBps

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>