diff options
author | Daniel P. Berrangé | 2021-02-04 13:48:28 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert | 2021-02-08 12:19:51 +0100 |
commit | 3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef (patch) | |
tree | 0c55e6564c1cea3901e2af1fd86eb9d7582b6182 /replay | |
parent | block: allow specifying name of block device for vmstate storage (diff) | |
download | qemu-3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef.tar.gz qemu-3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef.tar.xz qemu-3d3e9b1f669b60d9d3cb857edbfc3d54cbb9c0ef.zip |
block: rename and alter bdrv_all_find_snapshot semantics
Currently bdrv_all_find_snapshot() will return 0 if it finds
a snapshot, -1 if an error occurs, or if it fails to find a
snapshot. New callers to be added want to distinguish between
the error scenario and failing to find a snapshot.
Rename it to bdrv_all_has_snapshot and make it return -1 on
error, 0 if no snapshot is found and 1 if snapshot is found.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210204124834.774401-7-berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'replay')
-rw-r--r-- | replay/replay-debugging.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/replay/replay-debugging.c b/replay/replay-debugging.c index ca37cf4025..098ef8e0f5 100644 --- a/replay/replay-debugging.c +++ b/replay/replay-debugging.c @@ -143,6 +143,7 @@ static char *replay_find_nearest_snapshot(int64_t icount, QEMUSnapshotInfo *sn_tab; QEMUSnapshotInfo *nearest = NULL; char *ret = NULL; + int rv; int nb_sns, i; AioContext *aio_context; @@ -159,7 +160,10 @@ static char *replay_find_nearest_snapshot(int64_t icount, aio_context_release(aio_context); for (i = 0; i < nb_sns; i++) { - if (bdrv_all_find_snapshot(sn_tab[i].name, false, NULL, NULL) == 0) { + rv = bdrv_all_has_snapshot(sn_tab[i].name, false, NULL, NULL); + if (rv < 0) + goto fail; + if (rv == 1) { if (sn_tab[i].icount != -1ULL && sn_tab[i].icount <= icount && (!nearest || nearest->icount < sn_tab[i].icount)) { |