]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage: Perform some cleanup of calls
authorJohn Ferlan <jferlan@redhat.com>
Mon, 5 Oct 2015 13:53:02 +0000 (09:53 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 8 Oct 2015 11:06:51 +0000 (07:06 -0400)
Cleanup calls to virStorageBackendCopyToFD a bit.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/storage/storage_backend.c

index 6a3146ccfc4e312fa91940234be16a0c49805779..ad7a576fb78e3265f8a4723e5c45a54ac870cae2 100644 (file)
@@ -345,9 +345,8 @@ virStorageBackendCreateBlockFrom(virConnectPtr conn ATTRIBUTE_UNUSED,
     remain = vol->target.capacity;
 
     if (inputvol) {
-        int res = virStorageBackendCopyToFD(vol, inputvol,
-                                            fd, &remain, false, reflink_copy);
-        if (res < 0)
+        if (virStorageBackendCopyToFD(vol, inputvol, fd, &remain,
+                                      false, reflink_copy) < 0)
             goto cleanup;
     }
 
@@ -444,9 +443,8 @@ createRawFile(int fd, virStorageVolDefPtr vol,
         /* allow zero blocks to be skipped if we've requested sparse
          * allocation (allocation < capacity) or we have already
          * been able to allocate the required space. */
-        ret = virStorageBackendCopyToFD(vol, inputvol, fd, &remain,
-                                        !need_alloc, reflink_copy);
-        if (ret < 0)
+        if ((ret = virStorageBackendCopyToFD(vol, inputvol, fd, &remain,
+                                             !need_alloc, reflink_copy)) < 0)
             goto cleanup;
 
         /* If the new allocation is greater than the original capacity,