Message ID | 20161107050859.31058-2-haozhong.zhang@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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) {
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 <haozhong.zhang@intel.com> --- exec.c | 3 +++ 1 file changed, 3 insertions(+)