]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: fix volDelete return when volume still being allocated
authorMatthew Booth <mbooth@redhat.com>
Thu, 23 Jun 2011 03:28:29 +0000 (11:28 +0800)
committerDaniel Veillard <veillard@redhat.com>
Thu, 23 Jun 2011 03:28:29 +0000 (11:28 +0800)
volDelete used to return VIR_ERR_INTERNAL_ERROR when attempting to
delete a volume which was still being allocated. It should return
VIR_ERR_OPERATION_INVALID.

* src/storage/storage_driver.c: Fix return of volDelete.

src/storage/storage_driver.c

index 2da2feb6f8e84d0cd665bf89f3f32366212ebf48..f9652f858f38bb4f546bcb7a80c95c92c095a4a7 100644 (file)
@@ -1583,7 +1583,7 @@ storageVolumeDownload(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;