From patchwork Wed Apr 10 18:03:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162033 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6499990jan; Wed, 10 Apr 2019 11:03:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbCrRE4SPvGV9vuHolhRZmwAkRlqOFy1Egk95xE7eFCFQuya0k3rhiGnzN/2H8/Sjr7mEE X-Received: by 2002:adf:dd8c:: with SMTP id x12mr146748wrl.262.1554919430311; Wed, 10 Apr 2019 11:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554919430; cv=none; d=google.com; s=arc-20160816; b=zUdet0rZLi6+jqEEf/3af5R1+ZytjFYX2Jvqq2Sh7SCM8X3WFkc5EbHdvFJid7lB3w QAy6XzicPqNhjii5qCZKGfwYrxqLQgX9WyPstbjMdVODSJ+1QNtD5rTQhjWyPPehFDkR MFQeIVdKuUPOEhVVtC/Lgr3epYu5ccVJrf9qb2Kv6KoJCZgGymOYVNcAp0Ui7n4Lt9oJ 5nMZKqp+nlRziG6cVM9rtHxZZRYDl1b/kWthlbdvbtKmwiYjMCkLl+KD5rj3Sdpkvoh7 3yCVSG9XMxwkIe2aljIhQcsZPiyjQXF8zuJv1spg2tNn75no0kstt8RetP1zgfdTcLW4 L0/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:message-id:date:to:from; bh=//0XlXqHSzOfxjjZ3G55NMx+0mkXB2CRUFcQlHiQuPM=; b=hRZuT3zLwsbVy5cyyB2vZdohcbkCqelTkndO7OoU89tMEfg33LxKB5Knhgo+uIhuIT 1bC/Pqur7AqFr4dXliJCDJnFYsyQ7KxuktpQX//5M9pb/oNMYtQK2ZTSy+nsMlVLagI5 IASNRzJTXoPrheHD4bTqQtDy8aYbAduueiOT3X+aEafd0Edzu/fqTp72EjTRMA25G8Qr XToQStWCO6UX6QecvNazxAUQ5a4f5YZ/Cm7q77E+asOFxY8b6/4Hce2kZFqhXG0kuO2p ezimQMju84YPHDlRYKc244iQ7wEahQOz3E2QRFbf3TeeoS9C9epDsuD3Jkt/68/GsLrc GjQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g203si1792877wmf.169.2019.04.10.11.03.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 10 Apr 2019 11:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([127.0.0.1]:35405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEHZd-0002oT-CV for patch@linaro.org; Wed, 10 Apr 2019 14:03:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEHZS-0002o7-HO for qemu-devel@nongnu.org; Wed, 10 Apr 2019 14:03:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEHZR-0001fE-MT for qemu-devel@nongnu.org; Wed, 10 Apr 2019 14:03:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEHZR-0001ep-ER for qemu-devel@nongnu.org; Wed, 10 Apr 2019 14:03:37 -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 BE42781E19 for ; Wed, 10 Apr 2019 18:03:36 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-123-233.rdu2.redhat.com [10.10.123.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFFFA5C3FD; Wed, 10 Apr 2019 18:03:35 +0000 (UTC) From: Cole Robinson To: qemu-devel@nongnu.org Date: Wed, 10 Apr 2019 14:03:31 -0400 Message-Id: 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.25]); Wed, 10 Apr 2019 18:03:36 +0000 (UTC) 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] [PATCH] 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: , Cc: dgilbert@redhat.com, Cole Robinson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Cole Robinson --- hmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.21.0 Reviewed-by: Eric Blake diff --git a/hmp.c b/hmp.c index 8eec768088..74a4bfc1f9 100644 --- a/hmp.c +++ b/hmp.c @@ -1481,10 +1481,11 @@ void hmp_delvm(Monitor *mon, const QDict *qdict) const char *name = qdict_get_str(qdict, "name"); 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, + "Error while deleting snapshot on device '%s': ", + bdrv_get_device_name(bs)); } + hmp_handle_error(mon, &err); } void hmp_info_snapshots(Monitor *mon, const QDict *qdict)