2014-09-11 16:24:03 +00:00
|
|
|
/*
|
2015-06-10 07:50:00 +00:00
|
|
|
* vz_sdk.h: core driver functions for managing
|
2014-09-11 16:24:03 +00:00
|
|
|
* Parallels Cloud Server hosts
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Parallels, Inc.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:12 +00:00
|
|
|
#pragma once
|
2014-09-11 16:24:03 +00:00
|
|
|
|
2019-06-18 16:13:12 +00:00
|
|
|
#include <Parallels.h>
|
2018-12-13 13:32:06 +00:00
|
|
|
|
2019-06-18 16:13:12 +00:00
|
|
|
#include "vz_utils.h"
|
2014-09-11 16:24:03 +00:00
|
|
|
|
2015-05-13 14:23:00 +00:00
|
|
|
int prlsdkInit(void);
|
2014-09-11 16:24:03 +00:00
|
|
|
void prlsdkDeinit(void);
|
2021-03-11 07:16:13 +00:00
|
|
|
int prlsdkConnect(struct _vzDriver *driver);
|
|
|
|
void prlsdkDisconnect(struct _vzDriver *driver);
|
2014-12-01 15:38:48 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkLoadDomains(struct _vzDriver *driver);
|
|
|
|
virDomainObj *
|
|
|
|
prlsdkAddDomainByUUID(struct _vzDriver *driver, const unsigned char *uuid);
|
|
|
|
virDomainObj *
|
|
|
|
prlsdkAddDomainByName(struct _vzDriver *driver, const char *name);
|
|
|
|
int prlsdkUpdateDomain(struct _vzDriver *driver, virDomainObj *dom);
|
2014-12-01 15:38:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int prlsdkStart(virDomainObj *dom);
|
|
|
|
int prlsdkKill(virDomainObj *dom);
|
|
|
|
int prlsdkStop(virDomainObj *dom);
|
|
|
|
int prlsdkPause(virDomainObj *dom);
|
|
|
|
int prlsdkResume(virDomainObj *dom);
|
|
|
|
int prlsdkSuspend(virDomainObj *dom);
|
|
|
|
int prlsdkRestart(virDomainObj *dom);
|
|
|
|
int prlsdkReset(virDomainObj *dom);
|
2016-06-24 14:32:30 +00:00
|
|
|
|
2015-04-07 20:35:01 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkApplyConfig(struct _vzDriver *driver,
|
|
|
|
virDomainObj *dom,
|
|
|
|
virDomainDef *new);
|
|
|
|
int prlsdkCreateVm(struct _vzDriver *driver, virDomainDef *def);
|
|
|
|
int prlsdkCreateCt(virConnectPtr conn, virDomainDef *def);
|
2014-12-01 15:38:58 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkUnregisterDomain(struct _vzDriver *driver, virDomainObj *dom, unsigned int flags);
|
2015-04-07 20:35:02 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkDomainManagedSaveRemove(virDomainObj *dom);
|
2015-04-13 14:55:27 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkAttachDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev);
|
2015-05-13 14:23:00 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkDetachDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev);
|
2015-06-09 07:35:53 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkUpdateDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev);
|
2016-04-20 14:05:31 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDef *disk, virDomainBlockStatsPtr stats, bool isCt);
|
2015-06-22 16:57:00 +00:00
|
|
|
int
|
2016-06-03 07:11:44 +00:00
|
|
|
prlsdkGetNetStats(PRL_HANDLE sdkstas, PRL_HANDLE sdkdom, const char *path, virDomainInterfaceStatsPtr stats);
|
2015-06-26 11:24:00 +00:00
|
|
|
int
|
2016-06-03 07:11:44 +00:00
|
|
|
prlsdkGetVcpuStats(PRL_HANDLE sdkstas, int idx, unsigned long long *time);
|
2015-06-26 11:24:00 +00:00
|
|
|
int
|
2016-06-03 07:11:44 +00:00
|
|
|
prlsdkGetMemoryStats(PRL_HANDLE sdkstas, virDomainMemoryStatPtr stats, unsigned int nr_stats);
|
2016-04-08 09:36:45 +00:00
|
|
|
/* memsize is in MiB */
|
2021-03-11 07:16:13 +00:00
|
|
|
int prlsdkSetMemsize(virDomainObj *dom, unsigned int memsize);
|
|
|
|
int prlsdkSetCpuCount(virDomainObj *dom, unsigned int count);
|
2016-05-27 15:16:34 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkDomainSetUserPassword(virDomainObj *dom,
|
2016-05-27 15:16:34 +00:00
|
|
|
const char *user,
|
|
|
|
const char *password);
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainSnapshotObjList *prlsdkLoadSnapshots(virDomainObj *dom);
|
|
|
|
int prlsdkCreateSnapshot(virDomainObj *dom, const char *description);
|
|
|
|
int prlsdkDeleteSnapshot(virDomainObj *dom, const char *uuid, bool children);
|
|
|
|
int prlsdkSwitchToSnapshot(virDomainObj *dom, const char *uuid, bool paused);
|
2016-05-18 08:11:06 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkMigrate(virDomainObj *dom,
|
|
|
|
virURI *uri,
|
2016-05-18 08:11:06 +00:00
|
|
|
const char unsigned *session_uuid,
|
|
|
|
const char *dname,
|
|
|
|
unsigned int flags);
|
2016-06-08 07:17:22 +00:00
|
|
|
|
|
|
|
PRL_HANDLE
|
2021-03-11 07:16:13 +00:00
|
|
|
prlsdkSdkDomainLookupByName(struct _vzDriver *driver, const char *name);
|
|
|
|
int prlsdkCancelJob(virDomainObj *dom);
|
|
|
|
int prlsdkResizeImage(virDomainObj *dom, virDomainDiskDef *disk, unsigned long long newsize);
|