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
virCheckFlags(0, -1);
if (vol->target.encryption != NULL) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("storage pool does not support encrypted "
- "volumes"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("storage pool does not support encrypted "
+ "volumes"));
goto cleanup;
}
for (attempt = 0; attempt < 65536; attempt++) {
virSecretPtr tmp;
if (virUUIDGenerate(uuid) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("unable to generate uuid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unable to generate uuid"));
return -1;
}
tmp = conn->secretDriver->lookupByUUID(conn, uuid);
virSecretFree(tmp);
}
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("too many conflicts when generating an uuid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("too many conflicts when generating an uuid"));
return -1;
}
conn->secretDriver->lookupByUUID == NULL ||
conn->secretDriver->defineXML == NULL ||
conn->secretDriver->setValue == NULL) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("secret storage not supported"));
+ 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",
- _("secrets already defined"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("secrets already defined"));
goto cleanup;
}
if ((start = strstr(help, " create ")) == NULL ||
(end = strstr(start, "\n")) == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unable to parse qemu-img output '%s'"),
- help);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unable to parse qemu-img output '%s'"),
+ help);
goto cleanup;
}
if (((tmp = strstr(start, "-F fmt")) && tmp < end) ||
NULL;
if (type == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol type %d"),
- vol->target.format);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown storage vol type %d"),
+ vol->target.format);
return -1;
}
if (inputvol && inputType == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol type %d"),
- inputvol->target.format);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown storage vol type %d"),
+ inputvol->target.format);
return -1;
}
if (inputvol &&
(!inputBackingPath ||
STRNEQ(inputBackingPath, vol->backingStore.path))) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("a different backing store cannot "
- "be specified."));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("a different backing store cannot "
+ "be specified."));
return -1;
}
if (backingType == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage vol backing store type %d"),
- vol->backingStore.format);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown storage vol backing store type %d"),
+ vol->backingStore.format);
return -1;
}
if (vol->target.format != VIR_STORAGE_FILE_QCOW &&
vol->target.format != VIR_STORAGE_FILE_QCOW2) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("qcow volume encryption unsupported with "
- "volume format %s"), type);
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("qcow volume encryption unsupported with "
+ "volume format %s"), type);
return -1;
}
enc = vol->target.encryption;
if (enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_QCOW &&
enc->format != VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported volume encryption format %d"),
- vol->target.encryption->format);
+ 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",
- _("too many secrets for qcow encryption"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("too many secrets for qcow encryption"));
return -1;
}
if (enc->format == VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT ||
create_tool = virFindFileInPath("qemu-img");
if (!create_tool) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to find kvm-img or qemu-img"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to find kvm-img or qemu-img"));
return -1;
}
virCheckFlags(0, -1);
if (inputvol) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot copy from volume with qcow-create"));
+ 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,
- _("unsupported storage vol type %d"),
- vol->target.format);
+ 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",
- _("copy-on-write image not supported with "
- "qcow-create"));
+ 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,
- "%s", _("encrypted volumes not supported with "
- "qcow-create"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("encrypted volumes not supported with "
+ "qcow-create"));
return -1;
}
case TOOL_QCOW_CREATE:
return virStorageBackendCreateQcowCreate;
default:
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown file create tool type '%d'."),
- tool_type);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown file create tool type '%d'."),
+ tool_type);
}
return NULL;
inputvol->target.format != VIR_STORAGE_FILE_RAW)) {
if ((tool_type = virStorageBackendFindFSImageTool(NULL)) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("creation of non-raw file images is "
- "not supported without qemu-img."));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("creation of non-raw file images is "
+ "not supported without qemu-img."));
return NULL;
}
if (backends[i]->type == type)
return backends[i];
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing backend for pool type %d"), type);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("missing backend for pool type %d"), type);
return NULL;
}
VIR_INFO("Skipping volume '%s'", path);
if (mode & VIR_STORAGE_VOL_OPEN_ERROR) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected storage mode for '%s'"), path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected storage mode for '%s'"), path);
return -1;
}
if (err != 0) {
char error[100];
regerror(err, ®[i], error, sizeof(error));
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to compile regex %s"), error);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to compile regex %s"), error);
for (j = 0 ; j <= i ; j++)
regfree(®[j]);
VIR_FREE(reg);
}
if ((list = VIR_FDOPEN(fd, "r")) == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot read fd"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot read fd"));
goto cleanup;
}
}
if ((fp = VIR_FDOPEN(fd, "r")) == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot open file using fd"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot open file using fd"));
goto cleanup;
}
virStorageBackendListVolRegexFunc 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;
}
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 */
# 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);
if (virStrToLong_ull(groups[3], NULL, 10,
&vol->source.extents[0].start) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot parse device start location"));
+ 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,
- "%s", _("cannot parse device end location"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot parse device end location"));
return -1;
}
virFileWaitForDevices();
if (!virFileExists(pool->def->source.devices[0].path)) {
- virStorageReportError(VIR_ERR_INVALID_ARG,
- _("device path '%s' doesn't exist"),
- pool->def->source.devices[0].path);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("device path '%s' doesn't exist"),
+ pool->def->source.devices[0].path);
return -1;
}
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("Overwrite and no overwrite flags"
- " are mutually exclusive"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Overwrite and no overwrite flags"
+ " are mutually exclusive"));
goto error;
}
if (check > 0) {
ok_to_mklabel = true;
} else if (check < 0) {
- virStorageReportError(VIR_ERR_OPERATION_FAILED,
- _("Error checking for disk label"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("Error checking for disk label"));
} else {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("Disk label already present"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Disk label already present"));
}
}
const char *partedFormat;
partedFormat = virStoragePartedFsTypeTypeToString(vol->target.format);
if (partedFormat == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Invalid partition type"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Invalid partition type"));
return -1;
}
if (vol->target.format == VIR_STORAGE_VOL_DISK_EXTENDED) {
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",
- _("extended partition already exists"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("extended partition already exists"));
return -1;
}
}
}
}
if (i == pool->volumes.count) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("no extended partition found and no primary partition available"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no extended partition found and no primary partition available"));
return -1;
}
break;
default:
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unknown partition type"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unknown partition type"));
return -1;
}
}
}
if (smallestExtent == -1) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("no large enough free extent"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no large enough free extent"));
return -1;
}
NULL);
if (vol->target.encryption != NULL) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("storage pool does not support encrypted "
- "volumes"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("storage pool does not support encrypted "
+ "volumes"));
return -1;
}
isDevMapperDevice = virIsDevMapperDevice(devpath);
if (!isDevMapperDevice && !STRPREFIX(dev_name, srcname)) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Volume path '%s' did not start with parent "
- "pool source device name."), dev_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Volume path '%s' did not start with parent "
+ "pool source device name."), dev_name);
goto cleanup;
}
part_num = dev_name + strlen(srcname);
if (*part_num == 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse partition number from target "
- "'%s'"), dev_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse partition number from target "
+ "'%s'"), dev_name);
goto cleanup;
}
/* 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,
- _("cannot probe backing volume format: %s"),
- *backingStore);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot probe backing volume format: %s"),
+ *backingStore);
ret = -3;
} else {
*backingStoreFormat = ret;
path = groups[0];
if (!(name = strrchr(path, '/'))) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid netfs path (no /): %s"), path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("invalid netfs path (no /): %s"), path);
goto cleanup;
}
name += 1;
if (*name == '\0') {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid netfs path (ends in /): %s"), path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("invalid netfs path (ends in /): %s"), path);
goto cleanup;
}
goto cleanup;
if (source->nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Expected exactly 1 host for the storage pool"));
goto cleanup;
}
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
if (pool->def->source.nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ 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,
- "%s", _("missing source host"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source host"));
return -1;
}
if (pool->def->source.dir == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing source path"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source path"));
return -1;
}
} else {
if (pool->def->source.ndevice != 1) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing source device"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source device"));
return -1;
}
}
/* Short-circuit if already mounted */
if ((ret = virStorageBackendFileSystemIsMounted(pool)) != 0) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("Target '%s' is already mounted"),
- pool->def->target.path);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Target '%s' is already mounted"),
+ pool->def->target.path);
return -1;
}
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
if (pool->def->source.nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ 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,
- "%s", _("missing source host"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source host"));
return -1;
}
if (pool->def->source.dir == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing source dir"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source dir"));
return -1;
}
} else {
if (pool->def->source.ndevice != 1) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("missing source device"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source device"));
return -1;
}
}
format, device);
if (blkid_known_fstype(format) == 0) {
- virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Not capable of probing for "
- "filesystem of type %s"),
- format);
+ virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
+ _("Not capable of probing for "
+ "filesystem of type %s"),
+ format);
goto error;
}
probe = blkid_new_probe_from_filename(device);
if (probe == NULL) {
- virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Failed to create filesystem probe "
- "for device %s"),
- device);
+ virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
+ _("Failed to create filesystem probe "
+ "for device %s"),
+ device);
goto error;
}
format, device);
ret = FILESYSTEM_PROBE_NOT_FOUND;
} else if (blkid_probe_lookup_value(probe, "TYPE", &fstype, NULL) == 0) {
- virStorageReportError(VIR_ERR_STORAGE_POOL_BUILT,
- _("Existing filesystem of type '%s' found on "
- "device '%s'"),
- fstype, device);
+ virReportError(VIR_ERR_STORAGE_POOL_BUILT,
+ _("Existing filesystem of type '%s' found on "
+ "device '%s'"),
+ fstype, device);
ret = FILESYSTEM_PROBE_FOUND;
}
if (blkid_do_probe(probe) != 1) {
- virStorageReportError(VIR_ERR_STORAGE_PROBE_FAILED,
- _("Found additional probes to run, "
- "filesystem probing may be incorrect"));
+ virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
+ _("Found additional probes to run, "
+ "filesystem probing may be incorrect"));
ret = FILESYSTEM_PROBE_ERROR;
}
virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED,
const char *format ATTRIBUTE_UNUSED)
{
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("probing for filesystems is unsupported "
- "by this build"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("probing for filesystems is unsupported "
+ "by this build"));
return FILESYSTEM_PROBE_ERROR;
}
virStorageBackendExecuteMKFS(const char *device ATTRIBUTE_UNUSED,
const char *format ATTRIBUTE_UNUSED)
{
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("mkfs is not supported on this platform: "
- "Failed to make filesystem of "
- "type '%s' on device '%s'"),
- format, device);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("mkfs is not supported on this platform: "
+ "Failed to make filesystem of "
+ "type '%s' on device '%s'"),
+ format, device);
return -1;
}
#endif /* #ifdef MKFS */
int ret = -1;
if (pool->def->source.devices == NULL) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("No source device specified when formatting pool '%s'"),
- pool->def->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("No source device specified when formatting pool '%s'"),
+ pool->def->name);
goto error;
}
VIR_DEBUG("source device: '%s' format: '%s'", device, format);
if (!virFileExists(device)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("Source device does not exist when formatting pool '%s'"),
- pool->def->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Source device does not exist when formatting pool '%s'"),
+ pool->def->name);
goto error;
}
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("Overwrite and no overwrite flags"
- " are mutually exclusive"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Overwrite and no overwrite flags"
+ " are mutually exclusive"));
goto error;
}
goto error;
}
if (!(p = strrchr(parent, '/'))) {
- virStorageReportError(VIR_ERR_INVALID_ARG,
- _("path '%s' is not absolute"),
- pool->def->target.path);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("path '%s' is not absolute"),
+ pool->def->target.path);
goto error;
}
* 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,
- _("cannot probe backing volume info: %s"),
- vol->backingStore.path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot probe backing volume info: %s"),
+ vol->backingStore.path);
}
}
virCheckFlags(0, -1);
if (inputvol) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s",
- _("cannot copy from volume to a directory volume"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s",
+ _("cannot copy from volume to a directory volume"));
return -1;
}
if (inputvol) {
if (vol->target.encryption != NULL) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("storage pool does not support "
- "building encrypted volumes from "
- "other volumes"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("storage pool does not support "
+ "building encrypted volumes from "
+ "other volumes"));
return -1;
}
create_func = virStorageBackendGetBuildVolFromFunction(vol,
if (!create_func)
return -1;
} else {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("creation of non-raw images "
- "is not supported without qemu-img"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("creation of non-raw images "
+ "is not supported without qemu-img"));
return -1;
}
case VIR_STORAGE_VOL_BLOCK:
case VIR_STORAGE_VOL_NETWORK:
default:
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- _("removing block or network volumes is not supported: %s"),
- vol->target.path);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("removing block or network volumes is not supported: %s"),
+ vol->target.path);
return -1;
}
return 0;
img_tool = virFindFileInPath("qemu-img");
if (!img_tool) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to find kvm-img or qemu-img"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to find kvm-img or qemu-img"));
return -1;
}
ret = getaddrinfo(hostname, NULL, &hints, &result);
if (ret != 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("host lookup failed %s"),
- gai_strerror(ret));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("host lookup failed %s"),
+ gai_strerror(ret));
return -1;
}
if (result == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("no IP address for target %s"),
- hostname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("no IP address for target %s"),
+ hostname);
return -1;
}
if (getnameinfo(result->ai_addr, result->ai_addrlen,
ipaddr, ipaddrlen, NULL, 0,
NI_NUMERICHOST) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot format ip addr for %s"),
- hostname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot format ip addr for %s"),
+ hostname);
freeaddrinfo(result);
return -1;
}
char *portal;
if (source->nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Expected exactly 1 host for the storage pool"));
return NULL;
}
if (session == NULL &&
!probe) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot find session"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot find session"));
goto cleanup;
}
if (VIR_ALLOC_N(line, LINE_SIZE) != 0) {
ret = IQN_ERROR;
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not allocate memory for output of '%s'"),
- ISCSIADM);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not allocate memory for output of '%s'"),
+ ISCSIADM);
goto out;
}
}
if ((fp = VIR_FDOPEN(fd, "r")) == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to open stream for file descriptor "
- "when reading output from '%s': '%s'"),
- ISCSIADM, virStrerror(errno, ebuf, sizeof(ebuf)));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to open stream for file descriptor "
+ "when reading output from '%s': '%s'"),
+ ISCSIADM, virStrerror(errno, ebuf, sizeof(ebuf)));
ret = IQN_ERROR;
goto out;
}
newline = strrchr(line, '\n');
if (newline == NULL) {
ret = IQN_ERROR;
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected line > %d characters "
- "when parsing output of '%s'"),
- LINE_SIZE, ISCSIADM);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected line > %d characters "
+ "when parsing output of '%s'"),
+ LINE_SIZE, ISCSIADM);
goto out;
}
*newline = '\0';
token = strchr(line, ' ');
if (!token) {
ret = IQN_ERROR;
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Missing space when parsing output "
- "of '%s'"), ISCSIADM);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Missing space when parsing output "
+ "of '%s'"), ISCSIADM);
goto out;
}
*ifacename = strndup(line, token - line);
* We will just rely on whether the interface got created
* properly. */
if (virCommandRun(cmd, &exitstatus) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to run command '%s' to create new iscsi interface"),
- ISCSIADM);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to run command '%s' to create new iscsi interface"),
+ ISCSIADM);
goto cleanup;
}
virCommandFree(cmd);
* 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,
- _("Failed to run command '%s' to update iscsi interface with IQN '%s'"),
- ISCSIADM, initiatoriqn);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to run command '%s' to update iscsi interface with IQN '%s'"),
+ ISCSIADM, initiatoriqn);
goto cleanup;
}
return NULL;
if (source->nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Expected exactly 1 host for the storage pool"));
goto cleanup;
}
*isActive = false;
if (pool->def->source.nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ 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,
- "%s", _("missing source host"));
+ 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,
- "%s", _("missing source device"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source device"));
return -1;
}
const char *loginargv[] = { "--login", NULL };
if (pool->def->source.nhost != 1) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Expected exactly 1 host for the storage pool"));
+ 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,
- "%s", _("missing source host"));
+ 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,
- "%s", _("missing source device"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("missing source device"));
return -1;
}
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",
- _("malformed volume extent stripes value"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("malformed volume extent stripes value"));
goto cleanup;
}
}
}
if (virStrToLong_ull(groups[6], NULL, 10, &length) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("malformed volume extent length value"));
+ 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,
- "%s", _("malformed volume extent size value"));
+ 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,
- "%s", _("malformed volume allocation value"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("malformed volume allocation value"));
goto cleanup;
}
if (err != 0) {
char error[100];
regerror(err, reg, error, sizeof(error));
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to compile regex %s"),
- 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",
- _("malformed volume extent devices value"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("malformed volume extent devices value"));
goto cleanup;
}
}
if (virStrToLong_ull(offset_str, NULL, 10, &offset) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("malformed volume extent offset value"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("malformed volume extent offset value"));
VIR_FREE(offset_str);
goto cleanup;
}
retval = virStoragePoolSourceListFormat(&sourceList);
if (retval == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to get source from sourceList"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to get source from sourceList"));
goto cleanup;
}
virCommandPtr cmd = NULL;
if (vol->target.encryption != NULL) {
- virStorageReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("storage pool does not support encrypted "
- "volumes"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("storage pool does not support encrypted "
+ "volumes"));
return -1;
}
}
if (virStorageBackendGetMinorNumber(names->name, &minor) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to get %s minor number"),
- names->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to get %s minor number"),
+ names->name);
goto out;
}
VIR_DEBUG("Using cephx authorization");
if (rados_create(&ptr->cluster,
pool->def->source.auth.cephx.username) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to initialize RADOS"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to initialize RADOS"));
goto cleanup;
}
}
if (secret == NULL) {
- virStorageReportError(VIR_ERR_NO_SECRET,
- _("failed to find the secret"));
+ virReportError(VIR_ERR_NO_SECRET,
+ _("failed to find the secret"));
goto cleanup;
}
memset(secret_value, 0, secret_value_size);
if (rados_key == NULL) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to decode the RADOS key"));
+ 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,
- _("failed to set RADOS option: %s"),
- "rados_key");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "rados_key");
goto cleanup;
}
memset(rados_key, 0, strlen(rados_key));
if (rados_conf_set(ptr->cluster, "auth_supported", "cephx") < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to set RADOS option: %s"),
- "auth_supported");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "auth_supported");
goto cleanup;
}
} else {
VIR_DEBUG("Not using cephx authorization");
if (rados_create(&ptr->cluster, NULL) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RADOS cluster"));
+ 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,
- _("failed to set RADOS option: %s"),
- "auth_supported");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "auth_supported");
goto cleanup;
}
}
pool->def->source.hosts[i].name,
pool->def->source.hosts[i].port);
} else {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("received malformed monitor, check the XML definition"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("received malformed monitor, check the XML definition"));
}
}
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,
- _("failed to set RADOS option: %s"),
- "mon_host");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to set RADOS option: %s"),
+ "mon_host");
goto cleanup;
}
ptr->starttime = time(0);
if (rados_connect(ptr->cluster) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to connect to the RADOS monitor on: %s"),
- mon_buff);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to connect to the RADOS monitor on: %s"),
+ mon_buff);
goto cleanup;
}
int ret = -1;
rbd_image_t image;
if (rbd_open(ptr.ioctx, vol->name, &image, NULL) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to open the RBD image '%s'"),
- vol->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to open the RBD image '%s'"),
+ vol->name);
return ret;
}
rbd_image_info_t info;
if (rbd_stat(image, &info, sizeof(info)) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to stat the RBD image"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to stat the RBD image"));
goto cleanup;
}
if (rados_ioctx_create(ptr.cluster,
pool->def->source.name, &ptr.ioctx) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
- pool->def->source.name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
+ pool->def->source.name);
goto cleanup;
}
struct rados_cluster_stat_t stat;
if (rados_cluster_stat(ptr.cluster, &stat) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to stat the RADOS cluster"));
+ 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,
- _("failed to stat the RADOS pool '%s'"),
- pool->def->source.name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to stat the RADOS pool '%s'"),
+ pool->def->source.name);
goto cleanup;
}
if (rados_ioctx_create(ptr.cluster,
pool->def->source.name, &ptr.ioctx) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
- pool->def->source.name);
+ 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,
- _("failed to remove volume '%s/%s'"),
- pool->def->source.name,
- vol->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to remove volume '%s/%s'"),
+ pool->def->source.name,
+ vol->name);
goto cleanup;
}
if (rados_ioctx_create(ptr.cluster,
pool->def->source.name,&ptr.ioctx) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
- pool->def->source.name);
+ 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",
- _("storage pool does not support encrypted volumes"));
+ 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,
- _("failed to create volume '%s/%s'"),
- pool->def->source.name,
- vol->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to create volume '%s/%s'"),
+ pool->def->source.name,
+ vol->name);
goto cleanup;
}
if (rados_ioctx_create(ptr.cluster,
pool->def->source.name, &ptr.ioctx) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
- pool->def->source.name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
+ pool->def->source.name);
goto cleanup;
}
if (rados_ioctx_create(ptr.cluster,
pool->def->source.name, &ptr.ioctx) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create the RBD IoCTX. Does the pool '%s' exist?"),
- pool->def->source.name);
+ 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,
- _("failed to open the RBD image '%s'"),
- vol->name);
+ 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,
- _("failed to resize the RBD image '%s'"),
- vol->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to resize the RBD image '%s'"),
+ vol->name);
goto cleanup;
}
* character is not \0, virStrToLong_i complains
*/
if (virStrToLong_i(typestr, &p, 10, type) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Device type '%s' is not an integer"),
- typestr);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Device type '%s' is not an integer"),
+ typestr);
/* Hm, type wasn't an integer; seems strange */
retval = -1;
goto out;
&vol->allocation,
&vol->capacity) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to update volume for '%s'"),
- devpath);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to update volume for '%s'"),
+ devpath);
retval = -1;
goto free_vol;
}
blockp = strrchr(block_name, ':');
if (blockp == NULL) {
/* Hm, wasn't what we were expecting; have to give up */
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse block name %s"),
- block_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to parse block name %s"),
+ block_name);
retval = -1;
} else {
blockp++;
host, bus, target, lun);
if (getDeviceType(host, bus, target, lun, &device_type) < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to determine if %u:%u:%u:%u is a Direct-Access LUN"),
- host, bus, target, lun);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to determine if %u:%u:%u:%u is a Direct-Access LUN"),
+ host, bus, target, lun);
retval = -1;
goto out;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no pool with matching uuid"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- _("no pool with matching name '%s'"), name);
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ _("no pool with matching name '%s'"), name);
goto cleanup;
}
backend_type = virStoragePoolTypeFromString(type);
if (backend_type < 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown storage pool type %s"), type);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown storage pool type %s"), type);
goto cleanup;
}
goto cleanup;
if (!backend->findPoolSources) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- _("pool type '%s' does not support source "
- "discovery"), type);
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("pool type '%s' does not support source "
+ "discovery"), type);
goto cleanup;
}
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);
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;
storageDriverLock(driver);
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("pool is still active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("pool is still active"));
goto cleanup;
}
if (pool->asyncjobs > 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
- pool->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("pool '%s' has asynchronous jobs running."),
+ pool->def->name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
goto cleanup;
if (virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("pool already active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("pool already active"));
goto cleanup;
}
if (backend->startPool &&
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
goto cleanup;
if (virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is already active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is already active"));
goto cleanup;
}
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
goto cleanup;
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
if (pool->asyncjobs > 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
- pool->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("pool '%s' has asynchronous jobs running."),
+ pool->def->name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
goto cleanup;
if (virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is still active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is still active"));
goto cleanup;
}
if (pool->asyncjobs > 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("pool '%s' has asynchronous jobs running."),
pool->def->name);
goto cleanup;
}
if (!backend->deletePool) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- "%s", _("pool does not support pool deletion"));
+ virReportError(VIR_ERR_NO_SUPPORT,
+ "%s", _("pool does not support pool deletion"));
goto cleanup;
}
if (backend->deletePool(obj->conn, pool, flags) < 0)
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
goto cleanup;
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
if (pool->asyncjobs > 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("pool '%s' has asynchronous jobs running."),
- pool->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("pool '%s' has asynchronous jobs running."),
+ pool->def->name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no pool with matching uuid"));
goto cleanup;
}
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no pool with matching uuid"));
goto cleanup;
}
if (!pool->configFile) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("pool has no config file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("pool has no config file"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
ret = pool->volumes.count;
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
vol = virStorageVolDefFindByName(pool, name);
if (!vol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- name);
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!ret)
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- "%s", _("no storage vol with matching key"));
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ "%s", _("no storage vol with matching key"));
return ret;
}
}
if (!ret)
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- "%s", _("no storage vol with matching path"));
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ "%s", _("no storage vol with matching path"));
VIR_FREE(cleanpath);
storageDriverUnlock(driver);
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
goto cleanup;
if (virStorageVolDefFindByName(pool, voldef->name)) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- "%s", _("storage vol already exists"));
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ "%s", _("storage vol already exists"));
goto cleanup;
}
}
if (!backend->createVol) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- "%s", _("storage pool does not support volume "
- "creation"));
+ virReportError(VIR_ERR_NO_SUPPORT,
+ "%s", _("storage pool does not support volume "
+ "creation"));
goto cleanup;
}
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ 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,
- _("no storage pool with matching name '%s'"),
- vobj->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,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
if (origpool && !virStoragePoolObjIsActive(origpool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
origvol = virStorageVolDefFindByName(origpool ? origpool : pool, vobj->name);
if (!origvol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- vobj->name);
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ vobj->name);
goto cleanup;
}
goto cleanup;
if (virStorageVolDefFindByName(pool, newvol->name)) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("storage volume name '%s' already in use."),
- newvol->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("storage volume name '%s' already in use."),
+ newvol->name);
goto cleanup;
}
newvol->allocation = origvol->capacity;
if (!backend->buildVolFrom) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- "%s", _("storage pool does not support volume creation from an existing volume"));
+ 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,
- _("volume '%s' is still being allocated."),
- origvol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ origvol->name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto out;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto out;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (vol == NULL) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ 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,
- _("volume '%s' is still being allocated."),
- vol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
goto out;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto out;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto out;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (vol == NULL) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ 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,
- _("volume '%s' is still being allocated."),
- vol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
goto out;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ _("no storage pool with matching uuid"));
goto out;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("storage pool is not active"));
goto out;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (vol == NULL) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ 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,
- _("volume '%s' is still being allocated."),
- vol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
goto out;
}
}
if (abs_capacity < vol->allocation) {
- virStorageReportError(VIR_ERR_INVALID_ARG,
- _("can't shrink capacity below "
- "existing allocation"));
+ 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,
- _("Not enough space left on storage pool"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("Not enough space left on storage pool"));
goto out;
}
if (!backend->resizeVol) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- _("storage pool does not support changing of "
- "volume capacity"));
+ virReportError(VIR_ERR_NO_SUPPORT,
+ _("storage pool does not support changing of "
+ "volume capacity"));
goto out;
}
alg_char = "random";
break;
default:
- virStorageReportError(VIR_ERR_INVALID_ARG,
- _("unsupported algorithm %d"),
- algorithm);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unsupported algorithm %d"),
+ algorithm);
}
cmd = virCommandNew(SCRUB);
virCommandAddArgList(cmd, "-f", "-p", alg_char,
virCheckFlags(0, -1);
if (algorithm >= VIR_STORAGE_VOL_WIPE_ALG_LAST) {
- virStorageReportError(VIR_ERR_INVALID_ARG,
- _("wiping algorithm %d not supported"),
- algorithm);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("wiping algorithm %d not supported"),
+ algorithm);
return -1;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto out;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto out;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (vol == NULL) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ 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,
- _("volume '%s' is still being allocated."),
- vol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
goto out;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (!vol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ 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,
- _("volume '%s' is still being allocated."),
- vol->name);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
goto cleanup;
}
if (!backend->deleteVol) {
- virStorageReportError(VIR_ERR_NO_SUPPORT,
- "%s", _("storage pool does not support vol deletion"));
+ virReportError(VIR_ERR_NO_SUPPORT,
+ "%s", _("storage pool does not support vol deletion"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (!vol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ obj->name);
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (!vol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ obj->name);
goto cleanup;
}
pool = virStoragePoolObjFindByName(&driver->pools, obj->pool);
storageDriverUnlock(driver);
if (!pool) {
- virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
- "%s", _("no storage pool with matching uuid"));
+ virReportError(VIR_ERR_NO_STORAGE_POOL,
+ "%s", _("no storage pool with matching uuid"));
goto cleanup;
}
if (!virStoragePoolObjIsActive(pool)) {
- virStorageReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("storage pool is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("storage pool is not active"));
goto cleanup;
}
vol = virStorageVolDefFindByName(pool, obj->name);
if (!vol) {
- virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
- _("no storage vol with matching name '%s'"),
- obj->name);
+ virReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ obj->name);
goto cleanup;
}