2021-05-12 10:01:31 -07:00
|
|
|
/*
|
|
|
|
* Copyright Intel Corp. 2020-2021
|
|
|
|
*
|
|
|
|
* ch_domain.h: header file for domain manager's Cloud-Hypervisor driver functions
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ch_conf.h"
|
|
|
|
#include "ch_monitor.h"
|
2021-09-08 11:01:15 -07:00
|
|
|
#include "virchrdev.h"
|
2021-12-10 20:34:40 +00:00
|
|
|
#include "vircgroup.h"
|
2022-09-05 15:57:01 +02:00
|
|
|
#include "virdomainjob.h"
|
2021-05-12 10:01:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _virCHDomainObjPrivate virCHDomainObjPrivate;
|
|
|
|
struct _virCHDomainObjPrivate {
|
2021-12-10 20:34:40 +00:00
|
|
|
virChrdevs *chrdevs;
|
2021-12-10 20:34:41 +00:00
|
|
|
virCHDriver *driver;
|
2021-05-12 10:01:31 -07:00
|
|
|
virCHMonitor *monitor;
|
2021-12-10 20:34:41 +00:00
|
|
|
char *machineName;
|
2021-12-10 20:34:40 +00:00
|
|
|
virBitmap *autoCpuset;
|
2022-01-25 16:19:54 +00:00
|
|
|
virBitmap *autoNodeset;
|
|
|
|
virCgroup *cgroup;
|
2021-05-12 10:01:31 -07:00
|
|
|
};
|
|
|
|
|
2021-12-10 20:34:37 +00:00
|
|
|
#define CH_DOMAIN_PRIVATE(vm) \
|
|
|
|
((virCHDomainObjPrivate*)(vm)->privateData)
|
|
|
|
|
|
|
|
virCHMonitor *virCHDomainGetMonitor(virDomainObj *vm);
|
|
|
|
|
2021-12-10 20:34:38 +00:00
|
|
|
typedef struct _virCHDomainVcpuPrivate virCHDomainVcpuPrivate;
|
|
|
|
struct _virCHDomainVcpuPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
pid_t tid; /* vcpu thread id */
|
|
|
|
virTristateBool halted;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CH_DOMAIN_VCPU_PRIVATE(vcpu) \
|
|
|
|
((virCHDomainVcpuPrivate *) (vcpu)->privateData)
|
|
|
|
|
2021-05-12 10:01:31 -07:00
|
|
|
extern virDomainXMLPrivateDataCallbacks virCHDriverPrivateDataCallbacks;
|
|
|
|
extern virDomainDefParserConfig virCHDriverDomainDefParserConfig;
|
|
|
|
|
2022-02-10 16:10:13 +01:00
|
|
|
void
|
|
|
|
virCHDomainRemoveInactive(virCHDriver *driver,
|
|
|
|
virDomainObj *vm);
|
|
|
|
|
2021-12-10 20:34:39 +00:00
|
|
|
int
|
2022-01-25 16:19:54 +00:00
|
|
|
virCHDomainRefreshThreadInfo(virDomainObj *vm);
|
|
|
|
|
2021-12-10 20:34:39 +00:00
|
|
|
pid_t
|
|
|
|
virCHDomainGetVcpuPid(virDomainObj *vm,
|
|
|
|
unsigned int vcpuid);
|
|
|
|
bool
|
|
|
|
virCHDomainHasVcpuPids(virDomainObj *vm);
|
2021-12-10 20:34:41 +00:00
|
|
|
|
|
|
|
char *
|
|
|
|
virCHDomainGetMachineName(virDomainObj *vm);
|
2022-01-28 12:51:33 +01:00
|
|
|
|
|
|
|
virDomainObj *
|
|
|
|
virCHDomainObjFromDomain(virDomainPtr domain);
|
2024-01-16 15:25:43 -06:00
|
|
|
|
|
|
|
int
|
|
|
|
virCHDomainValidateActualNetDef(virDomainNetDef *net);
|