From 8341f00dc207b80a1b2e7c7784890c9b0446d062 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 6 May 2016 10:26:27 -0600 Subject: block: Allow BDRV_REQ_FUA through blk_pwrite() We have several block drivers that understand BDRV_REQ_FUA, and emulate it in the block layer for the rest by a full flush. But without a way to actually request BDRV_REQ_FUA during a pass-through blk_pwrite(), FUA-aware block drivers like NBD are forced to repeat the emulation logic of a full flush regardless of whether the backend they are writing to could do it more efficiently. This patch just wires up a flags argument; followup patches will actually make use of it in the NBD driver and in qemu-io. Signed-off-by: Eric Blake Acked-by: Denis V. Lunev Signed-off-by: Kevin Wolf --- block/vhdx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'block/vhdx.c') diff --git a/block/vhdx.c b/block/vhdx.c index 2b7b332404..ec778fe2a7 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1856,13 +1856,14 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) creator = g_utf8_to_utf16("QEMU v" QEMU_VERSION, -1, NULL, &creator_items, NULL); signature = cpu_to_le64(VHDX_FILE_SIGNATURE); - ret = blk_pwrite(blk, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature)); + ret = blk_pwrite(blk, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature), + 0); if (ret < 0) { goto delete_and_exit; } if (creator) { ret = blk_pwrite(blk, VHDX_FILE_ID_OFFSET + sizeof(signature), - creator, creator_items * sizeof(gunichar2)); + creator, creator_items * sizeof(gunichar2), 0); if (ret < 0) { goto delete_and_exit; } -- cgit v1.2.1