On 04.02.2016 18:36, Alyssa Milburn wrote: > This avoids a 'change' command from the monitor unlink()ing the new > file if the bdrv was previously snapshotted. > > Signed-off-by: Alyssa Milburn <[email protected]> > --- > 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; >
This patch is correct (thanks!), but I think we want to unset even more flags, namely BDRV_O_SNAPSHOT, BDRV_O_NO_BACKING, and BDRV_O_PROTOCOL. Max
signature.asc
Description: OpenPGP digital signature
