From: MORITA Kazutaka <morita.kazutaka@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: josh.durgin@dreamhost.com,
MORITA Kazutaka <morita.kazutaka@gmail.com>,
tailai.ly@taobao.com, Peter Lieven <pl@kamp.de>,
qemu-devel@nongnu.org, rjones@redhat.com, stefanha@redhat.com,
bharata@linux.vnet.ibm.com, morita.kazutaka@lab.ntt.co.jp
Subject: Re: [Qemu-devel] block: Review of .has_zero_init use
Date: Tue, 25 Jun 2013 22:42:44 +0900 [thread overview]
Message-ID: <m2bo6unw6j.wl%morita.kazutaka@gmail.com> (raw)
In-Reply-To: <20130625132018.GK3539@dhcp-200-207.str.redhat.com>
At Tue, 25 Jun 2013 15:20:18 +0200,
Kevin Wolf wrote:
>
> Am 25.06.2013 um 15:11 hat MORITA Kazutaka geschrieben:
> > At Tue, 25 Jun 2013 13:39:11 +0200,
> > Kevin Wolf wrote:
> > >
> > > Hi all,
> > >
> > > while discussing some iscsi patches with Peter, we came to have a look
> > > at which block drivers implement has_zero_init() to return 0, and which
> > > don't (returning 1 is the default).
> > >
> > > The meaning of this value is that if has_zero_init != 0, after
> > > bdrv_create() one can assume that the whole image would read back as all
> > > zero. For example, this is true for the traditional image files, but not
> > > for host_device, where the block device isn't really created during
> > > bdrv_create() but only checked for size.
> > >
> > > The full list of protocol level block drivers is:
> > >
> > > * blkdebug - doesn't have bdrv_create
> > > * blkverify - doesn't have bdrv_create
> > > * curl - doesn't have bdrv_create
> > > * gluster - currently has_zero_init = 1 (is this correct?)
> > > * iscsi - has_zero_init = 0
> > > * nbd - doesn't have bdrv_create
> > > * file - has_zero_init = 1
> > > * host_* - has_zero_init = 0
> > > * rbd - currently has_zero_init = 1 (is this correct?)
> > > * sheepdog - currently has_zero_init = 1 (is this correct?)
> > > * ssh - currently has_zero_init = 1 (is this correct?)
> > > * vvfat - doesn't have bdrv_create
> > >
> > > Can you please review for the gluster, rbd, sheepdog and ssh driver
> > > whether it's safe to assume that the image reads back as zeros after
> > > bdrv_create?
> >
> > It's safe for Sheepdog. Sheepdog uses ftruncate or fallocate to
> > create data blocks and it is guaranteed that the space will be
> > initialized to zero.
>
> Note that ftruncate/fallocate don't zero-initialise block devices, only
> regular files. Not sure if you can use block devices to back Sheepdog
> images?
We cannot do that. Sheepdog heavily relies on filesystem features and
we will not support block devices for the backend of Sheepdog.
Thanks,
Kazutaka
next prev parent reply other threads:[~2013-06-25 13:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 11:39 [Qemu-devel] block: Review of .has_zero_init use Kevin Wolf
2013-06-25 12:05 ` Richard W.M. Jones
2013-06-25 12:27 ` Kevin Wolf
2013-06-25 13:11 ` MORITA Kazutaka
2013-06-25 13:20 ` Kevin Wolf
2013-06-25 13:42 ` MORITA Kazutaka [this message]
2013-06-25 13:45 ` Kevin Wolf
2013-06-25 15:06 ` Josh Durgin
2013-06-26 3:14 ` Bharata B Rao
2013-06-26 5:59 ` Peter Lieven
2013-06-26 6:46 ` Bharata B Rao
2013-06-26 7:36 ` 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=m2bo6unw6j.wl%morita.kazutaka@gmail.com \
--to=morita.kazutaka@gmail.com \
--cc=bharata@linux.vnet.ibm.com \
--cc=josh.durgin@dreamhost.com \
--cc=kwolf@redhat.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=stefanha@redhat.com \
--cc=tailai.ly@taobao.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 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).