Am 13.05.2016 um 10:29 hat Sebastian Färber geschrieben: > Add support for reopen() by adding the .bdrv_reopen_prepare() stub > > Signed-off-by: Sebastian Färber <sfaerbe...@gmail.com> > Tested-by: Sebastian Färber <sfaerbe...@gmail.com> > --- > block/rbd.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/block/rbd.c b/block/rbd.c > index 5bc5b32..5f121b5 100644 > --- a/block/rbd.c > +++ b/block/rbd.c > @@ -577,6 +577,14 @@ failed_opts: > return r; > } > > +/* Note that this will not re-establish a connection with the Ceph cluster > + - it is effectively a NOP. */ > +static int qemu_rbd_reopen_prepare(BDRVReopenState *state, > + BlockReopenQueue *queue, Error **errp) > +{ > + return 0; > +}
A correct reopen implementation must consider all options and flags that .bdrv_open() looked at. The options are okay, as both "filename" and "password-secret" aren't things that we want to allow a reopen to change. However, in the flags BDRV_O_NOCACHE makes a difference: if (flags & BDRV_O_NOCACHE) { rados_conf_set(s->cluster, "rbd_cache", "false"); } else { rados_conf_set(s->cluster, "rbd_cache", "true"); } A reopen must either update the setting, or if it can't (e.g. because librbd doesn't support it) any attempt to change the flag must fail. Kevin