mirror of https://gitee.com/openkylin/libvirt.git
Replace use of virStorageReportError with virReportError
Update the storage driver to use virReportError instead of the virStorageReportError custom macro Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
89e23562c9
commit
d8a1c4c49f
1
cfg.mk
1
cfg.mk
|
@ -549,7 +549,6 @@ msg_gen_function += virReportErrorHelper
|
|||
msg_gen_function += virReportSystemError
|
||||
msg_gen_function += virSecretReportError
|
||||
msg_gen_function += virSecurityReportError
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virXenInotifyError
|
||||
msg_gen_function += virXenStoreError
|
||||
msg_gen_function += virXendError
|
||||
|
|
|
@ -385,7 +385,7 @@ virStorageBackendCreateRaw(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
virCheckFlags(0, -1);
|
||||
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("storage pool does not support encrypted "
|
||||
"volumes"));
|
||||
goto cleanup;
|
||||
|
@ -425,7 +425,7 @@ virStorageGenerateSecretUUID(virConnectPtr conn,
|
|||
for (attempt = 0; attempt < 65536; attempt++) {
|
||||
virSecretPtr tmp;
|
||||
if (virUUIDGenerate(uuid) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("unable to generate uuid"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ virStorageGenerateSecretUUID(virConnectPtr conn,
|
|||
virSecretFree(tmp);
|
||||
}
|
||||
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("too many conflicts when generating an uuid"));
|
||||
|
||||
return -1;
|
||||
|
@ -459,14 +459,14 @@ virStorageGenerateQcowEncryption(virConnectPtr conn,
|
|||
conn->secretDriver->lookupByUUID == NULL ||
|
||||
conn->secretDriver->defineXML == NULL ||
|
||||
conn->secretDriver->setValue == NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("secret storage not supported"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
enc = vol->target.encryption;
|
||||
if (enc->nsecrets != 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("secrets already defined"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ static int virStorageBackendQEMUImgBackingFormat(const char *qemuimg)
|
|||
|
||||
if ((start = strstr(help, " create ")) == NULL ||
|
||||
(end = strstr(start, "\n")) == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unable to parse qemu-img output '%s'"),
|
||||
help);
|
||||
goto cleanup;
|
||||
|
@ -682,13 +682,13 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||
NULL;
|
||||
|
||||
if (type == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown storage vol type %d"),
|
||||
vol->target.format);
|
||||
return -1;
|
||||
}
|
||||
if (inputvol && inputType == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown storage vol type %d"),
|
||||
inputvol->target.format);
|
||||
return -1;
|
||||
|
@ -705,14 +705,14 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||
if (inputvol &&
|
||||
(!inputBackingPath ||
|
||||
STRNEQ(inputBackingPath, vol->backingStore.path))) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("a different backing store cannot "
|
||||
"be specified."));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (backingType == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown storage vol backing store type %d"),
|
||||
vol->backingStore.format);
|
||||
return -1;
|
||||
|
@ -743,7 +743,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||
|
||||
if (vol->target.format != VIR_STORAGE_FILE_QCOW &&
|
||||
vol->target.format != VIR_STORAGE_FILE_QCOW2) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("qcow volume encryption unsupported with "
|
||||
"volume format %s"), type);
|
||||
return -1;
|
||||
|
@ -751,13 +751,13 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||
enc = vol->target.encryption;
|
||||
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_QCOW &&
|
||||
enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("unsupported volume encryption format %d"),
|
||||
vol->target.encryption->format);
|
||||
return -1;
|
||||
}
|
||||
if (enc->nsecrets > 1) {
|
||||
virStorageReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("too many secrets for qcow encryption"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||
create_tool = virFindFileInPath("qemu-img");
|
||||
|
||||
if (!create_tool) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("unable to find kvm-img or qemu-img"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -871,25 +871,25 @@ virStorageBackendCreateQcowCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
virCheckFlags(0, -1);
|
||||
|
||||
if (inputvol) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("cannot copy from volume with qcow-create"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (vol->target.format != VIR_STORAGE_FILE_QCOW2) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unsupported storage vol type %d"),
|
||||
vol->target.format);
|
||||
return -1;
|
||||
}
|
||||
if (vol->backingStore.path != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("copy-on-write image not supported with "
|
||||
"qcow-create"));
|
||||
return -1;
|
||||
}
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("encrypted volumes not supported with "
|
||||
"qcow-create"));
|
||||
return -1;
|
||||
|
@ -921,7 +921,7 @@ virStorageBackendFSImageToolTypeToFunc(int tool_type)
|
|||
case TOOL_QCOW_CREATE:
|
||||
return virStorageBackendCreateQcowCreate;
|
||||
default:
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown file create tool type '%d'."),
|
||||
tool_type);
|
||||
}
|
||||
|
@ -969,7 +969,7 @@ virStorageBackendGetBuildVolFromFunction(virStorageVolDefPtr vol,
|
|||
inputvol->target.format != VIR_STORAGE_FILE_RAW)) {
|
||||
|
||||
if ((tool_type = virStorageBackendFindFSImageTool(NULL)) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("creation of non-raw file images is "
|
||||
"not supported without qemu-img."));
|
||||
return NULL;
|
||||
|
@ -992,7 +992,7 @@ virStorageBackendForType(int type) {
|
|||
if (backends[i]->type == type)
|
||||
return backends[i];
|
||||
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("missing backend for pool type %d"), type);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1069,7 +1069,7 @@ virStorageBackendVolOpenCheckMode(const char *path, unsigned int flags)
|
|||
VIR_INFO("Skipping volume '%s'", path);
|
||||
|
||||
if (mode & VIR_STORAGE_VOL_OPEN_ERROR) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected storage mode for '%s'"), path);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1444,7 +1444,7 @@ virStorageBackendRunProgRegex(virStoragePoolObjPtr pool,
|
|||
if (err != 0) {
|
||||
char error[100];
|
||||
regerror(err, ®[i], error, sizeof(error));
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to compile regex %s"), error);
|
||||
for (j = 0 ; j <= i ; j++)
|
||||
regfree(®[j]);
|
||||
|
@ -1474,7 +1474,7 @@ virStorageBackendRunProgRegex(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if ((list = VIR_FDOPEN(fd, "r")) == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot read fd"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1586,7 +1586,7 @@ virStorageBackendRunProgNul(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if ((fp = VIR_FDOPEN(fd, "r")) == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot open file using fd"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1646,7 +1646,7 @@ virStorageBackendRunProgRegex(virConnectPtr conn,
|
|||
virStorageBackendListVolRegexFunc func ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("%s not implemented on Win32"), __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1659,7 +1659,8 @@ virStorageBackendRunProgNul(virConnectPtr conn,
|
|||
virStorageBackendListVolNulFunc func ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, _("%s not implemented on Win32"), __FUNCTION__);
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("%s not implemented on Win32"), __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
|
|
@ -29,10 +29,6 @@
|
|||
# include "storage_conf.h"
|
||||
# include "command.h"
|
||||
|
||||
# define virStorageReportError(code, ...) \
|
||||
virReportErrorHelper(VIR_FROM_STORAGE, code, __FILE__, \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
|
||||
typedef char * (*virStorageBackendFindPoolSources)(virConnectPtr conn, const char *srcSpec, unsigned int flags);
|
||||
typedef int (*virStorageBackendCheckPool)(virConnectPtr conn, virStoragePoolObjPtr pool, bool *active);
|
||||
typedef int (*virStorageBackendStartPool)(virConnectPtr conn, virStoragePoolObjPtr pool);
|
||||
|
|
|
@ -106,14 +106,14 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
|
|||
|
||||
if (virStrToLong_ull(groups[3], NULL, 10,
|
||||
&vol->source.extents[0].start) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot parse device start location"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virStrToLong_ull(groups[4], NULL, 10,
|
||||
&vol->source.extents[0].end) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot parse device end location"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ virStorageBackendDiskRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
virFileWaitForDevices();
|
||||
|
||||
if (!virFileExists(pool->def->source.devices[0].path)) {
|
||||
virStorageReportError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("device path '%s' doesn't exist"),
|
||||
pool->def->source.devices[0].path);
|
||||
return -1;
|
||||
|
@ -399,7 +399,7 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
|
||||
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
|
||||
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("Overwrite and no overwrite flags"
|
||||
" are mutually exclusive"));
|
||||
goto error;
|
||||
|
@ -415,10 +415,10 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
if (check > 0) {
|
||||
ok_to_mklabel = true;
|
||||
} else if (check < 0) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_FAILED,
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("Error checking for disk label"));
|
||||
} else {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("Disk label already present"));
|
||||
}
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
|
|||
const char *partedFormat;
|
||||
partedFormat = virStoragePartedFsTypeTypeToString(vol->target.format);
|
||||
if (partedFormat == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("Invalid partition type"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
|
|||
for (i = 0; i < pool->volumes.count; i++) {
|
||||
if (pool->volumes.objs[i]->target.format ==
|
||||
VIR_STORAGE_VOL_DISK_EXTENDED) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("extended partition already exists"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -512,13 +512,13 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool,
|
|||
}
|
||||
}
|
||||
if (i == pool->volumes.count) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("no extended partition found and no primary partition available"));
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("unknown partition type"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ virStorageBackendDiskPartBoundries(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if (smallestExtent == -1) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("no large enough free extent"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
NULL);
|
||||
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("storage pool does not support encrypted "
|
||||
"volumes"));
|
||||
return -1;
|
||||
|
@ -733,7 +733,7 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
isDevMapperDevice = virIsDevMapperDevice(devpath);
|
||||
|
||||
if (!isDevMapperDevice && !STRPREFIX(dev_name, srcname)) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Volume path '%s' did not start with parent "
|
||||
"pool source device name."), dev_name);
|
||||
goto cleanup;
|
||||
|
@ -743,7 +743,7 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
part_num = dev_name + strlen(srcname);
|
||||
|
||||
if (*part_num == 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse partition number from target "
|
||||
"'%s'"), dev_name);
|
||||
goto cleanup;
|
||||
|
|
|
@ -113,7 +113,7 @@ virStorageBackendProbeTarget(virStorageVolTargetPtr target,
|
|||
/* If the backing file is currently unavailable, only log an error,
|
||||
* but continue. Returning -1 here would disable the whole storage
|
||||
* pool, making it unavailable for even maintenance. */
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot probe backing volume format: %s"),
|
||||
*backingStore);
|
||||
ret = -3;
|
||||
|
@ -191,13 +191,13 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTR
|
|||
path = groups[0];
|
||||
|
||||
if (!(name = strrchr(path, '/'))) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("invalid netfs path (no /): %s"), path);
|
||||
goto cleanup;
|
||||
}
|
||||
name += 1;
|
||||
if (*name == '\0') {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("invalid netfs path (ends in /): %s"), path);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSE
|
|||
goto cleanup;
|
||||
|
||||
if (source->nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -355,23 +355,23 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) {
|
|||
|
||||
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
|
||||
if (pool->def->source.nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
return -1;
|
||||
}
|
||||
if (pool->def->source.hosts[0].name == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source host"));
|
||||
return -1;
|
||||
}
|
||||
if (pool->def->source.dir == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source path"));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (pool->def->source.ndevice != 1) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source device"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) {
|
|||
|
||||
/* Short-circuit if already mounted */
|
||||
if ((ret = virStorageBackendFileSystemIsMounted(pool)) != 0) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("Target '%s' is already mounted"),
|
||||
pool->def->target.path);
|
||||
return -1;
|
||||
|
@ -452,23 +452,23 @@ virStorageBackendFileSystemUnmount(virStoragePoolObjPtr pool) {
|
|||
|
||||
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
|
||||
if (pool->def->source.nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
return -1;
|
||||
}
|
||||
if (pool->def->source.hosts[0].name == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source host"));
|
||||
return -1;
|
||||
}
|
||||
if (pool->def->source.dir == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source dir"));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (pool->def->source.ndevice != 1) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source device"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ virStorageBackendFileSystemProbe(const char *device,
|
|||
format, device);
|
||||
|
||||
if (blkid_known_fstype(format) == 0) {
|
||||
virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
_("Not capable of probing for "
|
||||
"filesystem of type %s"),
|
||||
format);
|
||||
|
@ -566,7 +566,7 @@ virStorageBackendFileSystemProbe(const char *device,
|
|||
|
||||
probe = blkid_new_probe_from_filename(device);
|
||||
if (probe == NULL) {
|
||||
virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
_("Failed to create filesystem probe "
|
||||
"for device %s"),
|
||||
device);
|
||||
|
@ -590,7 +590,7 @@ virStorageBackendFileSystemProbe(const char *device,
|
|||
format, device);
|
||||
ret = FILESYSTEM_PROBE_NOT_FOUND;
|
||||
} else if (blkid_probe_lookup_value(probe, "TYPE", &fstype, NULL) == 0) {
|
||||
virStorageReportError(VIR_ERR_STORAGE_POOL_BUILT,
|
||||
virReportError(VIR_ERR_STORAGE_POOL_BUILT,
|
||||
_("Existing filesystem of type '%s' found on "
|
||||
"device '%s'"),
|
||||
fstype, device);
|
||||
|
@ -598,7 +598,7 @@ virStorageBackendFileSystemProbe(const char *device,
|
|||
}
|
||||
|
||||
if (blkid_do_probe(probe) != 1) {
|
||||
virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
|
||||
_("Found additional probes to run, "
|
||||
"filesystem probing may be incorrect"));
|
||||
ret = FILESYSTEM_PROBE_ERROR;
|
||||
|
@ -620,7 +620,7 @@ static virStoragePoolProbeResult
|
|||
virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED,
|
||||
const char *format ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("probing for filesystems is unsupported "
|
||||
"by this build"));
|
||||
|
||||
|
@ -658,7 +658,7 @@ static int
|
|||
virStorageBackendExecuteMKFS(const char *device ATTRIBUTE_UNUSED,
|
||||
const char *format ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("mkfs is not supported on this platform: "
|
||||
"Failed to make filesystem of "
|
||||
"type '%s' on device '%s'"),
|
||||
|
@ -676,7 +676,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool,
|
|||
int ret = -1;
|
||||
|
||||
if (pool->def->source.devices == NULL) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("No source device specified when formatting pool '%s'"),
|
||||
pool->def->name);
|
||||
goto error;
|
||||
|
@ -687,7 +687,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool,
|
|||
VIR_DEBUG("source device: '%s' format: '%s'", device, format);
|
||||
|
||||
if (!virFileExists(device)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("Source device does not exist when formatting pool '%s'"),
|
||||
pool->def->name);
|
||||
goto error;
|
||||
|
@ -743,7 +743,7 @@ virStorageBackendFileSystemBuild(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
|
||||
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
|
||||
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("Overwrite and no overwrite flags"
|
||||
" are mutually exclusive"));
|
||||
goto error;
|
||||
|
@ -754,7 +754,7 @@ virStorageBackendFileSystemBuild(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
goto error;
|
||||
}
|
||||
if (!(p = strrchr(parent, '/'))) {
|
||||
virStorageReportError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("path '%s' is not absolute"),
|
||||
pool->def->target.path);
|
||||
goto error;
|
||||
|
@ -886,7 +886,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
* Unfortunately virStorageBackendProbeTarget() might already
|
||||
* have logged a similar message for the same problem, but only
|
||||
* if AUTO format detection was used. */
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot probe backing volume info: %s"),
|
||||
vol->backingStore.path);
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ static int createFileDir(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
virCheckFlags(0, -1);
|
||||
|
||||
if (inputvol) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s",
|
||||
_("cannot copy from volume to a directory volume"));
|
||||
return -1;
|
||||
|
@ -1056,7 +1056,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
|
|||
|
||||
if (inputvol) {
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("storage pool does not support "
|
||||
"building encrypted volumes from "
|
||||
"other volumes"));
|
||||
|
@ -1076,7 +1076,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
|
|||
if (!create_func)
|
||||
return -1;
|
||||
} else {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("creation of non-raw images "
|
||||
"is not supported without qemu-img"));
|
||||
return -1;
|
||||
|
@ -1148,7 +1148,7 @@ virStorageBackendFileSystemVolDelete(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
case VIR_STORAGE_VOL_BLOCK:
|
||||
case VIR_STORAGE_VOL_NETWORK:
|
||||
default:
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
_("removing block or network volumes is not supported: %s"),
|
||||
vol->target.path);
|
||||
return -1;
|
||||
|
@ -1218,7 +1218,7 @@ virStorageBackendFilesystemResizeQemuImg(const char *path,
|
|||
img_tool = virFindFileInPath("qemu-img");
|
||||
|
||||
if (!img_tool) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("unable to find kvm-img or qemu-img"));
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -63,14 +63,14 @@ virStorageBackendISCSITargetIP(const char *hostname,
|
|||
|
||||
ret = getaddrinfo(hostname, NULL, &hints, &result);
|
||||
if (ret != 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("host lookup failed %s"),
|
||||
gai_strerror(ret));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (result == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("no IP address for target %s"),
|
||||
hostname);
|
||||
return -1;
|
||||
|
@ -79,7 +79,7 @@ virStorageBackendISCSITargetIP(const char *hostname,
|
|||
if (getnameinfo(result->ai_addr, result->ai_addrlen,
|
||||
ipaddr, ipaddrlen, NULL, 0,
|
||||
NI_NUMERICHOST) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot format ip addr for %s"),
|
||||
hostname);
|
||||
freeaddrinfo(result);
|
||||
|
@ -97,7 +97,7 @@ virStorageBackendISCSIPortal(virStoragePoolSourcePtr source)
|
|||
char *portal;
|
||||
|
||||
if (source->nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
return NULL;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ virStorageBackendISCSISession(virStoragePoolObjPtr pool,
|
|||
|
||||
if (session == NULL &&
|
||||
!probe) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("cannot find session"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
|
|||
|
||||
if (VIR_ALLOC_N(line, LINE_SIZE) != 0) {
|
||||
ret = IQN_ERROR;
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Could not allocate memory for output of '%s'"),
|
||||
ISCSIADM);
|
||||
goto out;
|
||||
|
@ -211,7 +211,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
|
|||
}
|
||||
|
||||
if ((fp = VIR_FDOPEN(fd, "r")) == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to open stream for file descriptor "
|
||||
"when reading output from '%s': '%s'"),
|
||||
ISCSIADM, virStrerror(errno, ebuf, sizeof(ebuf)));
|
||||
|
@ -223,7 +223,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
|
|||
newline = strrchr(line, '\n');
|
||||
if (newline == NULL) {
|
||||
ret = IQN_ERROR;
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected line > %d characters "
|
||||
"when parsing output of '%s'"),
|
||||
LINE_SIZE, ISCSIADM);
|
||||
|
@ -241,7 +241,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
|
|||
token = strchr(line, ' ');
|
||||
if (!token) {
|
||||
ret = IQN_ERROR;
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Missing space when parsing output "
|
||||
"of '%s'"), ISCSIADM);
|
||||
goto out;
|
||||
|
@ -303,7 +303,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn,
|
|||
* We will just rely on whether the interface got created
|
||||
* properly. */
|
||||
if (virCommandRun(cmd, &exitstatus) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to run command '%s' to create new iscsi interface"),
|
||||
ISCSIADM);
|
||||
goto cleanup;
|
||||
|
@ -322,7 +322,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriqn,
|
|||
* returned an exit status of > 0, even if they succeeded. We will just
|
||||
* rely on whether iface file got updated properly. */
|
||||
if (virCommandRun(cmd, &exitstatus) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to run command '%s' to update iscsi interface with IQN '%s'"),
|
||||
ISCSIADM, initiatoriqn);
|
||||
goto cleanup;
|
||||
|
@ -587,7 +587,7 @@ virStorageBackendISCSIFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
return NULL;
|
||||
|
||||
if (source->nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -651,20 +651,20 @@ virStorageBackendISCSICheckPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
*isActive = false;
|
||||
|
||||
if (pool->def->source.nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pool->def->source.hosts[0].name == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source host"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pool->def->source.ndevice != 1 ||
|
||||
pool->def->source.devices[0].path == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source device"));
|
||||
return -1;
|
||||
}
|
||||
|
@ -689,20 +689,20 @@ virStorageBackendISCSIStartPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
const char *loginargv[] = { "--login", NULL };
|
||||
|
||||
if (pool->def->source.nhost != 1) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Expected exactly 1 host for the storage pool"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pool->def->source.hosts[0].name == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source host"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pool->def->source.ndevice != 1 ||
|
||||
pool->def->source.devices[0].path == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("missing source device"));
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
|
|||
nextents = 1;
|
||||
if (STREQ(groups[4], VIR_STORAGE_VOL_LOGICAL_SEGTYPE_STRIPED)) {
|
||||
if (virStrToLong_i(groups[5], NULL, 10, &nextents) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("malformed volume extent stripes value"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -162,17 +162,17 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if (virStrToLong_ull(groups[6], NULL, 10, &length) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed volume extent length value"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (virStrToLong_ull(groups[7], NULL, 10, &size) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed volume extent size value"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (virStrToLong_ull(groups[8], NULL, 10, &vol->allocation) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("malformed volume allocation value"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -208,14 +208,14 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
|
|||
if (err != 0) {
|
||||
char error[100];
|
||||
regerror(err, reg, error, sizeof(error));
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to compile regex %s"),
|
||||
error);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (regexec(reg, groups[3], nvars, vars, 0) != 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("malformed volume extent devices value"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if (virStrToLong_ull(offset_str, NULL, 10, &offset) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("malformed volume extent offset value"));
|
||||
VIR_FREE(offset_str);
|
||||
goto cleanup;
|
||||
|
@ -450,7 +450,7 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
|
||||
retval = virStoragePoolSourceListFormat(&sourceList);
|
||||
if (retval == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to get source from sourceList"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -701,7 +701,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
|
|||
virCommandPtr cmd = NULL;
|
||||
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
"%s", _("storage pool does not support encrypted "
|
||||
"volumes"));
|
||||
return -1;
|
||||
|
|
|
@ -228,7 +228,7 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool,
|
|||
}
|
||||
|
||||
if (virStorageBackendGetMinorNumber(names->name, &minor) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to get %s minor number"),
|
||||
names->name);
|
||||
goto out;
|
||||
|
|
|
@ -65,7 +65,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
VIR_DEBUG("Using cephx authorization");
|
||||
if (rados_create(&ptr->cluster,
|
||||
pool->def->source.auth.cephx.username) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to initialize RADOS"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
}
|
||||
|
||||
if (secret == NULL) {
|
||||
virStorageReportError(VIR_ERR_NO_SECRET,
|
||||
virReportError(VIR_ERR_NO_SECRET,
|
||||
_("failed to find the secret"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -95,14 +95,14 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
memset(secret_value, 0, secret_value_size);
|
||||
|
||||
if (rados_key == NULL) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to decode the RADOS key"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Found cephx key: %s", rados_key);
|
||||
if (rados_conf_set(ptr->cluster, "key", rados_key) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to set RADOS option: %s"),
|
||||
"rados_key");
|
||||
goto cleanup;
|
||||
|
@ -111,7 +111,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
memset(rados_key, 0, strlen(rados_key));
|
||||
|
||||
if (rados_conf_set(ptr->cluster, "auth_supported", "cephx") < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to set RADOS option: %s"),
|
||||
"auth_supported");
|
||||
goto cleanup;
|
||||
|
@ -119,12 +119,12 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
} else {
|
||||
VIR_DEBUG("Not using cephx authorization");
|
||||
if (rados_create(&ptr->cluster, NULL) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RADOS cluster"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (rados_conf_set(ptr->cluster, "auth_supported", "none") < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to set RADOS option: %s"),
|
||||
"auth_supported");
|
||||
goto cleanup;
|
||||
|
@ -145,7 +145,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
pool->def->source.hosts[i].name,
|
||||
pool->def->source.hosts[i].port);
|
||||
} else {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("received malformed monitor, check the XML definition"));
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
mon_buff = virBufferContentAndReset(&mon_host);
|
||||
VIR_DEBUG("RADOS mon_host has been set to: %s", mon_buff);
|
||||
if (rados_conf_set(ptr->cluster, "mon_host", mon_buff) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to set RADOS option: %s"),
|
||||
"mon_host");
|
||||
goto cleanup;
|
||||
|
@ -166,7 +166,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
|
|||
|
||||
ptr->starttime = time(0);
|
||||
if (rados_connect(ptr->cluster) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to connect to the RADOS monitor on: %s"),
|
||||
mon_buff);
|
||||
goto cleanup;
|
||||
|
@ -214,7 +214,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
|
|||
int ret = -1;
|
||||
rbd_image_t image;
|
||||
if (rbd_open(ptr.ioctx, vol->name, &image, NULL) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to open the RBD image '%s'"),
|
||||
vol->name);
|
||||
return ret;
|
||||
|
@ -222,7 +222,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
|
|||
|
||||
rbd_image_info_t info;
|
||||
if (rbd_stat(image, &info, sizeof(info)) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to stat the RBD image"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
|
||||
if (rados_ioctx_create(ptr.cluster,
|
||||
pool->def->source.name, &ptr.ioctx) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
|
@ -285,14 +285,14 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
|
||||
struct rados_cluster_stat_t stat;
|
||||
if (rados_cluster_stat(ptr.cluster, &stat) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to stat the RADOS cluster"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
struct rados_pool_stat_t poolstat;
|
||||
if (rados_ioctx_pool_stat(ptr.ioctx, &poolstat) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to stat the RADOS pool '%s'"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
|
@ -382,14 +382,14 @@ static int virStorageBackendRBDDeleteVol(virConnectPtr conn,
|
|||
|
||||
if (rados_ioctx_create(ptr.cluster,
|
||||
pool->def->source.name, &ptr.ioctx) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (rbd_remove(ptr.ioctx, vol->name) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to remove volume '%s/%s'"),
|
||||
pool->def->source.name,
|
||||
vol->name);
|
||||
|
@ -423,20 +423,20 @@ static int virStorageBackendRBDCreateVol(virConnectPtr conn,
|
|||
|
||||
if (rados_ioctx_create(ptr.cluster,
|
||||
pool->def->source.name,&ptr.ioctx) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (vol->target.encryption != NULL) {
|
||||
virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("storage pool does not support encrypted volumes"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (rbd_create(ptr.ioctx, vol->name, vol->capacity, &order) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create volume '%s/%s'"),
|
||||
pool->def->source.name,
|
||||
vol->name);
|
||||
|
@ -469,7 +469,7 @@ static int virStorageBackendRBDRefreshVol(virConnectPtr conn,
|
|||
|
||||
if (rados_ioctx_create(ptr.cluster,
|
||||
pool->def->source.name, &ptr.ioctx) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
|
@ -506,21 +506,21 @@ static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||
|
||||
if (rados_ioctx_create(ptr.cluster,
|
||||
pool->def->source.name, &ptr.ioctx) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
|
||||
pool->def->source.name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (rbd_open(ptr.ioctx, vol->name, &image, NULL) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to open the RBD image '%s'"),
|
||||
vol->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (rbd_resize(image, capacity) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("failed to resize the RBD image '%s'"),
|
||||
vol->name);
|
||||
goto cleanup;
|
||||
|
|
|
@ -86,7 +86,7 @@ getDeviceType(uint32_t host,
|
|||
* character is not \0, virStrToLong_i complains
|
||||
*/
|
||||
if (virStrToLong_i(typestr, &p, 10, type) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Device type '%s' is not an integer"),
|
||||
typestr);
|
||||
/* Hm, type wasn't an integer; seems strange */
|
||||
|
@ -266,7 +266,7 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
|
|||
&vol->allocation,
|
||||
&vol->capacity) < 0) {
|
||||
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to update volume for '%s'"),
|
||||
devpath);
|
||||
retval = -1;
|
||||
|
@ -365,7 +365,7 @@ getOldStyleBlockDevice(const char *lun_path ATTRIBUTE_UNUSED,
|
|||
blockp = strrchr(block_name, ':');
|
||||
if (blockp == NULL) {
|
||||
/* Hm, wasn't what we were expecting; have to give up */
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to parse block name %s"),
|
||||
block_name);
|
||||
retval = -1;
|
||||
|
@ -453,7 +453,7 @@ processLU(virStoragePoolObjPtr pool,
|
|||
host, bus, target, lun);
|
||||
|
||||
if (getDeviceType(host, bus, target, lun, &device_type) < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Failed to determine if %u:%u:%u:%u is a Direct-Access LUN"),
|
||||
host, bus, target, lun);
|
||||
retval = -1;
|
||||
|
|
|
@ -268,7 +268,7 @@ storagePoolLookupByUUID(virConnectPtr conn,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ storagePoolLookupByName(virConnectPtr conn,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
_("no pool with matching name '%s'"), name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ storageFindPoolSources(virConnectPtr conn,
|
|||
|
||||
backend_type = virStoragePoolTypeFromString(type);
|
||||
if (backend_type < 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unknown storage pool type %s"), type);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ storageFindPoolSources(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!backend->findPoolSources) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
_("pool type '%s' does not support source "
|
||||
"discovery"), type);
|
||||
goto cleanup;
|
||||
|
@ -475,7 +475,7 @@ static int storagePoolIsActive(virStoragePoolPtr pool)
|
|||
obj = virStoragePoolObjFindByUUID(&driver->pools, pool->uuid);
|
||||
storageDriverUnlock(driver);
|
||||
if (!obj) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
|
||||
goto cleanup;
|
||||
}
|
||||
ret = virStoragePoolObjIsActive(obj);
|
||||
|
@ -496,7 +496,7 @@ static int storagePoolIsPersistent(virStoragePoolPtr pool)
|
|||
obj = virStoragePoolObjFindByUUID(&driver->pools, pool->uuid);
|
||||
storageDriverUnlock(driver);
|
||||
if (!obj) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL, NULL);
|
||||
goto cleanup;
|
||||
}
|
||||
ret = obj->configFile ? 1 : 0;
|
||||
|
@ -620,19 +620,19 @@ storagePoolUndefine(virStoragePoolPtr obj) {
|
|||
storageDriverLock(driver);
|
||||
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("pool is still active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (pool->asyncjobs > 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("pool '%s' has asynchronous jobs running."),
|
||||
pool->def->name);
|
||||
goto cleanup;
|
||||
|
@ -678,7 +678,7 @@ storagePoolStart(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -687,7 +687,7 @@ storagePoolStart(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("pool already active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -724,7 +724,7 @@ storagePoolBuild(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -733,7 +733,7 @@ storagePoolBuild(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is already active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -761,7 +761,7 @@ storagePoolDestroy(virStoragePoolPtr obj) {
|
|||
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -770,13 +770,13 @@ storagePoolDestroy(virStoragePoolPtr obj) {
|
|||
goto cleanup;
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (pool->asyncjobs > 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("pool '%s' has asynchronous jobs running."),
|
||||
pool->def->name);
|
||||
goto cleanup;
|
||||
|
@ -821,7 +821,7 @@ storagePoolDelete(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -830,20 +830,20 @@ storagePoolDelete(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is still active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (pool->asyncjobs > 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("pool '%s' has asynchronous jobs running."),
|
||||
pool->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!backend->deletePool) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
"%s", _("pool does not support pool deletion"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ storagePoolRefresh(virStoragePoolPtr obj,
|
|||
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -883,13 +883,13 @@ storagePoolRefresh(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (pool->asyncjobs > 0) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("pool '%s' has asynchronous jobs running."),
|
||||
pool->def->name);
|
||||
goto cleanup;
|
||||
|
@ -930,7 +930,7 @@ storagePoolGetInfo(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ storagePoolGetXMLDesc(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ storagePoolGetAutostart(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1029,13 +1029,13 @@ storagePoolSetAutostart(virStoragePoolPtr obj,
|
|||
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!pool->configFile) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("pool has no config file"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1089,13 +1089,13 @@ storagePoolNumVolumes(virStoragePoolPtr obj) {
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1122,13 +1122,13 @@ storagePoolListVolumes(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1167,13 +1167,13 @@ storageVolumeLookupByName(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1181,7 +1181,7 @@ storageVolumeLookupByName(virStoragePoolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, name);
|
||||
|
||||
if (!vol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
name);
|
||||
goto cleanup;
|
||||
|
@ -1221,7 +1221,7 @@ storageVolumeLookupByKey(virConnectPtr conn,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!ret)
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
"%s", _("no storage vol with matching key"));
|
||||
|
||||
return ret;
|
||||
|
@ -1272,7 +1272,7 @@ storageVolumeLookupByPath(virConnectPtr conn,
|
|||
}
|
||||
|
||||
if (!ret)
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
"%s", _("no storage vol with matching path"));
|
||||
|
||||
VIR_FREE(cleanpath);
|
||||
|
@ -1300,13 +1300,13 @@ storageVolumeCreateXML(virStoragePoolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1319,7 +1319,7 @@ storageVolumeCreateXML(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (virStorageVolDefFindByName(pool, voldef->name)) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
"%s", _("storage vol already exists"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1331,7 +1331,7 @@ storageVolumeCreateXML(virStoragePoolPtr obj,
|
|||
}
|
||||
|
||||
if (!backend->createVol) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
"%s", _("storage pool does not support volume "
|
||||
"creation"));
|
||||
goto cleanup;
|
||||
|
@ -1430,26 +1430,26 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
|||
}
|
||||
storageDriverUnlock(driver);
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (STRNEQ(obj->name, vobj->pool) && !origpool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
_("no storage pool with matching name '%s'"),
|
||||
vobj->pool);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (origpool && !virStoragePoolObjIsActive(origpool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1459,7 +1459,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
|||
|
||||
origvol = virStorageVolDefFindByName(origpool ? origpool : pool, vobj->name);
|
||||
if (!origvol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
vobj->name);
|
||||
goto cleanup;
|
||||
|
@ -1470,7 +1470,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
|||
goto cleanup;
|
||||
|
||||
if (virStorageVolDefFindByName(pool, newvol->name)) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("storage volume name '%s' already in use."),
|
||||
newvol->name);
|
||||
goto cleanup;
|
||||
|
@ -1486,13 +1486,13 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
|||
newvol->allocation = origvol->capacity;
|
||||
|
||||
if (!backend->buildVolFrom) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
"%s", _("storage pool does not support volume creation from an existing volume"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (origvol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
origvol->name);
|
||||
goto cleanup;
|
||||
|
@ -1590,13 +1590,13 @@ storageVolumeDownload(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -1604,14 +1604,14 @@ storageVolumeDownload(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (vol == NULL) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
|
@ -1652,13 +1652,13 @@ storageVolumeUpload(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -1666,14 +1666,14 @@ storageVolumeUpload(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (vol == NULL) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
|
@ -1715,13 +1715,13 @@ storageVolumeResize(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
_("no storage pool with matching uuid"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("storage pool is not active"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -1732,14 +1732,14 @@ storageVolumeResize(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (vol == NULL) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
|
@ -1753,20 +1753,20 @@ storageVolumeResize(virStorageVolPtr obj,
|
|||
}
|
||||
|
||||
if (abs_capacity < vol->allocation) {
|
||||
virStorageReportError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("can't shrink capacity below "
|
||||
"existing allocation"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (abs_capacity > vol->capacity + pool->def->available) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_FAILED,
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
_("Not enough space left on storage pool"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!backend->resizeVol) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
_("storage pool does not support changing of "
|
||||
"volume capacity"));
|
||||
goto out;
|
||||
|
@ -1944,7 +1944,7 @@ storageVolumeWipeInternal(virStorageVolDefPtr def,
|
|||
alg_char = "random";
|
||||
break;
|
||||
default:
|
||||
virStorageReportError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("unsupported algorithm %d"),
|
||||
algorithm);
|
||||
}
|
||||
|
@ -1998,7 +1998,7 @@ storageVolumeWipePattern(virStorageVolPtr obj,
|
|||
virCheckFlags(0, -1);
|
||||
|
||||
if (algorithm >= VIR_STORAGE_VOL_WIPE_ALG_LAST) {
|
||||
virStorageReportError(VIR_ERR_INVALID_ARG,
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("wiping algorithm %d not supported"),
|
||||
algorithm);
|
||||
return -1;
|
||||
|
@ -2009,13 +2009,13 @@ storageVolumeWipePattern(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -2023,14 +2023,14 @@ storageVolumeWipePattern(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (vol == NULL) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
|
@ -2073,13 +2073,13 @@ storageVolumeDelete(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -2090,21 +2090,21 @@ storageVolumeDelete(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (!vol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!backend->deleteVol) {
|
||||
virStorageReportError(VIR_ERR_NO_SUPPORT,
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
"%s", _("storage pool does not support vol deletion"));
|
||||
|
||||
goto cleanup;
|
||||
|
@ -2154,13 +2154,13 @@ storageVolumeGetInfo(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -2168,7 +2168,7 @@ storageVolumeGetInfo(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (!vol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto cleanup;
|
||||
|
@ -2210,13 +2210,13 @@ storageVolumeGetXMLDesc(virStorageVolPtr obj,
|
|||
storageDriverUnlock(driver);
|
||||
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -2224,7 +2224,7 @@ storageVolumeGetXMLDesc(virStorageVolPtr obj,
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (!vol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto cleanup;
|
||||
|
@ -2257,13 +2257,13 @@ storageVolumeGetPath(virStorageVolPtr obj) {
|
|||
pool = virStoragePoolObjFindByName(&driver->pools, obj->pool);
|
||||
storageDriverUnlock(driver);
|
||||
if (!pool) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_POOL,
|
||||
"%s", _("no storage pool with matching uuid"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!virStoragePoolObjIsActive(pool)) {
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
"%s", _("storage pool is not active"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -2271,7 +2271,7 @@ storageVolumeGetPath(virStorageVolPtr obj) {
|
|||
vol = virStorageVolDefFindByName(pool, obj->name);
|
||||
|
||||
if (!vol) {
|
||||
virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
virReportError(VIR_ERR_NO_STORAGE_VOL,
|
||||
_("no storage vol with matching name '%s'"),
|
||||
obj->name);
|
||||
goto cleanup;
|
||||
|
|
Loading…
Reference in New Issue