storage: Perform some cleanup of calls

Cleanup calls to virStorageBackendCopyToFD a bit.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2015-10-05 09:53:02 -04:00
parent ef4d14a116
commit 4ee3d4c285

View File

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