block: push error reporting into bdrv_all_*_snapshot functions
commite26f98e2097cf17db04462e9aa2e423b93e7455c
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 4 Feb 2021 12:48:23 +0000 (4 12:48 +0000)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 8 Feb 2021 11:19:51 +0000 (8 11:19 +0000)
treec2483a9aa4721a8073b8e28d2a4b1b3e2b465f50
parenta64aec725ea0b26fa4e44f8b8b8c72be9aaa4230
block: push error reporting into bdrv_all_*_snapshot functions

The bdrv_all_*_snapshot functions return a BlockDriverState pointer
for the invalid backend, which the callers then use to report an
error message. In some cases multiple callers are reporting the
same error message, but with slightly different text. In the future
there will be more error scenarios for some of these methods, which
will benefit from fine grained error message reporting. So it is
helpful to push error reporting down a level.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
[PMD: Initialize variables]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210204124834.774401-2-berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
block/monitor/block-hmp-cmds.c
block/snapshot.c
include/block/snapshot.h
migration/savevm.c
monitor/hmp-cmds.c
replay/replay-debugging.c
tests/qemu-iotests/267.out