2010-12-16 16:10:54 +00:00
|
|
|
/*
|
|
|
|
* qemu_cgroup.h: QEMU cgroup management
|
|
|
|
*
|
2014-07-08 07:59:49 +00:00
|
|
|
* Copyright (C) 2006-2007, 2009-2014 Red Hat, Inc.
|
2010-12-16 16:10:54 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-12-16 16:10:54 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#pragma once
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "virusb.h"
|
|
|
|
#include "vircgroup.h"
|
|
|
|
#include "domain_conf.h"
|
|
|
|
#include "qemu_conf.h"
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2016-02-15 15:15:58 +00:00
|
|
|
int qemuSetupImageCgroup(virDomainObjPtr vm,
|
|
|
|
virStorageSourcePtr src);
|
|
|
|
int qemuTeardownImageCgroup(virDomainObjPtr vm,
|
|
|
|
virStorageSourcePtr src);
|
2019-01-16 14:49:07 +00:00
|
|
|
int qemuSetupImageChainCgroup(virDomainObjPtr vm,
|
|
|
|
virStorageSourcePtr src);
|
|
|
|
int qemuTeardownImageChainCgroup(virDomainObjPtr vm,
|
|
|
|
virStorageSourcePtr src);
|
2017-11-21 12:33:07 +00:00
|
|
|
int qemuSetupInputCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainInputDefPtr dev);
|
|
|
|
int qemuTeardownInputCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainInputDefPtr dev);
|
2015-11-19 13:35:46 +00:00
|
|
|
int qemuSetupHostdevCgroup(virDomainObjPtr vm,
|
2013-04-29 17:15:26 +00:00
|
|
|
virDomainHostdevDefPtr dev)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2013-04-29 17:15:26 +00:00
|
|
|
int qemuTeardownHostdevCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainHostdevDefPtr dev)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2017-02-22 15:33:12 +00:00
|
|
|
int qemuSetupMemoryDevicesCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainMemoryDefPtr mem);
|
|
|
|
int qemuTeardownMemoryDevicesCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainMemoryDefPtr mem);
|
2016-11-18 10:17:51 +00:00
|
|
|
int qemuSetupRNGCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainRNGDefPtr rng);
|
|
|
|
int qemuTeardownRNGCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainRNGDefPtr rng);
|
2016-11-18 10:45:44 +00:00
|
|
|
int qemuSetupChardevCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainChrDefPtr dev);
|
|
|
|
int qemuTeardownChardevCgroup(virDomainObjPtr vm,
|
|
|
|
virDomainChrDefPtr dev);
|
2017-07-25 15:49:43 +00:00
|
|
|
int qemuConnectCgroup(virDomainObjPtr vm);
|
|
|
|
int qemuSetupCgroup(virDomainObjPtr vm,
|
2015-01-16 11:25:50 +00:00
|
|
|
size_t nnicindexes,
|
|
|
|
int *nicindexes);
|
2011-07-21 02:10:31 +00:00
|
|
|
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
|
|
|
|
unsigned long long period,
|
|
|
|
long long quota);
|
2015-03-27 12:28:59 +00:00
|
|
|
int qemuSetupCgroupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask);
|
2016-02-16 13:43:37 +00:00
|
|
|
int qemuSetupGlobalCpuCgroup(virDomainObjPtr vm);
|
2018-04-05 19:06:55 +00:00
|
|
|
int qemuSetupCgroupForExtDevices(virDomainObjPtr vm,
|
|
|
|
virQEMUDriverPtr driver);
|
2016-02-01 15:50:54 +00:00
|
|
|
int qemuRemoveCgroup(virDomainObjPtr vm);
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2016-09-07 11:11:59 +00:00
|
|
|
typedef struct _qemuCgroupEmulatorAllNodesData qemuCgroupEmulatorAllNodesData;
|
|
|
|
typedef qemuCgroupEmulatorAllNodesData *qemuCgroupEmulatorAllNodesDataPtr;
|
|
|
|
struct _qemuCgroupEmulatorAllNodesData {
|
|
|
|
virCgroupPtr emulatorCgroup;
|
|
|
|
char *emulatorMemMask;
|
|
|
|
};
|
|
|
|
|
|
|
|
int qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup,
|
|
|
|
qemuCgroupEmulatorAllNodesDataPtr *data);
|
2016-09-13 10:24:02 +00:00
|
|
|
void qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesDataPtr data);
|
2016-09-07 11:11:59 +00:00
|
|
|
|
2016-11-15 10:28:51 +00:00
|
|
|
extern const char *const defaultDeviceACL[];
|