From patchwork Tue Aug 26 18:17:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 383180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DFD081400E0 for ; Wed, 27 Aug 2014 04:18:50 +1000 (EST) Received: from localhost ([::1]:54947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLKS-0003mH-Ud for incoming@patchwork.ozlabs.org; Tue, 26 Aug 2014 14:18:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLJq-0002pD-2U for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMLJj-0000He-Kz for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMLJj-0000HY-D9 for qemu-devel@nongnu.org; Tue, 26 Aug 2014 14:18:03 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7QII2mf032170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Aug 2014 14:18:02 -0400 Received: from localhost (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7QII1Rs025827; Tue, 26 Aug 2014 14:18:02 -0400 From: Stefan Hajnoczi To: Date: Tue, 26 Aug 2014 19:17:54 +0100 Message-Id: <1409077076-29855-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1409077076-29855-1-git-send-email-stefanha@redhat.com> References: <1409077076-29855-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Jeff Cody , jsnow@redhat.com, Markus Armbruster , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 1/3] qemu-img: fix img_commit() error return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The img_commit() return value is a process exit code. Use 1 for failure instead of -1. The other failure paths in this function already use 1. Signed-off-by: Stefan Hajnoczi Reviewed-by: Max Reitz --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index c843420..dc3adb5 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -771,7 +771,7 @@ static int img_commit(int argc, char **argv) ret = bdrv_parse_cache_flags(cache, &flags); if (ret < 0) { error_report("Invalid cache option: %s", cache); - return -1; + return 1; } bs = bdrv_new_open("image", filename, fmt, flags, true, quiet);