bdrv_save_vmstate() returns either error with negative return value or size. Thus this check is useless.
Signed-off-by: Denis V. Lunev <[email protected]> Suggested-by: Eric Blake <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> CC: Kevin Wolf <[email protected]> CC: Max Reitz <[email protected]> CC: Stefan Hajnoczi <[email protected]> CC: Fam Zheng <[email protected]> CC: Juan Quintela <[email protected]> CC: "Dr. David Alan Gilbert" <[email protected]> CC: Denis Plotnikov <[email protected]> --- block/block-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index 6936b25c83..1c6e53bbde 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -2188,7 +2188,7 @@ int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, return ret; } - if (ret == size && !blk->enable_write_cache) { + if (!blk->enable_write_cache) { ret = bdrv_flush(blk_bs(blk)); } -- 2.17.1
