gluster: Add support for creating zero-filled image
commitcf7f616b9d846b1cc21c7b692b5c9ff6f757a5e7
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Sat, 21 Dec 2013 09:21:26 +0000 (21 14:51 +0530)
committerKevin Wolf <kwolf@redhat.com>
Wed, 22 Jan 2014 11:07:16 +0000 (22 12:07 +0100)
treef8dd0c43828b4f332b3605c91e2555e5c3b6f161
parent7c815372f3b37754b2a568e82f0521c7f77a6f66
gluster: Add support for creating zero-filled image

GlusterFS supports creation of zero-filled file on GlusterFS volume
by means of an API called glfs_zerofill(). Use this API from QEMU to
create an image that is filled with zeroes by using the preallocation
option of qemu-img.

qemu-img create gluster://server/volume/image -o preallocation=full 10G

The allowed values for preallocation are 'full' and 'off'. By default
preallocation is off and image is not zero-filled.

glfs_zerofill() offloads the writing of zeroes to the server and if
the storage supports SCSI WRITESAME, GlusterFS server can issue
BLKZEROOUT ioctl to achieve the zeroing.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/gluster.c