block: Use 'detect-zeroes' option for 'blockdev-change-medium'
commitb85114f8cfbede8b153db68875973ef0790bf296
authorKevin Wolf <kwolf@redhat.com>
Mon, 12 Sep 2016 17:08:31 +0000 (12 19:08 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 29 Sep 2016 12:13:39 +0000 (29 14:13 +0200)
treef145eb5c7d45e3e2ad8eefb5c06ac5bf72d20883
parent692e01a27ccde4120f1371227d4011f668d67a76
block: Use 'detect-zeroes' option for 'blockdev-change-medium'

Instead of modifying the new BDS after it has been opened, use the newly
supported 'detect-zeroes' option in bdrv_open_common() so that all
requirements are checked (detect-zeroes=unmap requires discard=unmap).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block/block-backend.c
blockdev.c
include/sysemu/block-backend.h