From patchwork Wed Apr 24 21:49:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 162813 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1168218jan; Wed, 24 Apr 2019 14:49:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzugIkwlfbg7vAgSkDKFoWIGt6BRTNbDk7VAbXf2DmUsdHayE/EMc5ZIEqCGOHVjW87PWpf X-Received: by 2002:a1c:4c12:: with SMTP id z18mr861581wmf.142.1556142573638; Wed, 24 Apr 2019 14:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556142573; cv=none; d=google.com; s=arc-20160816; b=tF50RbLl4zBBHtHip20/XZxjRFkUXqtkLS3yQdD5P1IH/Q9BOxr3OFCKYm/fAfS7Sg cY7fzvthWq6xSo0O8WcDF0McTJ04K9viLVK1Q4x26FNGkqiXc+CdwNfdaqEqHfuDzfpD 1HaDJ6b1EF+aQjZE4sOW6LtrXOhxfJ84XYpcgdRBSKBe72yhAziXnWBezWuK5F/8MUHn uev2fJ/DBN7n4XXo+xUjsaCuoIqtM2JQWS7EwoR9jBy9NsS+UTtSvQdOHWA5aV7yb/7E xdYsvfxJ1spDnldWWLVZoYE46dMt30HcpqfVqPuAl+povb3490xMrIoo2vRPUhv6ZQ89 yqEQ== 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=X3qOQx8QzNtScRYenkbGSlnV4Yw8yebKxUtN7cKrRvs=; b=ZfWsObdbFdQM0PDElCjeXocBIT2y+9wWzpjwlW7jRaRLVC/2POZ7pEgIQ7t6aqlUMu Ma9+nfP9G6KZpx1+kml45HDqdGnVC1zojCt2Xnw7fv5PH/L2cIE0EEfQVbfhUBpxz7NI wI0Dy8E+h1hwvp/ix0MraKZv5EZjOauEgLwbNx6S2ArYxcuQ4b3pGVMvjP9BeM56eiW2 1JgAeqeN5zDGdZaBZovUJ85RtY00X2xi3hO0X+pWcBJsj8zxR6Mtz7jrbPMk11C05XEs Woi32Oiv7eH2FAebfA9ZoZEO79Aiyav0uxYkkjZL3k9SBqwaEZaAt2izIcGn/FgCXdni w4ZQ== 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 19si4154648wmf.26.2019.04.24.14.49.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Apr 2019 14:49:33 -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]:47730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJPlk-0000qC-HU for patch@linaro.org; Wed, 24 Apr 2019 17:49:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJPla-0000q2-LQ for qemu-devel@nongnu.org; Wed, 24 Apr 2019 17:49:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJPlZ-0005nb-Jt for qemu-devel@nongnu.org; Wed, 24 Apr 2019 17:49:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJPlZ-0005kE-Br for qemu-devel@nongnu.org; Wed, 24 Apr 2019 17:49:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D833230B087F for ; Wed, 24 Apr 2019 21:49:18 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-121-115.rdu2.redhat.com [10.10.121.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3C0A60C70; Wed, 24 Apr 2019 21:49:17 +0000 (UTC) From: Cole Robinson To: qemu-devel@nongnu.org Date: Wed, 24 Apr 2019 17:49:08 -0400 Message-Id: <984634226fa14316641f31f84e7dd0bb770bd94c.1556141033.git.crobinso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 24 Apr 2019 21:49:18 +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 v2] 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: "Dr. David Alan Gilbert" , 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. Reviewed-by: Eric Blake Signed-off-by: Cole Robinson --- v2: Drop now redundant "Error while" string prefix hmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.21.0 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 = 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, + "deleting snapshot on device '%s': ", + bdrv_get_device_name(bs)); } + hmp_handle_error(mon, &err); } void hmp_info_snapshots(Monitor *mon, const QDict *qdict)