Hi, As version 1, this series adds a fallback path for creating files (on the protocol layer) if the protocol driver does not support file creation, but the file already exists.
Branch: https://github.com/XanClic/qemu.git skip-proto-create-v2 Branch: https://git.xanclic.moe/XanClic/qemu.git skip-proto-create-v2 v2: - Drop blk_truncate_for_formatting(): It doesn’t make sense to introduce this function any more after 26536c7fc25917d1bd13781f81fe3ab039643bff (“block: Do not truncate file node when formatting”), because we’d only use it in bdrv_create_file_fallback(). Thus, it makes more sense to create special helper functions specifically for bdrv_create_file_fallback(). - Thus, dropped patches 2 and 3. - And changed patch 4 to include those helper functions. - Rebased, which was a bit of a pain. git-backport-diff against v1: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/5:[----] [-C] 'block/nbd: Fix hang in .bdrv_close()' 002/5:[0080] [FC] 'block: Generic file creation fallback' 003/5:[----] [--] 'file-posix: Drop hdev_co_create_opts()' 004/5:[----] [--] 'iscsi: Drop iscsi_co_create_opts()' 005/5:[----] [-C] 'iotests: Add test for image creation fallback' Max Reitz (5): block/nbd: Fix hang in .bdrv_close() block: Generic file creation fallback file-posix: Drop hdev_co_create_opts() iscsi: Drop iscsi_co_create_opts() iotests: Add test for image creation fallback block.c | 159 ++++++++++++++++++++++++++++++++++--- block/file-posix.c | 67 ---------------- block/iscsi.c | 56 ------------- block/nbd.c | 14 +++- tests/qemu-iotests/259 | 61 ++++++++++++++ tests/qemu-iotests/259.out | 14 ++++ tests/qemu-iotests/group | 1 + 7 files changed, 236 insertions(+), 136 deletions(-) create mode 100755 tests/qemu-iotests/259 create mode 100644 tests/qemu-iotests/259.out -- 2.24.1