aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/io.c b/block/io.c
index 8b6dace056..f0b86c1d19 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2090,6 +2090,13 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
return ret;
}
+ /* If the request is misaligned then we can't make it efficient */
+ if ((flags & BDRV_REQ_NO_FALLBACK) &&
+ !QEMU_IS_ALIGNED(offset | bytes, align))
+ {
+ return -ENOTSUP;
+ }
+
bdrv_inc_in_flight(bs);
/*
* Align write if necessary by performing a read-modify-write cycle.