qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] block: Review of .has_zero_init use
@ 2013-06-25 11:39 Kevin Wolf
  2013-06-25 12:05 ` Richard W.M. Jones
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Kevin Wolf @ 2013-06-25 11:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, josh.durgin, tailai.ly, Peter Lieven, rjones,
	stefanha, bharata, morita.kazutaka

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 might be possible that the correct value depends on the backend on
the server side for some protocols - for example, I think for SSH it
depends on whether you access a regular file or a block device on the
other host (if accessing a block device is even possible). In such
cases, has_zero_init = 0 is the safe default.

We're probably going to change the meaning of unimplemented
has_zero_init to return 0, but it would be good to check if the current
code was actually meant to do what it does today.

Kevin

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-26  7:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).