]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Do not override the exact error of createRawFile
authorOsier Yang <jyang@redhat.com>
Mon, 4 Jul 2011 08:13:23 +0000 (16:13 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 4 Jul 2011 08:13:23 +0000 (16:13 +0800)
virStorageBackendCreateRaw: createRawFile already reported the
exact error.

Before the fix:

error: Failed to create vol vol-create.img
error: cannot create path '/var/lib/libvirt/images/vol-create.img': Unknown error 18446744073709551597

After the fix:

error: Failed to create vol vol-create.img
error: cannot fill file '/var/lib/libvirt/images/vol-create.img': No space left on device

src/storage/storage_backend.c

index a6e66e1c1e81133d7fb9c9e645eed25c439fc4ee..708d7b28ca247a34d5cb6f1b35915eadbc7c4a7d 100644 (file)
@@ -399,12 +399,9 @@ virStorageBackendCreateRaw(virConnectPtr conn ATTRIBUTE_UNUSED,
         goto cleanup;
     }
 
-    if ((ret = createRawFile(fd, vol, inputvol)) < 0) {
-        virReportSystemError(-fd,
-                             _("cannot create path '%s'"),
-                             vol->target.path);
+    if ((ret = createRawFile(fd, vol, inputvol)) < 0)
+        /* createRawFile already reported the exact error. */
         ret = -1;
-    }
 
 cleanup:
     VIR_FORCE_CLOSE(fd);