qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v11 5/6] raw-posix: Add falloc and full prea


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH RFC v11 5/6] raw-posix: Add falloc and full preallocation option
Date: Thu, 03 Jul 2014 22:10:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 02.07.2014 10:17, Hu Tao wrote:
This patch adds a new option preallocation for raw format, and implements
falloc and full preallocation.

Signed-off-by: Hu Tao <address@hidden>
---
  block/raw-posix.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-------
  1 file changed, 55 insertions(+), 7 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 58c51d8..5dcd465 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -30,6 +30,7 @@
  #include "block/thread-pool.h"
  #include "qemu/iov.h"
  #include "raw-aio.h"
+#include "qapi/util.h"
#if defined(__APPLE__) && (__MACH__)
  #include <paths.h>
@@ -1278,28 +1279,70 @@ static int raw_create(const char *filename, QemuOpts 
*opts, Error **errp)
      int fd;
      int result = 0;
      int64_t total_size = 0;
+    PreallocMode prealloc = PREALLOC_MODE_OFF;
+    char *buf = NULL;

It's not really necessary to initialize these two here, but it won't hurt either, of course (same thing later with num, which could have even been declared inside of the while loop).

Reviewed-by: Max Reitz <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]