@@ -3350,6 +3350,16 @@ int coroutine_fn bdrv_co_zone_append(BlockDriverState *bs, int64_t *offset,
return ret;
}
+ /*
+ * Zone write pointers are kept and reported in units of BDRV_SECTOR_SIZE,
+ * so an append that would leave a write pointer at a finer granularity
+ * cannot be represented. Drivers may impose a coarser granularity of their
+ * own, see BlockLimits.write_granularity.
+ */
+ if (!QEMU_IS_ALIGNED(qiov->size, BDRV_SECTOR_SIZE)) {
+ return -EINVAL;
+ }
+
bdrv_inc_in_flight(bs);
if (!drv || !drv->bdrv_co_zone_append || bs->bl.zoned == BLK_Z_NONE) {
co.ret = -ENOTSUP;