]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agovircgroup: introduce virCgroupV2GetBlkioIoServiced
Pavel Hrdina [Fri, 17 Aug 2018 14:51:54 +0000 (16:51 +0200)]
vircgroup: introduce virCgroupV2GetBlkioIoServiced

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

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2BindMount
Pavel Hrdina [Fri, 28 Sep 2018 18:40:11 +0000 (20:40 +0200)]
vircgroup: introduce virCgroupV2BindMount

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

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

In cgroups v2 we need to handle threads and processes differently.
If you need to move a process you need to write its pid into
cgrou.procs file and it will move the process with all its threads
as well.  The whole process will be moved if you use tid of any thread.

In order to move only threads at first we need to create threaded group
and after that we can write the relevant thread tids into cgroup.threads
file.  Threads can be moved only into cgroups that are children of
cgroup of its process.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2MakeGroup
Pavel Hrdina [Tue, 18 Sep 2018 15:49:19 +0000 (17:49 +0200)]
vircgroup: introduce virCgroupV2MakeGroup

When creating cgroup hierarchy we need to enable controllers in the
parent cgroup in order to be usable.  That means writing "+{controller}"
into cgroup.subtree_control file.  We can enable only controllers that
are enabled for parent cgroup, that means we need to do that for the
whole cgroup tree.

Cgroups for threads needs to be handled differently in cgroup v2.  There
are two types of controllers:

    - domain controllers: these cannot be enabled for threads
    - threaded controllers: these can be enabled for threads

In addition there are multiple types of cgroups:

    - domain: normal cgroup
    - domain threaded: a domain cgroup that serves as root for threaded
                       cgroups
    - domain invalid: invalid cgroup, can be changed into threaded, this
                      is the default state if you create subgroup inside
                      domain threaded group or threaded group
    - threaded: threaded cgroup which can have domain threaded or
                threaded as parent group

In order to create threaded cgroup it's sufficient to write "threaded"
into cgroup.type file, it will automatically make parent cgroup
"domain threaded" if it was only "domain".  In case the parent cgroup
is already "domain threaded" or "threaded" it will modify only the type
of current cgroup.  After that we can enable threaded controllers.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2PathOfController
Pavel Hrdina [Sun, 19 Aug 2018 17:45:49 +0000 (19:45 +0200)]
vircgroup: introduce virCgroupV2PathOfController

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2GetAnyController
Pavel Hrdina [Sun, 19 Aug 2018 17:43:04 +0000 (19:43 +0200)]
vircgroup: introduce virCgroupV2GetAnyController

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2DetectControllers
Pavel Hrdina [Tue, 25 Sep 2018 12:37:21 +0000 (14:37 +0200)]
vircgroup: introduce virCgroupV2DetectControllers

Cgroup v2 has only single mount point for all controllers.  The list
of controllers is stored in cgroup.controllers file, name of controllers
are separated by space.

In cgroup v2 there is no cpuacct controller, the cpu.stat file always
exists with usage stats.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2StealPlacement
Pavel Hrdina [Tue, 18 Sep 2018 07:21:53 +0000 (09:21 +0200)]
vircgroup: introduce virCgroupV2StealPlacement

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2ValidatePlacement
Pavel Hrdina [Tue, 18 Sep 2018 07:17:24 +0000 (09:17 +0200)]
vircgroup: introduce virCgroupV2ValidatePlacement

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2DetectPlacement
Pavel Hrdina [Fri, 14 Sep 2018 21:46:42 +0000 (23:46 +0200)]
vircgroup: introduce virCgroupV2DetectPlacement

If the placement was copied from parent or set to absolute path
there is nothing to do, otherwise set the placement based on
process placement from /proc/self/cgroup or /proc/{pid}/cgroup.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2DetectMounts
Pavel Hrdina [Tue, 25 Sep 2018 12:34:47 +0000 (14:34 +0200)]
vircgroup: introduce virCgroupV2DetectMounts

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2CopyPlacement
Pavel Hrdina [Tue, 25 Sep 2018 12:34:01 +0000 (14:34 +0200)]
vircgroup: introduce virCgroupV2CopyPlacement

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: introduce virCgroupV2ValidateMachineGroup
Pavel Hrdina [Fri, 14 Sep 2018 16:19:53 +0000 (18:19 +0200)]
vircgroup: introduce virCgroupV2ValidateMachineGroup

When reconnecting to a domain we are validating the cgroup name.
In case of cgroup v2 we need to validate only the new format for host
without systemd '{machinename}.libvirt-{drivername}' or scope name
generated by systemd.

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

We cannot detect only mount points to figure out whether cgroup v2
is available because systemd uses cgroup v2 for process tracking and
all controllers are mounted as cgroup v1 controllers.

To make sure that this is no the situation we need to check
'cgroup.controllers' file if it's not empty to make sure that cgroup
v2 is not mounted only for process tracking.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoutil: introduce cgroup v2 files
Pavel Hrdina [Tue, 18 Sep 2018 15:48:33 +0000 (17:48 +0200)]
util: introduce cgroup v2 files

Place cgroup v2 backend type before cgroup v1 to make it obvious
that cgroup v2 is preferred implementation.

Following patches will introduce support for hybrid configuration
which will allow us to use both at the same time, but we should
prefer cgroup v2 regardless.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agorpm: disable some features on riscv64
Daniel P. Berrangé [Fri, 5 Oct 2018 12:59:31 +0000 (13:59 +0100)]
rpm: disable some features on riscv64

numctl, numad and zfs-fuse are not available on riscv64 targets

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
6 years agoqemu: fix comment in qemuSecurityChownCallback
Ján Tomko [Wed, 3 Oct 2018 12:49:27 +0000 (14:49 +0200)]
qemu: fix comment in qemuSecurityChownCallback

s/chmod/chown/

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: fix up permissions for pre-created UNIX sockets
Ján Tomko [Wed, 3 Oct 2018 12:10:13 +0000 (14:10 +0200)]
qemu: fix up permissions for pre-created UNIX sockets

My commit d6b8838 fixed the uid:gid for the pre-created UNIX sockets
but did not account for the different umask of libvirtd and QEMU.
Since commit 0e1a1a8c we set umask to '0002' for the QEMU process.
Manually tune-up the permissions to match what we would have gotten
if QEMU had created the socket.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovirFileIsSharedFSType: Check for fuse.glusterfs too
Michal Privoznik [Thu, 27 Sep 2018 14:19:31 +0000 (16:19 +0200)]
virFileIsSharedFSType: Check for fuse.glusterfs too

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

GlusterFS is typically safe when it comes to migration. It's a
network FS after all. However, it can be mounted via FUSE driver
they provide. If that is the case we fail to identify it and
think migration is not safe and require VIR_MIGRATE_UNSAFE flag.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agocpu_map: Use and install Icelake model definitions
Jiri Denemark [Wed, 3 Oct 2018 11:00:07 +0000 (13:00 +0200)]
cpu_map: Use and install Icelake model definitions

In commit v4.7.0-168-g993d85ae5e I introduced two Icelake CPU models,
but failed to actually include them in the CPU map index.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 years agosecurity: dac: also label listen UNIX sockets
Ján Tomko [Thu, 27 Sep 2018 14:13:18 +0000 (16:13 +0200)]
security: dac: also label listen UNIX sockets

We switched to opening mode='bind' sockets ourselves:
commit 30fb2276d88b275dc2aad6ddd28c100d944b59a5
    qemu: support passing pre-opened UNIX socket listen FD
in v4.5.0-rc1~251

Then fixed qemuBuildChrChardevStr to change libvirtd's label
while creating the socket:
commit b0c6300fc42bbc3e5eb0b236392f7344581c5810
    qemu: ensure FDs passed to QEMU for chardevs have correct SELinux labels
v4.5.0-rc1~52

Also add labeling of these sockets to the DAC driver.
Instead of duplicating the logic which decides whether libvirt should
pre-create the socket, assume an existing path meaning that it was created
by libvirt.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemu: Introduce qemuDomainUpdateQEMUCaps()
Marc Hartmayer [Thu, 20 Sep 2018 17:44:48 +0000 (19:44 +0200)]
qemu: Introduce qemuDomainUpdateQEMUCaps()

This function updates the used QEMU capabilities of @vm by querying
the QEMU capabilities cache.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Use VIR_STEAL_PTR macro
Marc Hartmayer [Thu, 20 Sep 2018 17:44:47 +0000 (19:44 +0200)]
qemu: Use VIR_STEAL_PTR macro

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agonwfilter: Alter virNWFilterSnoopReqLeaseDel logic
John Ferlan [Fri, 28 Sep 2018 00:36:58 +0000 (20:36 -0400)]
nwfilter: Alter virNWFilterSnoopReqLeaseDel logic

Move the fetch of @ipAddrLeft to after the goto skip_instantiate
and remove the (req->binding) guard since we know that as long
as req->binding is created, then req->threadkey is filled in.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotests: Use STRNEQ_NULLABLE
John Ferlan [Thu, 27 Sep 2018 23:54:05 +0000 (19:54 -0400)]
tests: Use STRNEQ_NULLABLE

It's possible that the @outbuf and/or @errbuf could be NULL
and thus we need to use the right comparison macro.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotests: Alter logic in testCompareXMLToDomConfig
John Ferlan [Thu, 27 Sep 2018 23:09:44 +0000 (19:09 -0400)]
tests: Alter logic in testCompareXMLToDomConfig

Rather than initialize actualconfig and expectconfig before
having the possibility that libxlDriverConfigNew could fail
and thus land in cleanup, let's just move them and return
immediately upon failure.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoutil: Data overrun may lead to divide by zero
John Ferlan [Thu, 27 Sep 2018 22:49:41 +0000 (18:49 -0400)]
util: Data overrun may lead to divide by zero

Commit 87a8a30d6 added the function based on the virsh function,
but used an unsigned long long instead of a double and thus that
limits the maximum result.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotests: Inline a sysconf call for linuxCPUStatsToBuf
John Ferlan [Thu, 27 Sep 2018 22:46:36 +0000 (18:46 -0400)]
tests: Inline a sysconf call for linuxCPUStatsToBuf

While unlikely, sysconf(_SC_CLK_TCK) could fail leading to
indeterminate results for the subsequent division. So let's
just remove the # define and inline the same change.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolibxl: Fix possible object refcnt issue
John Ferlan [Thu, 27 Sep 2018 21:41:07 +0000 (17:41 -0400)]
libxl: Fix possible object refcnt issue

When libxlDomainMigrationDstPrepare adds the @args to an
virNetSocketAddIOCallback using libxlMigrateDstReceive as
the target of the virNetSocketIOFunc @func with the knowledge
that the libxlMigrateDstReceive will virObjectUnref @args
at the end thus not needing to Unref during normal processing
for libxlDomainMigrationDstPrepare.

However, Coverity believes there's an issue with this. The
problem is there can be @nsocks virNetSocketAddIOCallback's
added, but only one virObjectUnref. That means the first
one done will Unref and the subsequent callers may not get
the @args (or @opaque) as they expected. If there's only
one socket returned from virNetSocketNewListenTCP, then sure
that works. However, if it returned more than one there's
going to be a problem.

To resolve this, since we start with 1 reference from the
virObjectNew for @args, we will add 1 reference for each
time @args is used for virNetSocketAddIOCallback. Then
since libxlDomainMigrationDstPrepare would be done with
@args, move it's virObjectUnref from the error: label to
the done: label (since error: falls through). That way
once the last IOCallback is done, then @args will be freed.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agolxc: Only check @nparams in lxcDomainBlockStatsFlags
John Ferlan [Thu, 27 Sep 2018 10:54:12 +0000 (06:54 -0400)]
lxc: Only check @nparams in lxcDomainBlockStatsFlags

Remove the "!params" check from the condition since it's possible
someone could pass a non NULL value there, but a 0 for the nparams
and thus continue on.  The external API only checks if @nparams is
non-zero, then check for NULL @params.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconfigure: remove regexec and getgrnam_r checks
Ján Tomko [Tue, 25 Sep 2018 15:06:52 +0000 (17:06 +0200)]
configure: remove regexec and getgrnam_r checks

Introduced by:
commit 635ae38979bbb2659a21dfaa57e7c762ae8d4e88
commit 1b745219c7507595d4a09c89aa6a331eaa039e31
But their HAVE_ counterparts were never used.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: do not check for kill
Ján Tomko [Tue, 25 Sep 2018 14:54:50 +0000 (16:54 +0200)]
configure: do not check for kill

Introduced by:
commit 3c37a171a2dea8048dfee90e1be2875f30f7eb15
    Add check for kill() to fix build of cgroups on win32

Made redundant by:
commit 02f1fd41f60c90b636ba0e18b37d4624fe47135d
    cgroup macros refactoring, part 1

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: remove check for poll.h
Ján Tomko [Tue, 25 Sep 2018 15:01:03 +0000 (17:01 +0200)]
configure: remove check for poll.h

Introduced by:
commit b38d045dea41ea1fb41e546e61388116eddb6b3c
    Remove use of sys/poll.h on mingw

Made redundant by:
  commit 0c97e70b74434b4baca9bbfc19c14bf7ff2ef304
    Update event loop example programs to demonstrate best practice

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: remove check for regex.h
Ján Tomko [Tue, 25 Sep 2018 14:57:08 +0000 (16:57 +0200)]
configure: remove check for regex.h

Introduced by:
commit 542039fab09bd46f419702667cd342ae8f88b498
    Fully support mingw builds

Made redundant by:
commit ec8a2d0327ee214111bca04c39ab61a9fc247f28
    regex: gnulib guarantees that we have regex support

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: remove duplicit check for sys/un.h
Ján Tomko [Tue, 25 Sep 2018 14:52:31 +0000 (16:52 +0200)]
configure: remove duplicit check for sys/un.h

Commit 7c08fcc4 added this one.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: sort AC_CHECK_HEADERS argument list
Ján Tomko [Tue, 25 Sep 2018 14:49:53 +0000 (16:49 +0200)]
configure: sort AC_CHECK_HEADERS argument list

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoconfigure: sort AC_CHECK_FUNCS_ONCE arguments
Ján Tomko [Wed, 26 Sep 2018 13:08:30 +0000 (15:08 +0200)]
configure: sort AC_CHECK_FUNCS_ONCE arguments

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoconfigure: split common header and function checks
Ján Tomko [Tue, 25 Sep 2018 13:49:33 +0000 (15:49 +0200)]
configure: split common header and function checks

Use one line per entry, to work better with line-based git history.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoPost-release version bump to 4.9.0
Ján Tomko [Wed, 26 Sep 2018 13:25:09 +0000 (15:25 +0200)]
Post-release version bump to 4.9.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoRelease of libvirt-4.8.0
Daniel Veillard [Mon, 1 Oct 2018 15:16:02 +0000 (17:16 +0200)]
Release of libvirt-4.8.0

Signed-off-by: Daniel Veillard <veillard@redhat.com>
- docs/news.xml: updated for release

6 years agonews: Update for 4.8.0 release
Fabiano Fidêncio [Mon, 1 Oct 2018 14:40:12 +0000 (16:40 +0200)]
news: Update for 4.8.0 release

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
6 years agotests: reintroduce tests for libxl's legacy nested setting
Jim Fehlig [Wed, 26 Sep 2018 17:31:19 +0000 (11:31 -0600)]
tests: reintroduce tests for libxl's legacy nested setting

The preferred location for setting the nested CPU flag changed in
Xen 4.10 and is advertised via the LIBXL_HAVE_BUILDINFO_NESTED_HVM
define.  Commit 95d19cd0 changed libxl to use the new preferred
location but unconditionally changed the tests, causing 'make check'
failures against Xen < 4.10 that do not contain the new location.

Commit e94415d5 fixed the failures by only running the tests when
LIBXL_HAVE_BUILDINFO_NESTED_HVM is defined. Since libvirt supports
several versions of Xen that use the old nested location, it is
prudent to test the flag is set correctly. This patch reintroduces
the tests for the legacy location of the nested setting.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agouml: umlConnectOpen: Check the driver pointer before accessing it
Julio Faracco [Fri, 28 Sep 2018 04:13:28 +0000 (01:13 -0300)]
uml: umlConnectOpen: Check the driver pointer before accessing it

The pointer related to uml_driver needs to be checked before its usage
inside the function. Some attributes of the driver are being accessed
while the pointer is NULL considering the current logic.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoRevert "vircgroup: cleanup controllers not managed by systemd on error"
Pavel Hrdina [Thu, 27 Sep 2018 14:11:19 +0000 (16:11 +0200)]
Revert "vircgroup: cleanup controllers not managed by systemd on error"

This reverts commit 1602aa28f820ada66f707cef3e536e8572fbda1e.

There is no need to call virCgroupRemove() nor virCgroupFree() if
virCgroupEnableMissingControllers() fails because it will not modify
'group' at all.

The cleanup of directories is done in virCgroupMakeGroup().

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agospec: Build ceph and gluster support everywhere
Jiri Denemark [Thu, 27 Sep 2018 14:08:53 +0000 (16:08 +0200)]
spec: Build ceph and gluster support everywhere

Both ceph and gluster have been built on RHEL on all architectures for
some time, there's no need to limit them to x86_64.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 years agospec: Set correct TLS priority
Jiri Denemark [Thu, 27 Sep 2018 14:00:15 +0000 (16:00 +0200)]
spec: Set correct TLS priority

RHEL-7 is the only system where gnutls is too old to support @LIBVIRT
specifier.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
6 years agoqemu: Temporarily disable metadata locking
Michal Privoznik [Thu, 27 Sep 2018 13:03:03 +0000 (15:03 +0200)]
qemu: Temporarily disable metadata locking

Turns out, there are couple of bugs that prevent this feature
from being operational. Given how close to the release we are
disable the feature temporarily. Hopefully, it can be enabled
back after all the bugs are fixed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agovircgroupv1: fix build on non-linux OSes
Pavel Hrdina [Thu, 27 Sep 2018 10:22:20 +0000 (12:22 +0200)]
vircgroupv1: fix build on non-linux OSes

Cgroups are linux specific and we need to make sure that the code is
compiled only on linux.  On different OSes it fails the compilation:

../../src/util/vircgroupv1.c:65:19: error: variable has incomplete type 'struct mntent'
    struct mntent entry;
                  ^
../../src/util/vircgroupv1.c:65:12: note: forward declaration of 'struct mntent'
    struct mntent entry;
           ^
../../src/util/vircgroupv1.c:74:12: error: implicit declaration of function 'getmntent_r' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    while (getmntent_r(mounts, &entry, buf, sizeof(buf)) != NULL) {
           ^
../../src/util/vircgroupv1.c:814:39: error: use of undeclared identifier 'MS_NOSUID'
    if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
                                      ^
../../src/util/vircgroupv1.c:814:49: error: use of undeclared identifier 'MS_NODEV'
    if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
                                                ^
../../src/util/vircgroupv1.c:814:58: error: use of undeclared identifier 'MS_NOEXEC'
    if (mount("tmpfs", root, "tmpfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, opts) < 0) {
                                                         ^
../../src/util/vircgroupv1.c:841:65: error: use of undeclared identifier 'MS_BIND'
            if (mount(src, group->legacy[i].mountPoint, "none", MS_BIND,
                                                                ^

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: include system headers only on linux
Pavel Hrdina [Thu, 27 Sep 2018 10:19:17 +0000 (12:19 +0200)]
vircgroup: include system headers only on linux

All the system headers are used only if we are compiling on linux
and they all are present otherwise we would have seen build errors
because in our tests/vircgrouptest.c we use only __linux__ to check
whether to skip the cgroup tests or not.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: remove VIR_CGROUP_SUPPORTED
Pavel Hrdina [Thu, 27 Sep 2018 10:16:57 +0000 (12:16 +0200)]
vircgroup: remove VIR_CGROUP_SUPPORTED

tests/vircgrouptest.c uses #ifdef __linux__ for a long time and no
failure was reported so far so it's safe to assume that __linux__ is
good enough to guard cgroup code.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovirsh: Require explicit --domain for domxml-to-native
Jiri Denemark [Wed, 26 Sep 2018 07:59:08 +0000 (09:59 +0200)]
virsh: Require explicit --domain for domxml-to-native

The domxml-to-native virsh command accepts either --xml or --domain
option followed by a file or domain name respectively. The --domain
option is documented as required, which means an argument with no option
is treated as --xml. Commit v4.3.0-127-gd86531daf2 broke this by making
--domain optional and thus an argument with no option was treated as
--domain.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 years agotests: libxl: skip tests with nested_hvm
Ján Tomko [Tue, 25 Sep 2018 12:48:35 +0000 (14:48 +0200)]
tests: libxl: skip tests with nested_hvm

Commit 95d19cd unconditionally adjusted the tests to account for
the conditional move of the nested_hvm setting location.

Run the affected tests only for the new setup (witnessed by
LIBXL_HAVE_BUILDINFO_NESTED_HVM).

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemu: Remove network type limitation for qemuARPGetInterfaces
Lin Ma [Tue, 25 Sep 2018 09:37:24 +0000 (17:37 +0800)]
qemu: Remove network type limitation for qemuARPGetInterfaces

Let's ignore the checking of interface type when we call the function
qemuARPGetInterfaces to get IP from host's arp table.

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Chen Hanxiao <chenhanxiao@gmail.com>
6 years agosecurity: Don't try to lock NULL paths
Michal Privoznik [Mon, 24 Sep 2018 13:22:25 +0000 (15:22 +0200)]
security: Don't try to lock NULL paths

It may happen that in the list of paths/disk sources to relabel
there is a disk source. If that is the case, the path is NULL. In
that case, we shouldn't try to lock the path. It's likely a
network disk anyway and therefore there is nothing to lock.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agosecurity: Grab a reference to virSecurityManager for transactions
Michal Privoznik [Thu, 20 Sep 2018 12:22:13 +0000 (14:22 +0200)]
security: Grab a reference to virSecurityManager for transactions

This shouldn't be needed per-se. Security manager shouldn't
disappear during transactions - it's immutable. However, it
doesn't hurt to grab a reference either - transaction code uses
it after all.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirSecuritySELinuxContextListFree: Don't leak list->items
Michal Privoznik [Wed, 26 Sep 2018 07:19:31 +0000 (09:19 +0200)]
virSecuritySELinuxContextListFree: Don't leak list->items

This array is allocated in virSecuritySELinuxContextListAppend()
but never freed. This commit is essentially the same as ca25026.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirdbus: Use the mnemonic macros for dbus_bool_t values
Marc Hartmayer [Fri, 21 Sep 2018 13:02:04 +0000 (15:02 +0200)]
virdbus: Use the mnemonic macros for dbus_bool_t values

Use the mnemonic macros of libdbus for 1 (TRUE) and 0 (FALSE).

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirdbus: Report a debug message that dbus_watch_handle() has failed
Marc Hartmayer [Fri, 21 Sep 2018 13:02:03 +0000 (15:02 +0200)]
virdbus: Report a debug message that dbus_watch_handle() has failed

Report a debug message if dbus_watch_handle() returns FALSE.
dbus_watch_handle() returns FALSE if there wasn't enough memory for
reading or writing.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirdbus: Unref the D-Bus connection when closing
Marc Hartmayer [Fri, 21 Sep 2018 13:02:02 +0000 (15:02 +0200)]
virdbus: Unref the D-Bus connection when closing

As documented at
https://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#ga2522ac5075dfe0a1535471f6e045e1ee
the creator of a non-shared D-Bus connection has to release the last
reference after closing for freeing.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agovirdbus: Grab a ref as long as the while loop is executed
Marc Hartmayer [Fri, 21 Sep 2018 13:02:01 +0000 (15:02 +0200)]
virdbus: Grab a ref as long as the while loop is executed

Grab a ref for info->bus (a DBus connection) as long as the while loop
is running. With the grabbed reference it is ensured that info->bus
isn't freed as long as the while loop is executed. This is necessary
as it's allowed to drop the last ref for the bus connection in a
handler.

There was already a bug of this kind in libdbus itself:
https://bugs.freedesktop.org/show_bug.cgi?id=15635.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Avoid duplicate resume events and state changes
Jiri Denemark [Wed, 12 Sep 2018 12:34:33 +0000 (14:34 +0200)]
qemu: Avoid duplicate resume events and state changes

The only place where VIR_DOMAIN_EVENT_RESUMED should be generated is the
RESUME event handler to make sure we don't generate duplicate events or
state changes. In the worse case the duplicity can revert or cover
changes done by other event handlers.

For example, after QEMU sent RESUME, BLOCK_IO_ERROR, and STOP events
we could happily mark the domain as running and report
VIR_DOMAIN_EVENT_RESUMED to registered clients.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Map running reason to resume event detail
Jiri Denemark [Tue, 11 Sep 2018 13:13:08 +0000 (15:13 +0200)]
qemu: Map running reason to resume event detail

Thanks to the previous commit the RESUME event handler knows what reason
should be used when changing the domain state to VIR_DOMAIN_RUNNING, but
the emitted VIR_DOMAIN_EVENT_RESUMED event still uses a generic
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED detail. Luckily, the event detail can
be easily deduced from the running reason, which saves us from having to
pass one more value to the handler.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Pass running reason to RESUME event handler
Jiri Denemark [Mon, 10 Sep 2018 17:41:53 +0000 (19:41 +0200)]
qemu: Pass running reason to RESUME event handler

Whenever we get the RESUME event from QEMU, we change the state of the
affected domain to VIR_DOMAIN_RUNNING with VIR_DOMAIN_RUNNING_UNPAUSED
reason. This is fine if the domain is resumed unexpectedly, but when we
sent "cont" to QEMU we usually have a better reason for the state
change. The better reason is used in qemuProcessStartCPUs which also
sets the domain state to running if qemuMonitorStartCPUs reports
success. Thus we may end up with two state updates in a row, but the
final reason is correct.

This patch is a preparation for dropping the state change done in
qemuMonitorStartCPUs for which we need to pass the actual running reason
to the RESUME event handler and use it there instead of
VIR_DOMAIN_RUNNING_UNPAUSED.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Report more appropriate running reasons
Jiri Denemark [Tue, 11 Sep 2018 17:26:07 +0000 (19:26 +0200)]
qemu: Report more appropriate running reasons

This patch replaces some rather generic VIR_DOMAIN_RUNNING_UNPAUSED
reasons when changing domain state to running with more specific ones.
All of them are done when libvirtd reconnects to an existing domain
after being restarted and sees an unfinished migration or save.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agoqemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT
Jiri Denemark [Mon, 10 Sep 2018 13:10:54 +0000 (15:10 +0200)]
qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT

VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT was defined but not used anywhere
in our event generation code. This fixes qemuDomainRevertToSnapshot to
properly report why the domain was resumed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
6 years agolxc_monitor: Avoid AB / BA lock race
Mark Asselstine [Mon, 24 Sep 2018 15:11:35 +0000 (11:11 -0400)]
lxc_monitor: Avoid AB / BA lock race

A deadlock situation can occur when autostarting a LXC domain 'guest'
due to two threads attempting to take opposing locks while holding
opposing locks (AB BA problem). Thread A takes and holds the 'vm' lock
while attempting to take the 'client' lock, meanwhile, thread B takes
and holds the 'client' lock while attempting to take the 'vm' lock.

The potential for this can be seen as follows:

Thread A:
virLXCProcessAutostartDomain (takes vm lock)
 --> virLXCProcessStart
  --> virLXCProcessConnectMonitor
   --> virLXCMonitorNew
    --> virNetClientSetCloseCallback (wants client lock)

Thread B:
virNetClientIncomingEvent (takes client lock)
 --> virNetClientIOHandleInput
  --> virNetClientCallDispatch
   --> virNetClientCallDispatchMessage
    --> virNetClientProgramDispatch
     --> virLXCMonitorHandleEventInit
      --> virLXCProcessMonitorInitNotify (wants vm lock)

Since these threads are scheduled independently and are preemptible it
is possible for the deadlock scenario to occur where each thread locks
their first lock but both will fail to get their second lock and just
spin forever. You get something like:

virLXCProcessAutostartDomain (takes vm lock)
 --> virLXCProcessStart
  --> virLXCProcessConnectMonitor
   --> virLXCMonitorNew
<...>
virNetClientIncomingEvent (takes client lock)
 --> virNetClientIOHandleInput
  --> virNetClientCallDispatch
   --> virNetClientCallDispatchMessage
    --> virNetClientProgramDispatch
     --> virLXCMonitorHandleEventInit
      --> virLXCProcessMonitorInitNotify (wants vm lock but spins)
<...>
    --> virNetClientSetCloseCallback (wants client lock but spins)

Neither thread ever gets the lock it needs to be able to continue
while holding the lock that the other thread needs.

The actual window for preemption which can cause this deadlock is
rather small, between the calls to virNetClientProgramNew() and
execution of virNetClientSetCloseCallback(), both in
virLXCMonitorNew(). But it can be seen in real world use that this
small window is enough.

By moving the call to virNetClientSetCloseCallback() ahead of
virNetClientProgramNew() we can close any possible chance of the
deadlock taking place. There should be no other implications to the
move since the close callback (in the unlikely event was called) will
spin on the vm lock. The remaining work that takes place between the
old call location of virNetClientSetCloseCallback() and the new
location is unaffected by the move.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovircgroup: rename controllers to legacy
Pavel Hrdina [Mon, 24 Sep 2018 23:17:02 +0000 (01:17 +0200)]
vircgroup: rename controllers to legacy

With the introduction of cgroup v2 there are new names used with
cgroups based on which version is used:

    - legacy: cgroup v1
    - unified: cgroup v2
    - hybrid: cgroup v1 and cgroup v2

Let's use 'legacy' instead of 'cgroupv1' or 'controllers' in our code.

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: rename virCgroupController into virCgroupV1Controller
Pavel Hrdina [Tue, 18 Sep 2018 15:36:06 +0000 (17:36 +0200)]
vircgroup: rename virCgroupController into virCgroupV1Controller

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpusetCpus
Pavel Hrdina [Mon, 20 Aug 2018 08:01:10 +0000 (10:01 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpusetCpus

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpusetMemoryMigrate
Pavel Hrdina [Mon, 20 Aug 2018 08:00:57 +0000 (10:00 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpusetMemoryMigrate

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpusetMems
Pavel Hrdina [Mon, 20 Aug 2018 08:00:04 +0000 (10:00 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpusetMems

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)FreezerState
Pavel Hrdina [Thu, 16 Aug 2018 16:22:08 +0000 (18:22 +0200)]
vircgroup: extract virCgroupV1(Set|Get)FreezerState

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetCpuacctStat
Pavel Hrdina [Mon, 20 Aug 2018 07:58:33 +0000 (09:58 +0200)]
vircgroup: extract virCgroupV1GetCpuacctStat

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetCpuacct*Usage
Pavel Hrdina [Mon, 20 Aug 2018 07:57:51 +0000 (09:57 +0200)]
vircgroup: extract virCgroupV1GetCpuacct*Usage

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1SupportsCpuBW
Pavel Hrdina [Fri, 17 Aug 2018 14:23:14 +0000 (16:23 +0200)]
vircgroup: extract virCgroupV1SupportsCpuBW

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpuCfsQuota
Pavel Hrdina [Fri, 17 Aug 2018 14:22:56 +0000 (16:22 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpuCfsQuota

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpuCfsPeriod
Pavel Hrdina [Fri, 17 Aug 2018 14:22:30 +0000 (16:22 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpuCfsPeriod

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)CpuShares
Pavel Hrdina [Wed, 5 Sep 2018 18:11:38 +0000 (20:11 +0200)]
vircgroup: extract virCgroupV1(Set|Get)CpuShares

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Allow|Deny)AllDevices
Pavel Hrdina [Wed, 5 Sep 2018 18:10:02 +0000 (20:10 +0200)]
vircgroup: extract virCgroupV1(Allow|Deny)AllDevices

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Allow|Deny)Device
Pavel Hrdina [Wed, 5 Sep 2018 18:08:48 +0000 (20:08 +0200)]
vircgroup: extract virCgroupV1(Allow|Deny)Device

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetMemSwapUsage
Pavel Hrdina [Fri, 17 Aug 2018 14:19:08 +0000 (16:19 +0200)]
vircgroup: extract virCgroupV1GetMemSwapUsage

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)Memory*Limit
Pavel Hrdina [Fri, 17 Aug 2018 14:18:38 +0000 (16:18 +0200)]
vircgroup: extract virCgroupV1(Set|Get)Memory*Limit

They all need virCgroupV1GetMemoryUnlimitedKB() so it's easier to
move them in one commit.

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetMemoryUsage
Pavel Hrdina [Fri, 17 Aug 2018 13:56:33 +0000 (15:56 +0200)]
vircgroup: extract virCgroupV1GetMemoryUsage

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetMemoryStat
Pavel Hrdina [Fri, 17 Aug 2018 13:55:47 +0000 (15:55 +0200)]
vircgroup: extract virCgroupV1GetMemoryStat

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1SetMemory
Pavel Hrdina [Fri, 17 Aug 2018 13:53:41 +0000 (15:53 +0200)]
vircgroup: extract virCgroupV1SetMemory

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWriteBps
Pavel Hrdina [Mon, 24 Sep 2018 10:21:21 +0000 (12:21 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWriteBps

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioDeviceReadBps
Pavel Hrdina [Mon, 24 Sep 2018 10:21:07 +0000 (12:21 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioDeviceReadBps

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWriteIops
Pavel Hrdina [Mon, 24 Sep 2018 10:20:50 +0000 (12:20 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWriteIops

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioDeviceReadIops
Pavel Hrdina [Mon, 24 Sep 2018 10:20:31 +0000 (12:20 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioDeviceReadIops

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWeight
Pavel Hrdina [Mon, 24 Sep 2018 10:20:19 +0000 (12:20 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioDeviceWeight

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetBlkioIoDeviceServiced
Pavel Hrdina [Fri, 17 Aug 2018 13:30:21 +0000 (15:30 +0200)]
vircgroup: extract virCgroupV1GetBlkioIoDeviceServiced

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1GetBlkioIoServiced
Pavel Hrdina [Fri, 17 Aug 2018 13:29:39 +0000 (15:29 +0200)]
vircgroup: extract virCgroupV1GetBlkioIoServiced

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1(Set|Get)BlkioWeight
Pavel Hrdina [Fri, 17 Aug 2018 13:28:50 +0000 (15:28 +0200)]
vircgroup: extract virCgroupV1(Set|Get)BlkioWeight

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
6 years agovircgroup: extract virCgroupV1SetOwner
Pavel Hrdina [Fri, 17 Aug 2018 08:09:49 +0000 (10:09 +0200)]
vircgroup: extract virCgroupV1SetOwner

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>