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 "vircgroup.h"
|
|
|
|
#include "qemu_conf.h"
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuSetupImageCgroup(virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
int qemuTeardownImageCgroup(virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
int qemuSetupImageChainCgroup(virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
int qemuTeardownImageChainCgroup(virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
int qemuSetupInputCgroup(virDomainObj *vm,
|
|
|
|
virDomainInputDef *dev);
|
|
|
|
int qemuTeardownInputCgroup(virDomainObj *vm,
|
|
|
|
virDomainInputDef *dev);
|
|
|
|
int qemuSetupHostdevCgroup(virDomainObj *vm,
|
|
|
|
virDomainHostdevDef *dev)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuTeardownHostdevCgroup(virDomainObj *vm,
|
|
|
|
virDomainHostdevDef *dev)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuSetupMemoryDevicesCgroup(virDomainObj *vm,
|
|
|
|
virDomainMemoryDef *mem);
|
|
|
|
int qemuTeardownMemoryDevicesCgroup(virDomainObj *vm,
|
|
|
|
virDomainMemoryDef *mem);
|
|
|
|
int qemuSetupRNGCgroup(virDomainObj *vm,
|
|
|
|
virDomainRNGDef *rng);
|
|
|
|
int qemuTeardownRNGCgroup(virDomainObj *vm,
|
|
|
|
virDomainRNGDef *rng);
|
|
|
|
int qemuSetupChardevCgroup(virDomainObj *vm,
|
|
|
|
virDomainChrDef *dev);
|
|
|
|
int qemuTeardownChardevCgroup(virDomainObj *vm,
|
|
|
|
virDomainChrDef *dev);
|
|
|
|
int qemuSetupCgroup(virDomainObj *vm,
|
2015-01-16 11:25:50 +00:00
|
|
|
size_t nnicindexes,
|
|
|
|
int *nicindexes);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuSetupCgroupForExtDevices(virDomainObj *vm,
|
|
|
|
virQEMUDriver *driver);
|
2010-12-16 16:10:54 +00:00
|
|
|
|
2016-09-07 11:11:59 +00:00
|
|
|
typedef struct _qemuCgroupEmulatorAllNodesData qemuCgroupEmulatorAllNodesData;
|
|
|
|
struct _qemuCgroupEmulatorAllNodesData {
|
2021-03-11 07:16:13 +00:00
|
|
|
virCgroup *emulatorCgroup;
|
2016-09-07 11:11:59 +00:00
|
|
|
char *emulatorMemMask;
|
|
|
|
};
|
|
|
|
|
2016-11-15 10:28:51 +00:00
|
|
|
extern const char *const defaultDeviceACL[];
|