qemu-e2k/block
Paolo Bonzini 97a2ae3453 raw-posix: add support for write_zeroes on XFS and block devices
The code is similar to the implementation of discard and write_zeroes
with UNMAP.  However, failure must be propagated up to block.c.

The stale page cache problem can be reproduced as follows:

    # modprobe scsi-debug lbpws=1 lbprz=1
    # ./qemu-io /dev/sdXX
    qemu-io> write -P 0xcc 0 2M
    qemu-io> write -z 0 1M
    qemu-io> read -P 0x00 0 512
    Pattern verification failed at offset 0, 512 bytes
    qemu-io> read -v 0 512
    00000000:  cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
    ...

    # ./qemu-io --cache=none /dev/sdXX
    qemu-io> write -P 0xcc 0 2M
    qemu-io> write -z 0 1M
    qemu-io> read -P 0x00 0 512
    qemu-io> read -v 0 512
    00000000:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    ...

And similarly with discard instead of "write -z".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-12-03 15:26:49 +01:00
..
backup.c block: introduce BDRV_REQ_MAY_UNMAP request flag 2013-11-28 10:30:51 +01:00
blkdebug.c blkdebug: add "remove_break" command 2013-11-29 13:40:37 +01:00
blkverify.c
bochs.c
cloop.c
commit.c
cow.c COW: Extend checking allocated bits to beyond one sector 2013-11-29 13:40:36 +01:00
curl.c
dmg.c
gluster.c
iscsi.c block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP 2013-12-03 15:26:49 +01:00
linux-aio.c
Makefile.objs block: vhdx - log parsing, replay, and flush support 2013-11-07 13:58:58 +01:00
mirror.c block: per caller dirty bitmap 2013-11-29 13:40:33 +01:00
nbd.c
parallels.c
qapi.c qapi: Change BlockDirtyInfo to list 2013-11-29 13:40:36 +01:00
qcow2-cache.c
qcow2-cluster.c block: add flags to bdrv_*_write_zeroes 2013-11-28 10:30:51 +01:00
qcow2-refcount.c
qcow2-snapshot.c
qcow2.c block drivers: expose requirement for write same alignment from formats 2013-12-03 15:26:49 +01:00
qcow2.h
qcow.c
qed-check.c
qed-cluster.c
qed-gencb.c
qed-l2-cache.c
qed-table.c
qed.c block drivers: expose requirement for write same alignment from formats 2013-12-03 15:26:49 +01:00
qed.h
raw_bsd.c block/raw: copy BlockLimits on raw_open 2013-11-28 10:30:51 +01:00
raw-aio.h raw-posix: add support for write_zeroes on XFS and block devices 2013-12-03 15:26:49 +01:00
raw-posix.c raw-posix: add support for write_zeroes on XFS and block devices 2013-12-03 15:26:49 +01:00
raw-win32.c block: Print its file name if backing file opening failed 2013-11-14 13:09:06 +01:00
rbd.c
sheepdog.c sheepdog: support user-defined redundancy option 2013-11-29 13:40:37 +01:00
snapshot.c
ssh.c
stream.c block/stream: Don't stream unbacked devices 2013-11-28 11:39:31 +01:00
vdi.c block drivers: add discard/write_zeroes properties to bdrv_get_info implementation 2013-12-03 15:26:49 +01:00
vhdx-endian.c block: vhdx - move more endian translations to vhdx-endian.c 2013-11-07 13:58:59 +01:00
vhdx-log.c block: vhdx - add log write support 2013-11-07 13:58:59 +01:00
vhdx.c block drivers: add discard/write_zeroes properties to bdrv_get_info implementation 2013-12-03 15:26:49 +01:00
vhdx.h block: vhdx - add .bdrv_create() support 2013-11-07 13:58:59 +01:00
vmdk.c block drivers: expose requirement for write same alignment from formats 2013-12-03 15:26:49 +01:00
vpc.c block drivers: add discard/write_zeroes properties to bdrv_get_info implementation 2013-12-03 15:26:49 +01:00
vvfat.c
win32-aio.c