vz_sdk.h 3.5 KB
Newer Older
1
/*
2
 * vz_sdk.h: core driver functions for managing
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * 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/>.
 *
 */

#include <Parallels.h>

25
#include "vz_utils.h"
26

27
int prlsdkInit(void);
28
void prlsdkDeinit(void);
29 30
int prlsdkConnect(vzDriverPtr driver);
void prlsdkDisconnect(vzDriverPtr driver);
31
int
32
prlsdkLoadDomains(vzDriverPtr driver);
33 34 35 36
virDomainObjPtr
prlsdkAddDomainByUUID(vzDriverPtr driver, const unsigned char *uuid);
virDomainObjPtr
prlsdkAddDomainByName(vzDriverPtr driver, const char *name);
37 38 39
int prlsdkUpdateDomain(vzDriverPtr driver, virDomainObjPtr dom);
int prlsdkSubscribeToPCSEvents(vzDriverPtr driver);
void prlsdkUnsubscribeFromPCSEvents(vzDriverPtr driver);
40

41 42 43 44 45 46 47
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);
48
int prlsdkReset(virDomainObjPtr dom);
49

50
int
51
prlsdkApplyConfig(vzDriverPtr driver,
52 53
                  virDomainObjPtr dom,
                  virDomainDefPtr new);
54
int prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def);
55
int prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def);
56
int
57
prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom, unsigned int flags);
58
int
59
prlsdkDomainManagedSaveRemove(virDomainObjPtr dom);
60
int
61
prlsdkAttachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
62
int
63
prlsdkDetachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
64
int
N
Nikolay Shirokovskiy 已提交
65 66
prlsdkUpdateDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev);
int
M
Maxim Nestratov 已提交
67
prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDefPtr disk, virDomainBlockStatsPtr stats, bool isCt);
68
int
69
prlsdkGetNetStats(PRL_HANDLE sdkstas, PRL_HANDLE sdkdom, const char *path, virDomainInterfaceStatsPtr stats);
N
Nikolay Shirokovskiy 已提交
70
int
71
prlsdkGetVcpuStats(PRL_HANDLE sdkstas, int idx, unsigned long long *time);
N
Nikolay Shirokovskiy 已提交
72
int
73
prlsdkGetMemoryStats(PRL_HANDLE sdkstas, virDomainMemoryStatPtr stats, unsigned int nr_stats);
74 75
/* memsize is in MiB */
int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize);
76 77 78 79
int
prlsdkDomainSetUserPassword(virDomainObjPtr dom,
                            const char *user,
                            const char *password);
80 81 82 83
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);
84 85 86 87 88 89
int
prlsdkMigrate(virDomainObjPtr dom,
              virURIPtr uri,
              const char unsigned *session_uuid,
              const char *dname,
              unsigned int flags);
90 91 92

PRL_HANDLE
prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name);
93
int prlsdkCancelJob(virDomainObjPtr dom);