* appear as if it were zero-filled.
*/
static int
-virStorageBackendVolZeroSparseFileLocal(virStorageVolDefPtr vol,
+virStorageBackendVolZeroSparseFileLocal(const char *path,
off_t size,
int fd)
{
virReportSystemError(errno,
_("Failed to truncate volume with "
"path '%s' to 0 bytes"),
- vol->target.path);
+ path);
return -1;
}
virReportSystemError(errno,
_("Failed to truncate volume with "
"path '%s' to %ju bytes"),
- vol->target.path, (uintmax_t)size);
+ path, (uintmax_t)size);
return -1;
}
static int
-virStorageBackendWipeLocal(virStorageVolDefPtr vol,
+virStorageBackendWipeLocal(const char *path,
int fd,
unsigned long long wipe_len,
size_t writebuf_length)
virReportSystemError(errno,
_("Failed to seek to the start in volume "
"with path '%s'"),
- vol->target.path);
+ path);
goto cleanup;
}
virReportSystemError(errno,
_("Failed to write %zu bytes to "
"storage volume with path '%s'"),
- write_size, vol->target.path);
+ write_size, path);
goto cleanup;
}
if (fdatasync(fd) < 0) {
virReportSystemError(errno,
_("cannot sync data to volume with path '%s'"),
- vol->target.path);
+ path);
goto cleanup;
}
- VIR_DEBUG("Wrote %llu bytes to volume with path '%s'",
- wipe_len, vol->target.path);
+ VIR_DEBUG("Wrote %llu bytes to volume with path '%s'", wipe_len, path);
ret = 0;
ret = 0;
} else {
if (S_ISREG(st.st_mode) && st.st_blocks < (st.st_size / DEV_BSIZE)) {
- ret = virStorageBackendVolZeroSparseFileLocal(vol, st.st_size, fd);
+ ret = virStorageBackendVolZeroSparseFileLocal(path, st.st_size, fd);
} else {
- ret = virStorageBackendWipeLocal(vol,
+ ret = virStorageBackendWipeLocal(path,
fd,
vol->target.allocation,
st.st_blksize);