提交 e4f6fb04 编写于 作者: C Cole Robinson

storage_backend: Drop unused code

This has been disabled for years
上级 7793d2a8
...@@ -115,8 +115,6 @@ static virStorageBackendPtr backends[] = { ...@@ -115,8 +115,6 @@ static virStorageBackendPtr backends[] = {
NULL NULL
}; };
static int track_allocation_progress = 0;
enum { enum {
TOOL_QEMU_IMG, TOOL_QEMU_IMG,
TOOL_KVM_IMG, TOOL_KVM_IMG,
...@@ -342,25 +340,6 @@ createRawFile(int fd, virStorageVolDefPtr vol, ...@@ -342,25 +340,6 @@ createRawFile(int fd, virStorageVolDefPtr vol,
} }
if (remain) { if (remain) {
if (track_allocation_progress) {
while (remain) {
/* Allocate in chunks of 512MiB: big-enough chunk
* size and takes approx. 9s on ext3. A progress
* update every 9s is a fair-enough trade-off
*/
unsigned long long bytes = 512 * 1024 * 1024;
if (bytes > remain)
bytes = remain;
if (safezero(fd, vol->allocation - remain, bytes) < 0) {
ret = -errno;
virReportSystemError(errno, _("cannot fill file '%s'"),
vol->target.path);
goto cleanup;
}
remain -= bytes;
}
} else { /* No progress bars to be shown */
if (safezero(fd, 0, remain) < 0) { if (safezero(fd, 0, remain) < 0) {
ret = -errno; ret = -errno;
virReportSystemError(errno, _("cannot fill file '%s'"), virReportSystemError(errno, _("cannot fill file '%s'"),
...@@ -368,7 +347,6 @@ createRawFile(int fd, virStorageVolDefPtr vol, ...@@ -368,7 +347,6 @@ createRawFile(int fd, virStorageVolDefPtr vol,
goto cleanup; goto cleanup;
} }
} }
}
if (fsync(fd) < 0) { if (fsync(fd) < 0) {
ret = -errno; ret = -errno;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册