This series of patches is aimed to prevent usage of image file by different qemu instances. In case we are the first instance, and option lock is lockfile, - we lock the image file, and if check option is on, we check the file and fix it if nessecary. If one of this two ops fails - the image is closed with the error.
Patchset is not polished at all! Sent for a discussion as an alternative approach. Signed-off-by: Olga Krishtal <okrish...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Kevin Wolf <kw...@redhat.com> CC: Max Reitz <mre...@redhat.com> CC: Eric Blake <ebl...@redhat.com> CC: Fam Zheng <f...@redhat.com> Olga Krishtal (5): block: added lock image option and callback block: implemented bdrv_lock_image for raw file block: added check image option and callback bdrv_is_opened_unclean qcow2: implemented bdrv_is_opened_unclean block/paralels: added paralles implementation for bdrv_is_opened_unclean block.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ block/parallels.c | 7 ++++- block/qcow2.c | 11 ++++++- block/qcow2.h | 1 + block/raw-posix.c | 15 ++++++++++ block/raw-win32.c | 19 ++++++++++++ include/block/block.h | 2 ++ include/block/block_int.h | 2 ++ qapi/block-core.json | 9 ++++++ 9 files changed, 137 insertions(+), 2 deletions(-) -- 2.1.4