[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 11/56] gluster: Return bdrv_has_zero_init = 0
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 11/56] gluster: Return bdrv_has_zero_init = 0 |
Date: |
Tue, 13 Aug 2013 10:10:35 -0500 |
From: Kevin Wolf <address@hidden>
GlusterFS volumes can be backed by block devices, in which case
bdrv_create() doesn't make sure that the image is zeroed out. It is
currently not possibly to detect whether a given image is backed by a
file or a block device, and incorrectly assuming that it is zeroed
corrupts images during qemu-img convert, so let's err on the side of
caution and always return 0.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 8ab6feec2c7500faafd9a4571fb40d03dd360a64)
Signed-off-by: Michael Roth <address@hidden>
---
block/gluster.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/block/gluster.c b/block/gluster.c
index 91acde2..61424bc 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -574,6 +574,12 @@ static void qemu_gluster_close(BlockDriverState *bs)
glfs_fini(s->glfs);
}
+static int qemu_gluster_has_zero_init(BlockDriverState *bs)
+{
+ /* GlusterFS volume could be backed by a block device */
+ return 0;
+}
+
static QEMUOptionParameter qemu_gluster_create_options[] = {
{
.name = BLOCK_OPT_SIZE,
@@ -595,6 +601,7 @@ static BlockDriver bdrv_gluster = {
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
+ .bdrv_has_zero_init = qemu_gluster_has_zero_init,
.create_options = qemu_gluster_create_options,
};
@@ -610,6 +617,7 @@ static BlockDriver bdrv_gluster_tcp = {
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
+ .bdrv_has_zero_init = qemu_gluster_has_zero_init,
.create_options = qemu_gluster_create_options,
};
@@ -625,6 +633,7 @@ static BlockDriver bdrv_gluster_unix = {
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
+ .bdrv_has_zero_init = qemu_gluster_has_zero_init,
.create_options = qemu_gluster_create_options,
};
@@ -640,6 +649,7 @@ static BlockDriver bdrv_gluster_rdma = {
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
+ .bdrv_has_zero_init = qemu_gluster_has_zero_init,
.create_options = qemu_gluster_create_options,
};
--
1.7.9.5
- [Qemu-stable] [PATCH 02/56] arm/boot: Free dtb blob memory after use, (continued)
- [Qemu-stable] [PATCH 02/56] arm/boot: Free dtb blob memory after use, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 03/56] ppc: do not register IABR SPR twice for 603e, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 04/56] qxl: Fix QXLRam initialisation., Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 05/56] virtio-scsi: forward scsibus for virtio-scsi-pci., Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 01/56] s390/virtio-ccw: Fix virtio reset, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 06/56] acl: acl_add can't insert before last list element, fix, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 07/56] usb-host-libusb: set USB_DEV_FLAG_IS_HOST, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 08/56] s390/ipl: Fix boot order, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 09/56] Fix iSCSI crash on SG_IO with an iovector, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 10/56] block/ssh: Set bdrv_has_zero_init according to the file type., Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 11/56] gluster: Return bdrv_has_zero_init = 0,
Michael Roth <=
- [Qemu-stable] [PATCH 13/56] Revert "migration: do not sent zero pages in bulk stage", Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 12/56] vmdk: remove wrong calculation of relative path, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 14/56] migration: do not overwrite zero pages, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 15/56] raw-posix: Fix /dev/cdrom magic on OS X, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 16/56] kvmclock: clock should count only if vm is running, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 17/56] qemu-char: Fix ID reuse after chardev-remove for qapi-based init, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 19/56] target-lm32: gen_intermediate_code_internal() should be inlined, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 20/56] target-microblaze: gen_intermediate_code_internal() should be inlined, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 18/56] target-cris: gen_intermediate_code_internal() should be inlined, Michael Roth, 2013/08/13
- [Qemu-stable] [PATCH 21/56] target-moxie: gen_intermediate_code_internal() should be inlined, Michael Roth, 2013/08/13