Received: from eggs.gnu.org ([2001:4830:134:3::10]:40559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2ChD-0002kW-La for qemu-devel@nongnu.org; Tue, 09 Jun 2015 02:07:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2Ch9-0003tp-Hc for qemu-devel@nongnu.org; Tue, 09 Jun 2015 02:07:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2Ch9-0003te-AF for qemu-devel@nongnu.org; Tue, 09 Jun 2015 02:07:31 -0400 From: Markus Armbruster References: <1433789877-6950-1-git-send-email-armbru@redhat.com> <1433789877-6950-6-git-send-email-armbru@redhat.com> <5575F2AF.3090303@redhat.com> Date: Tue, 09 Jun 2015 08:07:28 +0200 In-Reply-To: <5575F2AF.3090303@redhat.com> (Eric Blake's message of "Mon, 08 Jun 2015 13:53:19 -0600") Message-ID: <873821za73.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 5/7] qdev-monitor: Convert qbus_find() to Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: pbonzini@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de Eric Blake writes: > On 06/08/2015 12:57 PM, Markus Armbruster wrote: >> As usual, the conversion breaks printing explanatory messages after >> the error: actual printing of the error gets delayed, so the >> explanations precede rather than follow it. >> >> Pity. Disable them for now. See also commit 7216ae3. > > Could we add some sort of error_append_hmp_hint() that adds additional > messages to an existing error object, for use when the error will be > printed via HMP but is a no-op for QMP? (and make it callable more than > once, since qbus_list_dev() uses error_printf() in that role more than once) Should work. Should get its own series, of course. Volunteer welcome :) > But that can be a later patch, this one is fine as-is for following > existing practice. Agree. >> Signed-off-by: Markus Armbruster >> --- >> include/qapi/qmp/qerror.h | 3 --- >> qdev-monitor.c | 30 +++++++++++++++++++----------- >> 2 files changed, 19 insertions(+), 14 deletions(-) >> >> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h >> index e567339..6468e40 100644 >> --- a/include/qapi/qmp/qerror.h >> +++ b/include/qapi/qmp/qerror.h >> @@ -43,9 +43,6 @@ void qerror_report_err(Error *err); >> #define QERR_BUS_NO_HOTPLUG \ >> ERROR_CLASS_GENERIC_ERROR, "Bus '%s' does not support hotplugging" >> >> -#define QERR_BUS_NOT_FOUND \ >> - ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found" > > Might want to mention one less baroque macro in qerror.h in the commit > message as an intentional part of the conversion. Could append: While there, eliminate QERR_BUS_NOT_FOUND. >> @@ -475,14 +479,15 @@ static BusState *qbus_find(const char *path) >> break; >> } >> if (dev->num_child_bus) { >> - qerror_report(ERROR_CLASS_GENERIC_ERROR, >> - "Device '%s' has multiple child busses", elem); >> + error_setg(errp, "Device '%s' has multiple child busses", > > Stupid spell-check on my mailer is flagging 'busses' as a typo, even > though dictionary.com says both spellings are acceptable. Other sources > prefer 'buses' and say 'busses' is out of favor: > http://grammarist.com/spelling/buses-busses/ If I have to respin anyway, I can fold in s/busses/buses/, and amend While there, eliminate QERR_BUS_NOT_FOUND, and clean up unusual spelling in the error message. > You could always skirt the confusion by creative wording like "has > multiple bus children". Nah, we just spell like the dictionary says we should. > But it is a pre-existing issue [if an issue at > all], so I don't care enough to make it hold up this patch. > > Reviewed-by: Eric Blake Thanks!