OSDN Git Service

block: Allow changing bs->file on reopen
authorAlberto Garcia <berto@igalia.com>
Thu, 10 Jun 2021 12:05:36 +0000 (15:05 +0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 29 Jun 2021 14:51:00 +0000 (16:51 +0200)
commitecd30d2d978493f2280798f4c48f674d6290efa4
tree9e2475195a43d4b017c466d605e87b8d652b1ce3
parent3d0e8743f0fca85e2d9b98924dcedaa5ab79db4d
block: Allow changing bs->file on reopen

When the x-blockdev-reopen was added it allowed reconfiguring the
graph by replacing backing files, but changing the 'file' option was
forbidden. Because of this restriction some operations are not
possible, notably inserting and removing block filters.

This patch adds support for replacing the 'file' option. This is
similar to replacing the backing file and the user is likewise
responsible for the correctness of the resulting graph, otherwise this
can lead to data corruption.

Signed-off-by: Alberto Garcia <berto@igalia.com>
 [vsementsov: bdrv_reopen_parse_file_or_backing() is modified a lot]
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210610120537.196183-9-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block.h
tests/qemu-iotests/245