mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Fix error code for storage operations
Many volume operations will fail if the volume in question is being allocated. These operations were returning VIR_ERR_INTERNAL_ERROR when they should be returning VIR_ERR_OPERATION_INVALID.
This commit is contained in:
parent
3807d552c7
commit
618b55220a
@ -1486,7 +1486,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
|
||||
}
|
||||
|
||||
if (origvol->building) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
origvol->name);
|
||||
goto cleanup;
|
||||
@ -1667,7 +1667,7 @@ storageVolumeUpload(virStorageVolPtr obj,
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
@ -1876,7 +1876,7 @@ storageVolumeWipe(virStorageVolPtr obj,
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto out;
|
||||
@ -1936,7 +1936,7 @@ storageVolumeDelete(virStorageVolPtr obj,
|
||||
}
|
||||
|
||||
if (vol->building) {
|
||||
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
virStorageReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume '%s' is still being allocated."),
|
||||
vol->name);
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user