]> git.proxmox.com Git - qemu.git/commit
block: implement BDRV_O_UNMAP
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Feb 2013 13:06:11 +0000 (14:06 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 Feb 2013 20:29:42 +0000 (21:29 +0100)
commit9e8f1835ea3ab3be83634f34c1bb8b69cd871766
tree079db917d1d60678dd098fdf53d3b549dc82191d
parent9a665b2b8640e464f0a778216fc2dca8d02acf33
block: implement BDRV_O_UNMAP

It is better to present homogeneous hardware independent of the storage
technology that is chosen on the host, hence we make discard a host
parameter; the user can choose whether to pass it down to the image
format and protocol, or to ignore it.

Using DISCARD with filesystems can cause very severe fragmentation, so it
is left default-off for now.  This can change later when we implement the
"anchor" operation for efficient management of preallocated files.

There is still one choice to make: whether DISCARD has an effect on the
dirty bitmap or not.  I chose yes, though there is a disadvantage: if
the guest is buggy and issues discards for data that is in use, there
will be no way to migrate storage for that guest without downgrading
the machine type to an older one.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block.h
qemu-io.c