++tmp;
}
- if (esxVI_String_DeepCopyValue(&strippedFileName, tmp) < 0) {
+ if (VIR_STRDUP(strippedFileName, tmp) < 0) {
goto cleanup;
}
/* Fallback to direct datastore name match */
if (result == NULL && STRPREFIX(fileName, "/vmfs/volumes/")) {
- if (esxVI_String_DeepCopyValue(©OfFileName, fileName) < 0) {
+ if (VIR_STRDUP(copyOfFileName, fileName) < 0) {
goto cleanup;
}
/* If it's an absolute path outside of a datastore just use it as is */
if (result == NULL && *fileName == '/') {
/* FIXME: need to deal with Windows paths here too */
- if (esxVI_String_DeepCopyValue(&result, fileName) < 0) {
+ if (VIR_STRDUP(result, fileName) < 0) {
goto cleanup;
}
}
result = virBufferContentAndReset(&buffer);
} else if (*fileName == '/') {
/* FIXME: need to deal with Windows paths here too */
- if (esxVI_String_DeepCopyValue(&result, fileName) < 0) {
+ if (VIR_STRDUP(result, fileName) < 0) {
goto cleanup;
}
} else {
if (esxVI_HostPortGroupSpec_Alloc(&hostPortGroupSpec) < 0 ||
esxVI_HostNetworkPolicy_Alloc(&hostPortGroupSpec->policy) < 0 ||
esxVI_Int_Alloc(&hostPortGroupSpec->vlanId) < 0 ||
- esxVI_String_DeepCopyValue(&hostPortGroupSpec->name,
- def->portGroups[i].name) < 0 ||
- esxVI_String_DeepCopyValue(&hostPortGroupSpec->vswitchName,
- def->name) < 0) {
+ VIR_STRDUP(hostPortGroupSpec->name, def->portGroups[i].name) < 0 ||
+ VIR_STRDUP(hostPortGroupSpec->vswitchName, def->name) < 0) {
goto cleanup;
}
virUUIDFormat(md5, uuid_string);
- if (esxVI_String_DeepCopyValue(&def.key, uuid_string) < 0) {
+ if (VIR_STRDUP(def.key, uuid_string) < 0) {
goto cleanup;
}
}
} else {
/* Fall back to the path as key */
- if (esxVI_String_DeepCopyValue(&key, datastorePath) < 0) {
+ if (VIR_STRDUP(key, datastorePath) < 0) {
goto cleanup;
}
}
}
} else {
/* Fall back to the path as key */
- if (esxVI_String_DeepCopyValue(&key, datastorePath) < 0) {
+ if (VIR_STRDUP(key, datastorePath) < 0) {
goto cleanup;
}
}
return -1;
}
- if (esxVI_String_DeepCopyValue(©OfDatastorePath, datastorePath) < 0) {
+ if (VIR_STRDUP(copyOfDatastorePath, datastorePath) < 0) {
goto cleanup;
}
}
if (datastoreName != NULL &&
- esxVI_String_DeepCopyValue(datastoreName,
- preliminaryDatastoreName) < 0) {
+ VIR_STRDUP(*datastoreName, preliminaryDatastoreName) < 0) {
goto cleanup;
}
}
if (directoryAndFileName != NULL &&
- esxVI_String_DeepCopyValue(directoryAndFileName,
- preliminaryDirectoryAndFileName) < 0) {
+ VIR_STRDUP(*directoryAndFileName, preliminaryDirectoryAndFileName) < 0) {
goto cleanup;
}
*tmp = '\0';
}
- if (esxVI_String_DeepCopyValue(directoryName,
- preliminaryDirectoryAndFileName) < 0) {
+ if (VIR_STRDUP(*directoryName, preliminaryDirectoryAndFileName) < 0) {
goto cleanup;
}
}
if (esxVI_CURL_Alloc(&ctx->curl) < 0 ||
esxVI_CURL_Connect(ctx->curl, parsedUri) < 0 ||
- esxVI_String_DeepCopyValue(&ctx->url, url) < 0 ||
- esxVI_String_DeepCopyValue(&ctx->ipAddress, ipAddress) < 0 ||
- esxVI_String_DeepCopyValue(&ctx->username, username) < 0 ||
- esxVI_String_DeepCopyValue(&ctx->password, password) < 0) {
+ VIR_STRDUP(ctx->url, url) < 0 ||
+ VIR_STRDUP(ctx->ipAddress, ipAddress) < 0 ||
+ VIR_STRDUP(ctx->username, username) < 0 ||
+ VIR_STRDUP(ctx->password, password) < 0) {
return -1;
}
}
if (esxVI_TraversalSpec_Alloc(&traversalSpec) < 0 ||
- esxVI_String_DeepCopyValue(&traversalSpec->name, name) < 0 ||
- esxVI_String_DeepCopyValue(&traversalSpec->type, type) < 0 ||
- esxVI_String_DeepCopyValue(&traversalSpec->path, path) < 0) {
+ VIR_STRDUP(traversalSpec->name, name) < 0 ||
+ VIR_STRDUP(traversalSpec->type, type) < 0 ||
+ VIR_STRDUP(traversalSpec->path, path) < 0) {
goto failure;
}
while (currentSelectSetName != NULL && *currentSelectSetName != '\0') {
if (esxVI_SelectionSpec_Alloc(&selectionSpec) < 0 ||
- esxVI_String_DeepCopyValue(&selectionSpec->name,
- currentSelectSetName) < 0 ||
+ VIR_STRDUP(selectionSpec->name, currentSelectSetName) < 0 ||
esxVI_SelectionSpec_AppendToList(&traversalSpec->selectSet,
selectionSpec) < 0) {
goto failure;
goto cleanup;
}
- if (esxVI_String_DeepCopyValue(&fileName, directoryAndFileName) < 0) {
+ if (VIR_STRDUP(fileName, directoryAndFileName) < 0) {
goto cleanup;
}
} else {
goto cleanup;
}
- if (esxVI_String_DeepCopyValue(&fileName,
- directoryAndFileName + length + 1) < 0) {
+ if (VIR_STRDUP(fileName, directoryAndFileName + length + 1) < 0) {
goto cleanup;
}
}
if (*key == NULL) {
/* Other files don't have a UUID, fall back to the path as key */
- if (esxVI_String_DeepCopyValue(key, datastorePath) < 0) {
+ if (VIR_STRDUP(*key, datastorePath) < 0) {
goto cleanup;
}
}
(*dest)->type = src->type;
- if (esxVI_String_DeepCopyValue(&(*dest)->other, src->other) < 0 ||
- esxVI_String_DeepCopyValue(&(*dest)->value, src->value) < 0) {
+ if (VIR_STRDUP((*dest)->other, src->other) < 0 ||
+ VIR_STRDUP((*dest)->value, src->value) < 0) {
goto failure;
}