From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c
Date: Mon, 21 Nov 2011 11:44:08 +0100 [thread overview]
Message-ID: <4ECA2B78.7040400@redhat.com> (raw)
In-Reply-To: <CAJSP0QUghLT5-bRFtwL2Yj0VwRp0PG3rV0hmhUB5D7jHn+3HWQ@mail.gmail.com>
Am 18.11.2011 15:34, schrieb Stefan Hajnoczi:
> On Fri, Nov 18, 2011 at 11:10 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> 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.
>
> I thought the same thing then remember sometimes people want to use
> image formats on block devices. I think at least making image
> creation not depend on has_zero_init is a good idea.
qcow1 doesn't work on block devices anyway.
Kevin
next prev parent reply other threads:[~2011-11-21 10:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 9:12 [Qemu-devel] [PATCH] block: Use bdrv functions to replace file operation in qcow.c Li Zhi Hui
2011-11-18 10:59 ` Stefan Hajnoczi
2011-11-18 11:10 ` Paolo Bonzini
2011-11-18 14:34 ` Stefan Hajnoczi
2011-11-21 10:44 ` Kevin Wolf [this message]
2011-11-21 10:53 ` Stefan Hajnoczi
2011-11-21 11:08 ` Kevin Wolf
2011-11-21 12:48 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ECA2B78.7040400@redhat.com \
--to=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.