提交 9c70b91e 编写于 作者: M Maxim Nestratov 提交者: Dmitry Guryanov

parallels: change parallels prefixes to vz

This patch changes all parallels/vz driver structure and
function prefixes from parallels to vz.
No functional changes.
Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
上级 c132b1b6
......@@ -434,7 +434,7 @@ virGlobalInit(void)
goto error;
# endif
# ifdef WITH_PARALLELS
if (parallelsRegister() == -1)
if (vzRegister() == -1)
goto error;
# endif
#endif
......
此差异已折叠。
......@@ -23,6 +23,6 @@
#ifndef PARALLELS_DRIVER_H
# define PARALLELS_DRIVER_H
int parallelsRegister(void);
int vzRegister(void);
#endif
......@@ -36,11 +36,11 @@
#define VIR_FROM_THIS VIR_FROM_PARALLELS
#define PARALLELS_ROUTED_NETWORK_UUID "eb593dd1-6846-45b0-84a0-de0729286982"
#define parallelsParseError() \
#define vzParseError() \
virReportErrorHelper(VIR_FROM_TEST, VIR_ERR_OPERATION_FAILED, __FILE__, \
__FUNCTION__, __LINE__, _("Can't parse prlctl output"))
static int parallelsGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj)
static int vzGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj)
{
const char *ifname;
char *bridgeLink = NULL;
......@@ -51,7 +51,7 @@ static int parallelsGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj
int ret = -1;
if (!(ifname = virJSONValueObjectGetString(jobj, "Bound To"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -100,7 +100,7 @@ static int parallelsGetBridgedNetInfo(virNetworkDefPtr def, virJSONValuePtr jobj
return ret;
}
static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
static int vzGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
{
const char *tmp;
virJSONValuePtr jobj = NULL, jobj2;
......@@ -109,15 +109,15 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
if (VIR_EXPAND_N(def->ips, def->nips, 1) < 0)
goto cleanup;
jobj = parallelsParseOutput("prlsrvctl", "net", "info", "-j", name, NULL);
jobj = vzParseOutput("prlsrvctl", "net", "info", "-j", name, NULL);
if (!jobj) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (!(jobj2 = virJSONValueObjectGet(jobj, "Parallels adapter"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -125,27 +125,27 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
goto cleanup;
if (!(tmp = virJSONValueObjectGetString(jobj2, "IP address"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (virSocketAddrParseIPv4(&def->ips[0].address, tmp) < 0) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (!(tmp = virJSONValueObjectGetString(jobj2, "Subnet mask"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (virSocketAddrParseIPv4(&def->ips[0].netmask, tmp) < 0) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (!(jobj2 = virJSONValueObjectGet(jobj, "DHCPv4 server"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -153,22 +153,22 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
goto cleanup;
if (!(tmp = virJSONValueObjectGetString(jobj2, "IP scope start address"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (virSocketAddrParseIPv4(&def->ips[0].ranges[0].start, tmp) < 0) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (!(tmp = virJSONValueObjectGetString(jobj2, "IP scope end address"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (virSocketAddrParseIPv4(&def->ips[0].ranges[0].end, tmp) < 0) {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -179,7 +179,7 @@ static int parallelsGetHostOnlyNetInfo(virNetworkDefPtr def, const char *name)
}
static int
parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
vzLoadNetwork(vzConnPtr privconn, virJSONValuePtr jobj)
{
int ret = -1;
virNetworkObjPtr net = NULL;
......@@ -192,7 +192,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
goto cleanup;
if (!(tmp = virJSONValueObjectGetString(jobj, "Network ID"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -206,14 +206,14 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
def->uuid_specified = 1;
if (!(tmp = virJSONValueObjectGetString(jobj, "Type"))) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (STREQ(tmp, PARALLELS_BRIDGED_NETWORK_TYPE)) {
def->forward.type = VIR_NETWORK_FORWARD_BRIDGE;
if (parallelsGetBridgedNetInfo(def, jobj) < 0) {
if (vzGetBridgedNetInfo(def, jobj) < 0) {
/* Only mandatory networks are required to be configured completely */
if (STRNEQ(def->name, PARALLELS_REQUIRED_BRIDGED_NETWORK))
......@@ -224,7 +224,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
} else if (STREQ(tmp, PARALLELS_HOSTONLY_NETWORK_TYPE)) {
def->forward.type = VIR_NETWORK_FORWARD_NONE;
if (parallelsGetHostOnlyNetInfo(def, def->name) < 0) {
if (vzGetHostOnlyNetInfo(def, def->name) < 0) {
/* Only mandatory networks are required to be configured completely */
if (STRNEQ(def->name, PARALLELS_REQUIRED_HOSTONLY_NETWORK))
......@@ -233,7 +233,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
goto cleanup;
}
} else {
parallelsParseError();
vzParseError();
goto cleanup;
}
......@@ -251,7 +251,7 @@ parallelsLoadNetwork(parallelsConnPtr privconn, virJSONValuePtr jobj)
}
static int
parallelsAddRoutedNetwork(parallelsConnPtr privconn)
vzAddRoutedNetwork(vzConnPtr privconn)
{
virNetworkObjPtr net = NULL;
virNetworkDefPtr def;
......@@ -285,38 +285,38 @@ parallelsAddRoutedNetwork(parallelsConnPtr privconn)
return -1;
}
static int parallelsLoadNetworks(parallelsConnPtr privconn)
static int vzLoadNetworks(vzConnPtr privconn)
{
virJSONValuePtr jobj, jobj2;
int ret = -1;
int count;
size_t i;
jobj = parallelsParseOutput("prlsrvctl", "net", "list", "-j", NULL);
jobj = vzParseOutput("prlsrvctl", "net", "list", "-j", NULL);
if (!jobj) {
parallelsParseError();
vzParseError();
goto cleanup;
}
count = virJSONValueArraySize(jobj);
if (count < 0) {
parallelsParseError();
vzParseError();
goto cleanup;
}
for (i = 0; i < count; i++) {
jobj2 = virJSONValueArrayGet(jobj, i);
if (!jobj2) {
parallelsParseError();
vzParseError();
goto cleanup;
}
if (parallelsLoadNetwork(privconn, jobj2) < 0)
if (vzLoadNetwork(privconn, jobj2) < 0)
goto cleanup;
}
if (parallelsAddRoutedNetwork(privconn) < 0)
if (vzAddRoutedNetwork(privconn) < 0)
goto cleanup;
ret = 0;
......@@ -327,10 +327,10 @@ static int parallelsLoadNetworks(parallelsConnPtr privconn)
}
virDrvOpenStatus
parallelsNetworkOpen(virConnectPtr conn,
vzNetworkOpen(virConnectPtr conn,
unsigned int flags)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
......@@ -341,7 +341,7 @@ parallelsNetworkOpen(virConnectPtr conn,
if (!(privconn->networks = virNetworkObjListNew()))
goto error;
if (parallelsLoadNetworks(conn->privateData) < 0)
if (vzLoadNetworks(conn->privateData) < 0)
goto error;
return VIR_DRV_OPEN_SUCCESS;
......@@ -351,9 +351,9 @@ parallelsNetworkOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
int parallelsNetworkClose(virConnectPtr conn)
int vzNetworkClose(virConnectPtr conn)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
if (!privconn)
return 0;
......@@ -362,21 +362,21 @@ int parallelsNetworkClose(virConnectPtr conn)
return 0;
}
static int parallelsConnectNumOfNetworks(virConnectPtr conn)
static int vzConnectNumOfNetworks(virConnectPtr conn)
{
int nactive;
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
nactive = virNetworkObjListNumOfNetworks(privconn->networks,
true, NULL, conn);
return nactive;
}
static int parallelsConnectListNetworks(virConnectPtr conn,
static int vzConnectListNetworks(virConnectPtr conn,
char **const names,
int nnames)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
int got;
got = virNetworkObjListGetNames(privconn->networks,
......@@ -384,21 +384,21 @@ static int parallelsConnectListNetworks(virConnectPtr conn,
return got;
}
static int parallelsConnectNumOfDefinedNetworks(virConnectPtr conn)
static int vzConnectNumOfDefinedNetworks(virConnectPtr conn)
{
int ninactive;
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
ninactive = virNetworkObjListNumOfNetworks(privconn->networks,
false, NULL, conn);
return ninactive;
}
static int parallelsConnectListDefinedNetworks(virConnectPtr conn,
static int vzConnectListDefinedNetworks(virConnectPtr conn,
char **const names,
int nnames)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
int got;
got = virNetworkObjListGetNames(privconn->networks,
......@@ -406,21 +406,21 @@ static int parallelsConnectListDefinedNetworks(virConnectPtr conn,
return got;
}
static int parallelsConnectListAllNetworks(virConnectPtr conn,
static int vzConnectListAllNetworks(virConnectPtr conn,
virNetworkPtr **nets,
unsigned int flags)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1);
return virNetworkObjListExport(conn, privconn->networks, nets, NULL, flags);
}
static virNetworkPtr parallelsNetworkLookupByUUID(virConnectPtr conn,
static virNetworkPtr vzNetworkLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
virNetworkObjPtr network;
virNetworkPtr ret = NULL;
......@@ -438,10 +438,10 @@ static virNetworkPtr parallelsNetworkLookupByUUID(virConnectPtr conn,
return ret;
}
static virNetworkPtr parallelsNetworkLookupByName(virConnectPtr conn,
static virNetworkPtr vzNetworkLookupByName(virConnectPtr conn,
const char *name)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
virNetworkObjPtr network;
virNetworkPtr ret = NULL;
......@@ -459,10 +459,10 @@ static virNetworkPtr parallelsNetworkLookupByName(virConnectPtr conn,
return ret;
}
static char *parallelsNetworkGetXMLDesc(virNetworkPtr net,
static char *vzNetworkGetXMLDesc(virNetworkPtr net,
unsigned int flags)
{
parallelsConnPtr privconn = net->conn->privateData;
vzConnPtr privconn = net->conn->privateData;
virNetworkObjPtr network;
char *ret = NULL;
......@@ -482,9 +482,9 @@ static char *parallelsNetworkGetXMLDesc(virNetworkPtr net,
return ret;
}
static int parallelsNetworkIsActive(virNetworkPtr net)
static int vzNetworkIsActive(virNetworkPtr net)
{
parallelsConnPtr privconn = net->conn->privateData;
vzConnPtr privconn = net->conn->privateData;
virNetworkObjPtr obj;
int ret = -1;
......@@ -500,9 +500,9 @@ static int parallelsNetworkIsActive(virNetworkPtr net)
return ret;
}
static int parallelsNetworkIsPersistent(virNetworkPtr net)
static int vzNetworkIsPersistent(virNetworkPtr net)
{
parallelsConnPtr privconn = net->conn->privateData;
vzConnPtr privconn = net->conn->privateData;
virNetworkObjPtr obj;
int ret = -1;
......@@ -518,10 +518,10 @@ static int parallelsNetworkIsPersistent(virNetworkPtr net)
return ret;
}
static int parallelsNetworkGetAutostart(virNetworkPtr net,
static int vzNetworkGetAutostart(virNetworkPtr net,
int *autostart)
{
parallelsConnPtr privconn = net->conn->privateData;
vzConnPtr privconn = net->conn->privateData;
virNetworkObjPtr network;
int ret = -1;
......@@ -540,17 +540,17 @@ static int parallelsNetworkGetAutostart(virNetworkPtr net,
return ret;
}
virNetworkDriver parallelsNetworkDriver = {
virNetworkDriver vzNetworkDriver = {
.name = "Parallels",
.connectNumOfNetworks = parallelsConnectNumOfNetworks, /* 1.0.1 */
.connectListNetworks = parallelsConnectListNetworks, /* 1.0.1 */
.connectNumOfDefinedNetworks = parallelsConnectNumOfDefinedNetworks, /* 1.0.1 */
.connectListDefinedNetworks = parallelsConnectListDefinedNetworks, /* 1.0.1 */
.connectListAllNetworks = parallelsConnectListAllNetworks, /* 1.0.1 */
.networkLookupByUUID = parallelsNetworkLookupByUUID, /* 1.0.1 */
.networkLookupByName = parallelsNetworkLookupByName, /* 1.0.1 */
.networkGetXMLDesc = parallelsNetworkGetXMLDesc, /* 1.0.1 */
.networkGetAutostart = parallelsNetworkGetAutostart, /* 1.0.1 */
.networkIsActive = parallelsNetworkIsActive, /* 1.0.1 */
.networkIsPersistent = parallelsNetworkIsPersistent, /* 1.0.1 */
.connectNumOfNetworks = vzConnectNumOfNetworks, /* 1.0.1 */
.connectListNetworks = vzConnectListNetworks, /* 1.0.1 */
.connectNumOfDefinedNetworks = vzConnectNumOfDefinedNetworks, /* 1.0.1 */
.connectListDefinedNetworks = vzConnectListDefinedNetworks, /* 1.0.1 */
.connectListAllNetworks = vzConnectListAllNetworks, /* 1.0.1 */
.networkLookupByUUID = vzNetworkLookupByUUID, /* 1.0.1 */
.networkLookupByName = vzNetworkLookupByName, /* 1.0.1 */
.networkGetXMLDesc = vzNetworkGetXMLDesc, /* 1.0.1 */
.networkGetAutostart = vzNetworkGetAutostart, /* 1.0.1 */
.networkIsActive = vzNetworkIsActive, /* 1.0.1 */
.networkIsPersistent = vzNetworkIsPersistent, /* 1.0.1 */
};
......@@ -226,7 +226,7 @@ prlsdkDeinit(void)
};
int
prlsdkConnect(parallelsConnPtr privconn)
prlsdkConnect(vzConnPtr privconn)
{
PRL_RESULT ret;
PRL_HANDLE job = PRL_INVALID_HANDLE;
......@@ -249,7 +249,7 @@ prlsdkConnect(parallelsConnPtr privconn)
}
void
prlsdkDisconnect(parallelsConnPtr privconn)
prlsdkDisconnect(vzConnPtr privconn)
{
PRL_HANDLE job;
......@@ -260,7 +260,7 @@ prlsdkDisconnect(parallelsConnPtr privconn)
}
static int
prlsdkSdkDomainLookup(parallelsConnPtr privconn,
prlsdkSdkDomainLookup(vzConnPtr privconn,
const char *id,
unsigned int flags,
PRL_HANDLE *sdkdom)
......@@ -295,7 +295,7 @@ prlsdkUUIDFormat(const unsigned char *uuid, char *uuidstr)
}
static PRL_HANDLE
prlsdkSdkDomainLookupByUUID(parallelsConnPtr privconn, const unsigned char *uuid)
prlsdkSdkDomainLookupByUUID(vzConnPtr privconn, const unsigned char *uuid)
{
char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
......@@ -406,7 +406,7 @@ prlsdkGetDomainState(PRL_HANDLE sdkdom, VIRTUAL_MACHINE_STATE_PTR vmState)
static void
prlsdkDomObjFreePrivate(void *p)
{
parallelsDomObjPtr pdom = p;
vzDomObjPtr pdom = p;
if (!pdom)
return;
......@@ -1244,13 +1244,13 @@ prlsdkConvertCpuMode(PRL_HANDLE sdkdom, virDomainDefPtr def)
* The function return a pointer to a locked virDomainObj.
*/
static virDomainObjPtr
prlsdkLoadDomain(parallelsConnPtr privconn,
prlsdkLoadDomain(vzConnPtr privconn,
PRL_HANDLE sdkdom,
virDomainObjPtr olddom)
{
virDomainObjPtr dom = NULL;
virDomainDefPtr def = NULL;
parallelsDomObjPtr pdom = NULL;
vzDomObjPtr pdom = NULL;
VIRTUAL_MACHINE_STATE domainState;
PRL_UINT32 buflen = 0;
......@@ -1428,7 +1428,7 @@ prlsdkLoadDomain(parallelsConnPtr privconn,
}
int
prlsdkLoadDomains(parallelsConnPtr privconn)
prlsdkLoadDomains(vzConnPtr privconn)
{
PRL_HANDLE job = PRL_INVALID_HANDLE;
PRL_HANDLE result;
......@@ -1472,7 +1472,7 @@ prlsdkLoadDomains(parallelsConnPtr privconn)
}
virDomainObjPtr
prlsdkAddDomain(parallelsConnPtr privconn, const unsigned char *uuid)
prlsdkAddDomain(vzConnPtr privconn, const unsigned char *uuid)
{
PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
virDomainObjPtr dom;
......@@ -1493,11 +1493,11 @@ prlsdkAddDomain(parallelsConnPtr privconn, const unsigned char *uuid)
}
int
prlsdkUpdateDomain(parallelsConnPtr privconn, virDomainObjPtr dom)
prlsdkUpdateDomain(vzConnPtr privconn, virDomainObjPtr dom)
{
PRL_HANDLE job;
virDomainObjPtr retdom = NULL;
parallelsDomObjPtr pdom = dom->privateData;
vzDomObjPtr pdom = dom->privateData;
job = PrlVm_RefreshConfig(pdom->sdkdom);
if (waitJob(job))
......@@ -1507,7 +1507,7 @@ prlsdkUpdateDomain(parallelsConnPtr privconn, virDomainObjPtr dom)
return retdom ? 0 : -1;
}
static int prlsdkSendEvent(parallelsConnPtr privconn,
static int prlsdkSendEvent(vzConnPtr privconn,
virDomainObjPtr dom,
virDomainEventType lvEventType,
int lvEventTypeDetails)
......@@ -1558,7 +1558,7 @@ prlsdkNewStateToEvent(VIRTUAL_MACHINE_STATE domainState,
}
static void
prlsdkHandleVmStateEvent(parallelsConnPtr privconn,
prlsdkHandleVmStateEvent(vzConnPtr privconn,
PRL_HANDLE prlEvent,
unsigned char *uuid)
{
......@@ -1566,7 +1566,7 @@ prlsdkHandleVmStateEvent(parallelsConnPtr privconn,
PRL_HANDLE eventParam = PRL_INVALID_HANDLE;
PRL_INT32 domainState;
virDomainObjPtr dom = NULL;
parallelsDomObjPtr pdom;
vzDomObjPtr pdom;
virDomainEventType lvEventType = 0;
int lvEventTypeDetails = 0;
......@@ -1596,7 +1596,7 @@ prlsdkHandleVmStateEvent(parallelsConnPtr privconn,
}
static void
prlsdkHandleVmConfigEvent(parallelsConnPtr privconn,
prlsdkHandleVmConfigEvent(vzConnPtr privconn,
unsigned char *uuid)
{
virDomainObjPtr dom = NULL;
......@@ -1617,7 +1617,7 @@ prlsdkHandleVmConfigEvent(parallelsConnPtr privconn,
}
static void
prlsdkHandleVmAddedEvent(parallelsConnPtr privconn,
prlsdkHandleVmAddedEvent(vzConnPtr privconn,
unsigned char *uuid)
{
virDomainObjPtr dom = NULL;
......@@ -1634,7 +1634,7 @@ prlsdkHandleVmAddedEvent(parallelsConnPtr privconn,
}
static void
prlsdkHandleVmRemovedEvent(parallelsConnPtr privconn,
prlsdkHandleVmRemovedEvent(vzConnPtr privconn,
unsigned char *uuid)
{
virDomainObjPtr dom = NULL;
......@@ -1655,12 +1655,12 @@ prlsdkHandleVmRemovedEvent(parallelsConnPtr privconn,
#define PARALLELS_STATISTICS_DROP_COUNT 3
static PRL_RESULT
prlsdkHandlePerfEvent(parallelsConnPtr privconn,
prlsdkHandlePerfEvent(vzConnPtr privconn,
PRL_HANDLE event,
unsigned char *uuid)
{
virDomainObjPtr dom = NULL;
parallelsDomObjPtr privdom = NULL;
vzDomObjPtr privdom = NULL;
PRL_HANDLE job = PRL_INVALID_HANDLE;
dom = virDomainObjListFindByUUID(privconn->domains, uuid);
......@@ -1698,7 +1698,7 @@ prlsdkHandlePerfEvent(parallelsConnPtr privconn,
}
static void
prlsdkHandleVmEvent(parallelsConnPtr privconn, PRL_HANDLE prlEvent)
prlsdkHandleVmEvent(vzConnPtr privconn, PRL_HANDLE prlEvent)
{
PRL_RESULT pret = PRL_ERR_FAILURE;
char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
......@@ -1748,7 +1748,7 @@ prlsdkHandleVmEvent(parallelsConnPtr privconn, PRL_HANDLE prlEvent)
static PRL_RESULT
prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
{
parallelsConnPtr privconn = opaque;
vzConnPtr privconn = opaque;
PRL_RESULT pret = PRL_ERR_FAILURE;
PRL_HANDLE_TYPE handleType;
PRL_EVENT_ISSUER_TYPE prlIssuerType = PIE_UNKNOWN;
......@@ -1782,7 +1782,7 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
}
int prlsdkSubscribeToPCSEvents(parallelsConnPtr privconn)
int prlsdkSubscribeToPCSEvents(vzConnPtr privconn)
{
PRL_RESULT pret = PRL_ERR_UNINITIALIZED;
......@@ -1796,7 +1796,7 @@ int prlsdkSubscribeToPCSEvents(parallelsConnPtr privconn)
return -1;
}
void prlsdkUnsubscribeFromPCSEvents(parallelsConnPtr privconn)
void prlsdkUnsubscribeFromPCSEvents(vzConnPtr privconn)
{
PRL_RESULT ret = PRL_ERR_UNINITIALIZED;
ret = PrlSrv_UnregEventHandler(privconn->server,
......@@ -1857,11 +1857,11 @@ PRL_RESULT prlsdkSuspend(PRL_HANDLE sdkdom)
}
int
prlsdkDomainChangeStateLocked(parallelsConnPtr privconn,
prlsdkDomainChangeStateLocked(vzConnPtr privconn,
virDomainObjPtr dom,
prlsdkChangeStateFunc chstate)
{
parallelsDomObjPtr pdom;
vzDomObjPtr pdom;
PRL_RESULT pret;
virErrorNumber virerr;
......@@ -1890,11 +1890,11 @@ int
prlsdkDomainChangeState(virDomainPtr domain,
prlsdkChangeStateFunc chstate)
{
parallelsConnPtr privconn = domain->conn->privateData;
vzConnPtr privconn = domain->conn->privateData;
virDomainObjPtr dom;
int ret = -1;
if (!(dom = parallelsDomObjFromDomain(domain)))
if (!(dom = vzDomObjFromDomain(domain)))
return -1;
ret = prlsdkDomainChangeStateLocked(privconn, dom, chstate);
......@@ -2007,7 +2007,7 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
return -1;
}
/* we fill only type and arch fields in parallelsLoadDomain for
/* we fill only type and arch fields in vzLoadDomain for
* hvm type and also init for containers, so we can check that all
* other paramenters are null and boot devices config is default */
......@@ -2781,7 +2781,7 @@ static const char * prlsdkFormatMac(virMacAddrPtr mac, char *macstr)
}
static int prlsdkAddNet(PRL_HANDLE sdkdom,
parallelsConnPtr privconn,
vzConnPtr privconn,
virDomainNetDefPtr net,
bool isCt)
{
......@@ -2885,7 +2885,7 @@ static int prlsdkAddNet(PRL_HANDLE sdkdom,
return ret;
}
static void prlsdkDelNet(parallelsConnPtr privconn, virDomainNetDefPtr net)
static void prlsdkDelNet(vzConnPtr privconn, virDomainNetDefPtr net)
{
PRL_RESULT pret;
PRL_HANDLE vnet = PRL_INVALID_HANDLE;
......@@ -3111,7 +3111,7 @@ int
prlsdkAttachVolume(virDomainObjPtr dom, virDomainDiskDefPtr disk)
{
int ret = -1;
parallelsDomObjPtr privdom = dom->privateData;
vzDomObjPtr privdom = dom->privateData;
PRL_HANDLE job = PRL_INVALID_HANDLE;
job = PrlVm_BeginEdit(privdom->sdkdom);
......@@ -3181,7 +3181,7 @@ int
prlsdkDetachVolume(virDomainObjPtr dom, virDomainDiskDefPtr disk)
{
int ret = -1, idx;
parallelsDomObjPtr privdom = dom->privateData;
vzDomObjPtr privdom = dom->privateData;
PRL_HANDLE job = PRL_INVALID_HANDLE;
idx = prlsdkGetDiskIndex(privdom->sdkdom, disk);
......@@ -3368,7 +3368,7 @@ prlsdkApplyConfig(virConnectPtr conn,
virDomainObjPtr dom,
virDomainDefPtr new)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
PRL_HANDLE job = PRL_INVALID_HANDLE;
int ret;
......@@ -3397,7 +3397,7 @@ prlsdkApplyConfig(virConnectPtr conn,
int
prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
PRL_HANDLE job = PRL_INVALID_HANDLE;
PRL_HANDLE result = PRL_INVALID_HANDLE;
......@@ -3437,7 +3437,7 @@ prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def)
int
prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
{
parallelsConnPtr privconn = conn->privateData;
vzConnPtr privconn = conn->privateData;
PRL_HANDLE sdkdom = PRL_INVALID_HANDLE;
PRL_GET_VM_CONFIG_PARAM_DATA confParam;
PRL_HANDLE job = PRL_INVALID_HANDLE;
......@@ -3498,9 +3498,9 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def)
}
int
prlsdkUnregisterDomain(parallelsConnPtr privconn, virDomainObjPtr dom)
prlsdkUnregisterDomain(vzConnPtr privconn, virDomainObjPtr dom)
{
parallelsDomObjPtr privdom = dom->privateData;
vzDomObjPtr privdom = dom->privateData;
PRL_HANDLE job;
size_t i;
......@@ -3522,7 +3522,7 @@ prlsdkUnregisterDomain(parallelsConnPtr privconn, virDomainObjPtr dom)
int
prlsdkDomainManagedSaveRemove(virDomainObjPtr dom)
{
parallelsDomObjPtr privdom = dom->privateData;
vzDomObjPtr privdom = dom->privateData;
PRL_HANDLE job;
job = PrlVm_DropSuspendedState(privdom->sdkdom);
......@@ -3565,7 +3565,7 @@ prlsdkExtractStatsParam(PRL_HANDLE sdkstats, const char *name, long long *val)
static int
prlsdkGetStatsParam(virDomainObjPtr dom, const char *name, long long *val)
{
parallelsDomObjPtr privdom = dom->privateData;
vzDomObjPtr privdom = dom->privateData;
PRL_HANDLE job = PRL_INVALID_HANDLE;
unsigned long long now;
......
......@@ -26,15 +26,15 @@
int prlsdkInit(void);
void prlsdkDeinit(void);
int prlsdkConnect(parallelsConnPtr privconn);
void prlsdkDisconnect(parallelsConnPtr privconn);
int prlsdkConnect(vzConnPtr privconn);
void prlsdkDisconnect(vzConnPtr privconn);
int
prlsdkLoadDomains(parallelsConnPtr privconn);
prlsdkLoadDomains(vzConnPtr privconn);
virDomainObjPtr
prlsdkAddDomain(parallelsConnPtr privconn, const unsigned char *uuid);
int prlsdkUpdateDomain(parallelsConnPtr privconn, virDomainObjPtr dom);
int prlsdkSubscribeToPCSEvents(parallelsConnPtr privconn);
void prlsdkUnsubscribeFromPCSEvents(parallelsConnPtr privconn);
prlsdkAddDomain(vzConnPtr privconn, const unsigned char *uuid);
int prlsdkUpdateDomain(vzConnPtr privconn, virDomainObjPtr dom);
int prlsdkSubscribeToPCSEvents(vzConnPtr privconn);
void prlsdkUnsubscribeFromPCSEvents(vzConnPtr privconn);
PRL_RESULT prlsdkStart(PRL_HANDLE sdkdom);
PRL_RESULT prlsdkKill(PRL_HANDLE sdkdom);
PRL_RESULT prlsdkStop(PRL_HANDLE sdkdom);
......@@ -47,7 +47,7 @@ int
prlsdkDomainChangeState(virDomainPtr domain,
prlsdkChangeStateFunc chstate);
int
prlsdkDomainChangeStateLocked(parallelsConnPtr privconn,
prlsdkDomainChangeStateLocked(vzConnPtr privconn,
virDomainObjPtr dom,
prlsdkChangeStateFunc chstate);
int
......@@ -57,7 +57,7 @@ prlsdkApplyConfig(virConnectPtr conn,
int prlsdkCreateVm(virConnectPtr conn, virDomainDefPtr def);
int prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def);
int
prlsdkUnregisterDomain(parallelsConnPtr privconn, virDomainObjPtr dom);
prlsdkUnregisterDomain(vzConnPtr privconn, virDomainObjPtr dom);
int
prlsdkDomainManagedSaveRemove(virDomainObjPtr dom);
int
......
此差异已折叠。
......@@ -35,7 +35,7 @@
#define VIR_FROM_THIS VIR_FROM_PARALLELS
/**
* parallelsDomObjFromDomain:
* vzDomObjFromDomain:
* @domain: Domain pointer that has to be looked up
*
* This function looks up @domain and returns the appropriate virDomainObjPtr
......@@ -45,10 +45,10 @@
* on success, NULL otherwise.
*/
virDomainObjPtr
parallelsDomObjFromDomain(virDomainPtr domain)
vzDomObjFromDomain(virDomainPtr domain)
{
virDomainObjPtr vm;
parallelsConnPtr privconn = domain->conn->privateData;
vzConnPtr privconn = domain->conn->privateData;
char uuidstr[VIR_UUID_STRING_BUFLEN];
vm = virDomainObjListFindByUUID(privconn->domains, domain->uuid);
......@@ -65,7 +65,7 @@ parallelsDomObjFromDomain(virDomainPtr domain)
}
/**
* parallelsDomObjFromDomainRef:
* vzDomObjFromDomainRef:
* @domain: Domain pointer that has to be looked up
*
* This function looks up @domain and returns the appropriate virDomainObjPtr
......@@ -75,10 +75,10 @@ parallelsDomObjFromDomain(virDomainPtr domain)
* on success, NULL otherwise.
*/
virDomainObjPtr
parallelsDomObjFromDomainRef(virDomainPtr domain)
vzDomObjFromDomainRef(virDomainPtr domain)
{
virDomainObjPtr vm;
parallelsConnPtr privconn = domain->conn->privateData;
vzConnPtr privconn = domain->conn->privateData;
char uuidstr[VIR_UUID_STRING_BUFLEN];
vm = virDomainObjListFindByUUIDRef(privconn->domains, domain->uuid);
......@@ -94,7 +94,7 @@ parallelsDomObjFromDomainRef(virDomainPtr domain)
}
static int
parallelsDoCmdRun(char **outbuf, const char *binary, va_list list)
vzDoCmdRun(char **outbuf, const char *binary, va_list list)
{
virCommandPtr cmd = virCommandNewVAList(binary, list);
int ret = -1;
......@@ -119,7 +119,7 @@ parallelsDoCmdRun(char **outbuf, const char *binary, va_list list)
* pointer to virJSONValue or NULL in case of error.
*/
virJSONValuePtr
parallelsParseOutput(const char *binary, ...)
vzParseOutput(const char *binary, ...)
{
char *outbuf;
virJSONValuePtr jobj = NULL;
......@@ -127,7 +127,7 @@ parallelsParseOutput(const char *binary, ...)
int ret;
va_start(list, binary);
ret = parallelsDoCmdRun(&outbuf, binary, list);
ret = vzDoCmdRun(&outbuf, binary, list);
va_end(list);
if (ret)
return NULL;
......@@ -147,14 +147,14 @@ parallelsParseOutput(const char *binary, ...)
* for freeing the buffer.
*/
char *
parallelsGetOutput(const char *binary, ...)
vzGetOutput(const char *binary, ...)
{
char *outbuf;
va_list list;
int ret;
va_start(list, binary);
ret = parallelsDoCmdRun(&outbuf, binary, list);
ret = vzDoCmdRun(&outbuf, binary, list);
va_end(list);
if (ret)
return NULL;
......@@ -168,13 +168,13 @@ parallelsGetOutput(const char *binary, ...)
* Return value is 0 in case of success, else - -1
*/
int
parallelsCmdRun(const char *binary, ...)
vzCmdRun(const char *binary, ...)
{
int ret;
va_list list;
va_start(list, binary);
ret = parallelsDoCmdRun(NULL, binary, list);
ret = vzDoCmdRun(NULL, binary, list);
va_end(list);
return ret;
......@@ -185,7 +185,7 @@ parallelsCmdRun(const char *binary, ...)
* concatenating first and second function arguments.
*/
char *
parallelsAddFileExt(const char *path, const char *ext)
vzAddFileExt(const char *path, const char *ext)
{
char *new_path = NULL;
size_t len = strlen(path) + strlen(ext) + 1;
......
......@@ -33,13 +33,13 @@
# include "virthread.h"
# include "virjson.h"
# define parallelsParseError() \
# define vzParseError() \
virReportErrorHelper(VIR_FROM_TEST, VIR_ERR_OPERATION_FAILED, __FILE__, \
__FUNCTION__, __LINE__, _("Can't parse prlctl output"))
# define IS_CT(def) (def->os.type == VIR_DOMAIN_OSTYPE_EXE)
# define parallelsDomNotFoundError(domain) \
# define vzDomNotFoundError(domain) \
do { \
char uuidstr[VIR_UUID_STRING_BUFLEN]; \
virUUIDFormat(domain->uuid, uuidstr); \
......@@ -55,7 +55,7 @@
# define PARALLELS_REQUIRED_BRIDGED_NETWORK "Bridged"
# define PARALLELS_BRIDGED_NETWORK_TYPE "bridged"
struct _parallelsConn {
struct _vzConn {
virMutex lock;
/* Immutable pointer, self-locking APIs */
......@@ -71,10 +71,10 @@ struct _parallelsConn {
const char *drivername;
};
typedef struct _parallelsConn parallelsConn;
typedef struct _parallelsConn *parallelsConnPtr;
typedef struct _vzConn vzConn;
typedef struct _vzConn *vzConnPtr;
struct _parallelsCountersCache {
struct _vzCountersCache {
PRL_HANDLE stats;
virCond cond;
// -1 - unsubscribed
......@@ -82,41 +82,41 @@ struct _parallelsCountersCache {
int count;
};
typedef struct _parallelsCountersCache parallelsCountersCache;
typedef struct _vzCountersCache vzCountersCache;
struct parallelsDomObj {
struct vzDomObj {
int id;
char *uuid;
char *home;
PRL_HANDLE sdkdom;
parallelsCountersCache cache;
vzCountersCache cache;
};
typedef struct parallelsDomObj *parallelsDomObjPtr;
typedef struct vzDomObj *vzDomObjPtr;
virDrvOpenStatus parallelsStorageOpen(virConnectPtr conn, unsigned int flags);
int parallelsStorageClose(virConnectPtr conn);
extern virStorageDriver parallelsStorageDriver;
virDrvOpenStatus vzStorageOpen(virConnectPtr conn, unsigned int flags);
int vzStorageClose(virConnectPtr conn);
extern virStorageDriver vzStorageDriver;
virDrvOpenStatus parallelsNetworkOpen(virConnectPtr conn, unsigned int flags);
int parallelsNetworkClose(virConnectPtr conn);
extern virNetworkDriver parallelsNetworkDriver;
virDrvOpenStatus vzNetworkOpen(virConnectPtr conn, unsigned int flags);
int vzNetworkClose(virConnectPtr conn);
extern virNetworkDriver vzNetworkDriver;
virDomainObjPtr parallelsDomObjFromDomain(virDomainPtr domain);
virDomainObjPtr parallelsDomObjFromDomainRef(virDomainPtr domain);
virDomainObjPtr vzDomObjFromDomain(virDomainPtr domain);
virDomainObjPtr vzDomObjFromDomainRef(virDomainPtr domain);
virJSONValuePtr parallelsParseOutput(const char *binary, ...)
virJSONValuePtr vzParseOutput(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
char * parallelsGetOutput(const char *binary, ...)
char * vzGetOutput(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
int parallelsCmdRun(const char *binary, ...)
int vzCmdRun(const char *binary, ...)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
char * parallelsAddFileExt(const char *path, const char *ext);
void parallelsDriverLock(parallelsConnPtr driver);
void parallelsDriverUnlock(parallelsConnPtr driver);
virStorageVolPtr parallelsStorageVolLookupByPathLocked(virConnectPtr conn,
char * vzAddFileExt(const char *path, const char *ext);
void vzDriverLock(vzConnPtr driver);
void vzDriverUnlock(vzConnPtr driver);
virStorageVolPtr vzStorageVolLookupByPathLocked(virConnectPtr conn,
const char *path);
int parallelsStorageVolDefRemove(virStoragePoolObjPtr privpool,
int vzStorageVolDefRemove(virStoragePoolObjPtr privpool,
virStorageVolDefPtr privvol);
# define PARALLELS_BLOCK_STATS_FOREACH(OP) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册