[PATCH 1/1] Fix error code for storage operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 src/storage/storage_driver.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 4f35be0..997b876 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -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;
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]