[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] exec.c: add comment for errors of get_file_size
From: |
Haozhong Zhang |
Subject: |
[Qemu-devel] [PATCH 1/3] exec.c: add comment for errors of get_file_size() |
Date: |
Mon, 7 Nov 2016 13:08:57 +0800 |
Indicate that not stopping on get_file_size() errors in file_ram_alloc()
is on purpose and not a mistake.
Signed-off-by: Haozhong Zhang <address@hidden>
---
exec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/exec.c b/exec.c
index 3d867f1..68b0c92 100644
--- a/exec.c
+++ b/exec.c
@@ -1314,6 +1314,9 @@ static void *file_ram_alloc(RAMBlock *block,
}
#endif
+ /* If QEMU fails to get the backend file size, i.e. file_size < 0,
+ * it will treat the file as non-empty and not truncate it.
+ */
file_size = get_file_size(fd);
if (memory < block->page_size) {
--
2.10.1