blockdev: document discard suboption for -drive and qemu-nbd

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qcow2: discard freed clusters

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: introduce anchor operation

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: add anchor mode for discard

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: change default to discard=anchor

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qcow2: implement anchor

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: pass around qiov for write_zeroes operation

Avoid allocating an extra, useless bounce buffer if possible.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qed: make write-zeroes bounce buffer smaller than a single cluster

Currently, a write-zeroes operation could allocates memory for the
whole I/O operation if it is not aligned.  This is not necessary,
because only two unaligned clusters could be written.

This makes the write-zeroes operation slower because it proceeds
one cluster at a time, even if all clusters are currently available
and zero.  However, write-zeroes (and discard) are not fast paths.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>