From: Kevin Wolf <kwolf@redhat.com>
To: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Cc: sheepdog@lists.wpkg.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] sheepdog: add data preallocation support
Date: Wed, 06 Jul 2011 09:53:32 +0200 [thread overview]
Message-ID: <4E14147C.4070600@redhat.com> (raw)
In-Reply-To: <87iprgegh1.wl%morita.kazutaka@lab.ntt.co.jp>
Am 05.07.2011 20:21, schrieb MORITA Kazutaka:
>>> +
>>> + max_idx = (vdi_size + SD_DATA_OBJ_SIZE - 1) / SD_DATA_OBJ_SIZE;
>>> +
>>> + for (idx = 0; idx < max_idx; idx++) {
>>> + uint64_t oid;
>>> + oid = vid_to_data_oid(vid, idx);
>>> +
>>> + if (inode->data_vdi_id[idx]) {
>>> + ret = read_object(fd, buf, vid_to_vdi_oid(inode->data_vdi_id[idx]),
>>> + 1, SD_DATA_OBJ_SIZE, 0);
>>> + if (ret)
>>> + goto out;
>>
>> Missing braces.
>>
>> Also, what is this if branch doing? Is it to ensure that we don't
>> overwrite existing data? But then, isn't an image always empty when we
>> preallocate it?
>
> This branch is for handling a cloned image, which is created with -b
> option. This branch reads data from the backing file (read_object
> returns zero when it succeeds) instead of filling buffer with zero.
Oh, I see. You support preallocation even with backing files. And
suddenly it makes perfect sense. :-)
(Although after completing preallocation, you won't need the backing
file any more as all of it has been copied into the image. Maybe we
should drop the reference then?)
>> In my RFC for qcow2, I called this preallocation mode "full" instead of
>> "data". I don't mind much which we pick, but we should keep it
>> consistent. Any preferences?
>
> I don't mind too. I'll use "full" in the v2 patch.
Great, thanks.
Kevin
next prev parent reply other threads:[~2011-07-06 7:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-21 12:35 [Qemu-devel] [PATCH] sheepdog: add data preallocation support MORITA Kazutaka
2011-05-23 9:19 ` Stefan Hajnoczi
2011-05-23 11:13 ` MORITA Kazutaka
2011-05-23 13:23 ` Stefan Hajnoczi
2011-07-01 8:29 ` Kevin Wolf
2011-07-05 18:21 ` MORITA Kazutaka
2011-07-06 7:53 ` Kevin Wolf [this message]
2011-07-08 11:06 ` [Qemu-devel] [Sheepdog] " MORITA Kazutaka
2011-07-05 18:38 ` [Qemu-devel] [PATCH v2] sheepdog: add full " MORITA Kazutaka
2011-07-06 11:18 ` Kevin Wolf
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=4E14147C.4070600@redhat.com \
--to=kwolf@redhat.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).