From 84d18f065fb041a1c0d78d20320d740ae0673c8a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 30 Jan 2014 15:07:28 +0100 Subject: Use error_is_set() only when necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error_is_set(&var) is the same as var != NULL, but it takes whole-program analysis to figure that out. Unnecessarily hard for optimizers, static checkers, and human readers. Dumb it down to obvious. Gets rid of several dozen Coverity false positives. Note that the obvious form is already used in many places. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Andreas Färber Signed-off-by: Luiz Capitulino --- savevm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'savevm.c') diff --git a/savevm.c b/savevm.c index a7dbe18a67..7329fc58de 100644 --- a/savevm.c +++ b/savevm.c @@ -880,7 +880,7 @@ static int del_existing_snapshots(Monitor *mon, const char *name) if (bdrv_can_snapshot(bs) && bdrv_snapshot_find(bs, snapshot, name) >= 0) { bdrv_snapshot_delete_by_id_or_name(bs, name, &err); - if (error_is_set(&err)) { + if (err) { monitor_printf(mon, "Error while deleting snapshot on device '%s':" " %s\n", @@ -1115,7 +1115,7 @@ void do_delvm(Monitor *mon, const QDict *qdict) while ((bs1 = bdrv_next(bs1))) { if (bdrv_can_snapshot(bs1)) { bdrv_snapshot_delete_by_id_or_name(bs, name, &err); - if (error_is_set(&err)) { + if (err) { monitor_printf(mon, "Error while deleting snapshot on device '%s':" " %s\n", -- cgit v1.2.1