Received: from eggs.gnu.org ([208.118.235.92]:48765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPtH2-0007gG-PS for qemu-devel@nongnu.org; Wed, 10 Apr 2013 07:33:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPtH1-0008L1-Jo for qemu-devel@nongnu.org; Wed, 10 Apr 2013 07:33:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPtH1-0008Kg-CB for qemu-devel@nongnu.org; Wed, 10 Apr 2013 07:33:07 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3ABX5cH003123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Apr 2013 07:33:06 -0400 From: Markus Armbruster References: <451dff8502328bfb24afa139cbdfeeebc60d3e67.1364565637.git.phrdina@redhat.com> <87mwt7debf.fsf@blackfin.pond.sub.org> <51653798.9020806@redhat.com> Date: Wed, 10 Apr 2013 13:33:03 +0200 In-Reply-To: <51653798.9020806@redhat.com> (Pavel Hrdina's message of "Wed, 10 Apr 2013 11:57:44 +0200") Message-ID: <87a9p6pqmo.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 02/11] block: add error parameter to del_existing_snapshots() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com Pavel Hrdina writes: > On 9.4.2013 15:27, Markus Armbruster wrote: >> Pavel Hrdina writes: >> >>> Signed-off-by: Pavel Hrdina >>> Reviewed-by: Eric Blake >>> --- >>> savevm.c | 12 +++++++----- >>> 1 file changed, 7 insertions(+), 5 deletions(-) >>> >>> diff --git a/savevm.c b/savevm.c >>> index 77c5291..dc1f4a4 100644 >>> --- a/savevm.c >>> +++ b/savevm.c >>> @@ -2224,7 +2224,7 @@ static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info, >>> /* >>> * Deletes snapshots of a given name in all opened images. >>> */ >>> -static int del_existing_snapshots(Monitor *mon, const char *name) >>> +static int del_existing_snapshots(const char *name, Error **errp) >>> { >>> BlockDriverState *bs; >>> QEMUSnapshotInfo sn1, *snapshot = &sn1; >>> @@ -2237,9 +2237,8 @@ static int del_existing_snapshots(Monitor *mon, const char *name) >>> { >>> ret = bdrv_snapshot_delete(bs, name); >>> if (ret < 0) { >>> - monitor_printf(mon, >>> - "Error while deleting snapshot on '%s'\n", >>> - bdrv_get_device_name(bs)); >>> + error_setg(errp, "error while deleting snapshot on '%s'", >>> + bdrv_get_device_name(bs)); >>> return -1; >>> } >>> } >> >> Any particular reason for de-capitalizing "Error"? > > Yes, Eric told me that we should start the error message with lover > case and also we shouldn't print '.' at the end of the error message. I agree on not ending error messages with a period. Whether to start them with a capital letter or not isn't worth arguing over, given the general state of our error reporting. [...]