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);
|
2016-03-28 19:11:30 +00:00
|
|
|
int prlsdkConnect(vzDriverPtr driver);
|
|
|
|
void prlsdkDisconnect(vzDriverPtr driver);
|
2014-12-01 15:38:48 +00:00
|
|
|
int
|
2016-03-28 19:11:30 +00:00
|
|
|
prlsdkLoadDomains(vzDriverPtr driver);
|
2016-06-14 08:45:57 +00:00
|
|
|
virDomainObjPtr
|
|
|
|
prlsdkAddDomainByUUID(vzDriverPtr driver, const unsigned char *uuid);
|
|
|
|
virDomainObjPtr
|
|
|
|
prlsdkAddDomainByName(vzDriverPtr driver, const char *name);
|
2016-03-28 19:11:30 +00:00
|
|
|
int prlsdkUpdateDomain(vzDriverPtr driver, virDomainObjPtr dom);
|
2014-12-01 15:38:51 +00:00
|
|
|
|
2016-06-24 14:32:30 +00:00
|
|
|
int prlsdkStart(virDomainObjPtr dom);
|
|
|
|
int prlsdkKill(virDomainObjPtr dom);
|
|
|
|
int prlsdkStop(virDomainObjPtr dom);
|
|
|
|
int prlsdkPause(virDomainObjPtr dom);
|
|
|
|
int prlsdkResume(virDomainObjPtr dom);
|
|
|
|
int prlsdkSuspend(virDomainObjPtr dom);
|
|
|
|
int prlsdkRestart(virDomainObjPtr dom);
|
2017-01-31 07:44:13 +00:00
|
|
|
int prlsdkReset(virDomainObjPtr dom);
|
2016-06-24 14:32:30 +00:00
|
|
|
|
2015-04-07 20:35:01 +00:00
|
|
|
int
|
2016-03-28 19:11:30 +00:00
|
|
|
prlsdkApplyConfig(vzDriverPtr driver,
|
2014-12-01 15:38:52 +00:00
|
|
|
virDomainObjPtr dom,
|
|
|
|
virDomainDefPtr new);
|
2016-03-28 19:11:30 +00:00
|
|
|
int prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def);
|
2016-07-14 13:52:41 +00:00
|
|
|
int prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def);
|
2014-12-01 15:38:58 +00:00
|
|
|
int
|
2016-03-28 19:11:30 +00:00
|
|
|
prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom, unsigned int flags);
|
2015-04-07 20:35:02 +00:00
|
|
|
int
|
2015-05-13 14:23:00 +00:00
|
|
|
prlsdkDomainManagedSaveRemove(virDomainObjPtr dom);
|
2015-04-13 14:55:27 +00:00
|
|
|
int
|
2016-04-20 14:05:30 +00:00
|
|
|
prlsdkAttachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
|
2015-05-13 14:23:00 +00:00
|
|
|
int
|
2016-04-20 14:05:30 +00:00
|
|
|
prlsdkDetachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
|
2015-06-09 07:35:53 +00:00
|
|
|
int
|
2016-04-20 14:05:31 +00:00
|
|
|
prlsdkUpdateDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
|
|
|
|
int
|
2016-12-05 13:52:56 +00:00
|
|
|
prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDefPtr 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 */
|
|
|
|
int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize);
|
2017-04-14 14:53:52 +00:00
|
|
|
int prlsdkSetCpuCount(virDomainObjPtr dom, unsigned int count);
|
2016-05-27 15:16:34 +00:00
|
|
|
int
|
|
|
|
prlsdkDomainSetUserPassword(virDomainObjPtr dom,
|
|
|
|
const char *user,
|
|
|
|
const char *password);
|
2016-05-02 09:33:07 +00:00
|
|
|
virDomainSnapshotObjListPtr prlsdkLoadSnapshots(virDomainObjPtr dom);
|
|
|
|
int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description);
|
|
|
|
int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children);
|
|
|
|
int prlsdkSwitchToSnapshot(virDomainObjPtr dom, const char *uuid, bool paused);
|
2016-05-18 08:11:06 +00:00
|
|
|
int
|
|
|
|
prlsdkMigrate(virDomainObjPtr dom,
|
|
|
|
virURIPtr uri,
|
|
|
|
const char unsigned *session_uuid,
|
|
|
|
const char *dname,
|
|
|
|
unsigned int flags);
|
2016-06-08 07:17:22 +00:00
|
|
|
|
|
|
|
PRL_HANDLE
|
|
|
|
prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name);
|
2017-01-31 07:44:12 +00:00
|
|
|
int prlsdkCancelJob(virDomainObjPtr dom);
|
2017-04-14 14:53:53 +00:00
|
|
|
int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, unsigned long long newsize);
|