From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlOD-0005YX-9z for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:28:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGlO4-0004G7-Q6 for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:27:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGlO4-0004Fh-H0 for qemu-devel@nongnu.org; Thu, 29 Jan 2015 04:27:44 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0T9Rham022231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 29 Jan 2015 04:27:43 -0500 From: Markus Armbruster Date: Thu, 29 Jan 2015 10:27:38 +0100 Message-Id: <1422523658-3503-10-git-send-email-armbru@redhat.com> In-Reply-To: <1422523658-3503-1-git-send-email-armbru@redhat.com> References: <1422523658-3503-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 9/9] balloon: Eliminate silly QERR_ macros List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, lcapitulino@redhat.com The QERR_ macros are leftovers from the days of "rich" error objects. They're used with error_set() and qerror_report(), and expand into the first *two* arguments. This trickiness has become pointless. Clean up the balloon ones. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Markus Armbruster --- balloon.c | 6 ++++-- include/qapi/qmp/qerror.h | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/balloon.c b/balloon.c index 728bb70..dea19a4 100644 --- a/balloon.c +++ b/balloon.c @@ -39,11 +39,13 @@ static void *balloon_opaque; static bool have_ballon(Error **errp) { if (kvm_enabled() && !kvm_has_sync_mmu()) { - error_set(errp, QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon"); + error_set(errp, ERROR_CLASS_KVM_MISSING_CAP, + "Using KVM without synchronous MMU, balloon unavailable"); return false; } if (!balloon_event_fn) { - error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon"); + error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE, + "No balloon device has been activated"); return false; } return true; diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 28f980e..eeaf0cb 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -70,9 +70,6 @@ void qerror_report_err(Error *err); #define QERR_DEVICE_NO_HOTPLUG \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging" -#define QERR_DEVICE_NOT_ACTIVE \ - ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated" - #define QERR_DEVICE_NOT_ENCRYPTED \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted" @@ -109,9 +106,6 @@ void qerror_report_err(Error *err); #define QERR_JSON_PARSING \ ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax" -#define QERR_KVM_MISSING_CAP \ - ERROR_CLASS_KVM_MISSING_CAP, "Using KVM without %s, %s unavailable" - #define QERR_MIGRATION_ACTIVE \ ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress" -- 1.9.3