block/file-win32: add reopen handlers
commitebd979c74e2b8a7275090475df36dde4ab858320
authorViktor Prutyanov <viktor.prutyanov@phystech.edu>
Wed, 25 Aug 2021 17:36:25 +0000 (25 20:36 +0300)
committerHanna Reitz <hreitz@redhat.com>
Wed, 1 Sep 2021 12:38:08 +0000 (1 14:38 +0200)
treef7224c4629c076c17f3b323edf036ddfbcc2e7f9
parent28031d5c7427aec6d6138920b92c59b999a349ed
block/file-win32: add reopen handlers

Make 'qemu-img commit' work on Windows.

Command 'commit' requires reopening backing file in RW mode. So,
add reopen prepare/commit/abort handlers and change dwShareMode
for CreateFile call in order to allow further read/write reopening.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/418

Suggested-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Tested-by: Helge Konetzka <hk@zapateado.de>
Message-Id: <20210825173625.19415-1-viktor.prutyanov@phystech.edu>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block/file-win32.c