mirror of
https://github.com/xemu-project/xemu.git
synced 2026-07-11 01:24:41 +02:00
block: Improve error message when external snapshot can't flush
external_snapshot_action() reports bdrv_flush() failure to its caller
as
An IO error has occurred
The errno code returned by bdrv_flush() is lost.
Improve this to
Write to node '<device or node name>' failed: <description of errno>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240513141703.549874-2-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
+4
-2
@@ -1406,8 +1406,10 @@ static void external_snapshot_action(TransactionAction *action,
|
||||
}
|
||||
|
||||
if (!bdrv_is_read_only(state->old_bs)) {
|
||||
if (bdrv_flush(state->old_bs)) {
|
||||
error_setg(errp, QERR_IO_ERROR);
|
||||
ret = bdrv_flush(state->old_bs);
|
||||
if (ret < 0) {
|
||||
error_setg_errno(errp, -ret, "Write to node '%s' failed",
|
||||
bdrv_get_device_or_node_name(state->old_bs));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user