This avoids a 'change' command from the monitor unlink()ing the new file if the bdrv was previously snapshotted.
Signed-off-by: Alyssa Milburn <fuz...@fuzzie.org> --- blockdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blockdev.c b/blockdev.c index be4ca44..d39c2e6 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2514,6 +2514,7 @@ void qmp_blockdev_change_medium(const char *device, const char *filename, } bdrv_flags = blk_get_open_flags_from_root_state(blk); + bdrv_flags &= ~BDRV_O_TEMPORARY; if (!has_read_only) { read_only = BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN; -- 2.1.0