qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file opera


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c
Date: Fri, 18 Nov 2011 12:10:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 11/18/2011 11:59 AM, Stefan Hajnoczi wrote:
+    tmp = g_malloc0(sizeof(uint64_t)*l1_size);
>  +    ret = bdrv_pwrite(qcow_bs, header_size, tmp, sizeof(uint64_t)*l1_size);
>  +    g_free(tmp);
>  +    if (ret != sizeof(uint64_t)*l1_size) {
>  +        goto exit;
>       }

That means 400 MB of RAM for the zero L1 table for a 100 TB image.
Since qcow is a legacy format this probably doesn't matter in practice
but in theory this approach can require a noticable amount of RAM.

4 MB / TB is not a big deal (you probably would like the L1 table to be in memory all the time), but why write the L1 table at all? Since the file was CREATed, it is already zero and you can just leave a hole in the file.

Paolo




reply via email to

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