diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + #include "qemu/osdep.h" #include "block/trace.h" #include "block/block_int.h" @@ -29,15 +30,17 @@ #include "qemu/error-report.h" #include "module_block.h" #include "qemu/module.h" +#include "qapi/error.h" +#include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" -#include "qapi/qmp/qbool.h" #include "qapi/qmp/qjson.h" +#include "qapi/qmp/qstring.h" #include "sysemu/block-backend.h" #include "sysemu/sysemu.h" #include "qemu/notify.h" +#include "qemu/option.h" #include "qemu/coroutine.h" #include "block/qapi.h" -#include "qmp-commands.h" #include "qemu/timer.h" #include "qapi-event.h" #include "qemu/cutils.h" @@ -4007,17 +4010,11 @@ bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs) bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) { - BlockDriverInfo bdi; - if (!(bs->open_flags & BDRV_O_UNMAP)) { return false; } - if (bdrv_get_info(bs, &bdi) == 0) { - return bdi.can_write_zeroes_with_unmap; - } - - return false; + return bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP; } const char *bdrv_get_encrypted_filename(BlockDriverState *bs) |