提交 618b5522 编写于 作者: D Dave Allan 提交者: Eric Blake

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.
上级 3807d552
...@@ -1486,7 +1486,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj, ...@@ -1486,7 +1486,7 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
} }
if (origvol->building) { if (origvol->building) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR, virStorageReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%s' is still being allocated."),
origvol->name); origvol->name);
goto cleanup; goto cleanup;
...@@ -1667,7 +1667,7 @@ storageVolumeUpload(virStorageVolPtr obj, ...@@ -1667,7 +1667,7 @@ storageVolumeUpload(virStorageVolPtr obj,
} }
if (vol->building) { if (vol->building) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR, virStorageReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%s' is still being allocated."),
vol->name); vol->name);
goto out; goto out;
...@@ -1876,7 +1876,7 @@ storageVolumeWipe(virStorageVolPtr obj, ...@@ -1876,7 +1876,7 @@ storageVolumeWipe(virStorageVolPtr obj,
} }
if (vol->building) { if (vol->building) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR, virStorageReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%s' is still being allocated."),
vol->name); vol->name);
goto out; goto out;
...@@ -1936,7 +1936,7 @@ storageVolumeDelete(virStorageVolPtr obj, ...@@ -1936,7 +1936,7 @@ storageVolumeDelete(virStorageVolPtr obj,
} }
if (vol->building) { if (vol->building) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR, virStorageReportError(VIR_ERR_OPERATION_INVALID,
_("volume '%s' is still being allocated."), _("volume '%s' is still being allocated."),
vol->name); vol->name);
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册