From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:47055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLmxG-0000Vg-In for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLmxC-0002lp-Pj for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLmxC-0002dh-H9 for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DB8F3092675 for ; Wed, 1 May 2019 10:59:08 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" Date: Wed, 1 May 2019 11:59:03 +0100 Message-Id: <20190501105904.29907-2-dgilbert@redhat.com> In-Reply-To: <20190501105904.29907-1-dgilbert@redhat.com> References: <20190501105904.29907-1-dgilbert@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/2] hmp: delvm: use hmp_handle_error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, crobinso@redhat.com From: Cole Robinson This gives us the consistent 'Error:' prefix added in 66363e9a43f, which helps users like libvirt who still need to scrape hmp error messages to detect failure. Reviewed-by: Eric Blake Signed-off-by: Cole Robinson Message-Id: <984634226fa14316641f31f84e7dd0bb770bd94c.1556141033.git.crob= inso@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- hmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 4bb3af748e..56a3ed7375 100644 --- a/hmp.c +++ b/hmp.c @@ -1480,10 +1480,11 @@ void hmp_delvm(Monitor *mon, const QDict *qdict) const char *name =3D qdict_get_str(qdict, "name"); =20 if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) { - error_reportf_err(err, - "Error while deleting snapshot on device '%s':= ", - bdrv_get_device_name(bs)); + error_prepend(&err, + "deleting snapshot on device '%s': ", + bdrv_get_device_name(bs)); } + hmp_handle_error(mon, &err); } =20 void hmp_info_snapshots(Monitor *mon, const QDict *qdict) --=20 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,T_HK_NAME_DR autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A660AC43219 for ; Wed, 1 May 2019 11:00:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76FC121734 for ; Wed, 1 May 2019 11:00:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76FC121734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:54524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLmyt-0001WG-O9 for qemu-devel@archiver.kernel.org; Wed, 01 May 2019 07:00:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLmxG-0000Vg-In for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLmxC-0002lp-Pj for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLmxC-0002dh-H9 for qemu-devel@nongnu.org; Wed, 01 May 2019 06:59:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DB8F3092675 for ; Wed, 1 May 2019 10:59:08 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-116-152.ams2.redhat.com [10.36.116.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE70E7192A; Wed, 1 May 2019 10:59:07 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, crobinso@redhat.com Date: Wed, 1 May 2019 11:59:03 +0100 Message-Id: <20190501105904.29907-2-dgilbert@redhat.com> In-Reply-To: <20190501105904.29907-1-dgilbert@redhat.com> References: <20190501105904.29907-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 01 May 2019 10:59:08 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] hmp: delvm: use hmp_handle_error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190501105903.FWqr4wsMJsQht1UdykdlgtnOQGkFCVppeR0ADn47u-I@z> From: Cole Robinson This gives us the consistent 'Error:' prefix added in 66363e9a43f, which helps users like libvirt who still need to scrape hmp error messages to detect failure. Reviewed-by: Eric Blake Signed-off-by: Cole Robinson Message-Id: <984634226fa14316641f31f84e7dd0bb770bd94c.1556141033.git.crob= inso@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- hmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 4bb3af748e..56a3ed7375 100644 --- a/hmp.c +++ b/hmp.c @@ -1480,10 +1480,11 @@ void hmp_delvm(Monitor *mon, const QDict *qdict) const char *name =3D qdict_get_str(qdict, "name"); =20 if (bdrv_all_delete_snapshot(name, &bs, &err) < 0) { - error_reportf_err(err, - "Error while deleting snapshot on device '%s':= ", - bdrv_get_device_name(bs)); + error_prepend(&err, + "deleting snapshot on device '%s': ", + bdrv_get_device_name(bs)); } + hmp_handle_error(mon, &err); } =20 void hmp_info_snapshots(Monitor *mon, const QDict *qdict) --=20 2.21.0