The call to drv->bdrv_reopen_prepare() can fail due to reasons other than an open failure. Unfortunately, we can't use errno nor -ret, cause they are not always set.
Stick to a generic error message then. Signed-off-by: Luiz Capitulino <lcapitul...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Acked-by: Kevin Wolf <kw...@redhat.com> --- block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 79ad33d..b88ad2f 100644 --- a/block.c +++ b/block.c @@ -1291,8 +1291,8 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, if (local_err != NULL) { error_propagate(errp, local_err); } else { - error_set(errp, QERR_OPEN_FILE_FAILED, - reopen_state->bs->filename); + error_setg(errp, "failed while preparing to reopen image '%s'", + reopen_state->bs->filename); } goto error; } -- 1.8.1.4