]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Always enable discard on the protocol level
authorKevin Wolf <kwolf@redhat.com>
Wed, 19 Jun 2013 11:44:21 +0000 (13:44 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 24 Jun 2013 08:25:17 +0000 (10:25 +0200)
commit50b05b6f2e24296b4d739a638e1e7427767ed7cd
tree1e5e0ad62a471991aad9ac38630aa7a88ca62dff
parent0b919fae31f4f80f78ebeab8388dc3a03cc5e4ed
block: Always enable discard on the protocol level

Turning on discard options in qcow2 doesn't help a lot when the discard
requests that it issues are thrown away by the raw-posix layer. This
patch always enables discard functionality on the protocol level so that
it's the image format's responsibility to send (or not) discard
requests. Requests sent by the guest will be allowed or ignored by the
top level BlockDriverState, which depends on the discard=... option like
before.

In particular, this means that even without specifying options, the
qcow2 default of discarding deleted snapshots actually takes effect now,
both for qemu and qemu-img.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c