[Top][All Lists]
[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c |
Date: |
Fri, 18 Nov 2011 10:59:05 +0000 |
On Fri, Nov 18, 2011 at 9:12 AM, Li Zhi Hui <address@hidden> 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;
> }
qemu-img create -f qcow test.qcow 100T
>>> 100 * 1024 * 1024 * 1024 * 1024 / ((1 << 12) * (1 << 9))
52428800
>>> 52428800 * 8
419430400
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.
Looks okay to me.
Stefan
- [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Li Zhi Hui, 2011/11/18
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Paolo Bonzini, 2011/11/18
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Stefan Hajnoczi, 2011/11/18
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Kevin Wolf, 2011/11/21
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Stefan Hajnoczi, 2011/11/21
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Kevin Wolf, 2011/11/21
- Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c, Paolo Bonzini, 2011/11/21