From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z236z-0007Ny-Uo for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z236w-0003El-LG for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:53:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z236w-0003E9-Df for qemu-devel@nongnu.org; Mon, 08 Jun 2015 15:53:30 -0400 Message-ID: <5575F2AF.3090303@redhat.com> Date: Mon, 08 Jun 2015 13:53:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1433789877-6950-1-git-send-email-armbru@redhat.com> <1433789877-6950-6-git-send-email-armbru@redhat.com> In-Reply-To: <1433789877-6950-6-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BMDSOodTDt69QUPMQrNmlilSPusdKpnaH" 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: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, afaerber@suse.de, kraxel@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BMDSOodTDt69QUPMQrNmlilSPusdKpnaH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > 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 on= ce) But that can be a later patch, this one is fine as-is for following existing practice. >=20 > Signed-off-by: Markus Armbruster > --- > include/qapi/qmp/qerror.h | 3 --- > qdev-monitor.c | 30 +++++++++++++++++++----------- > 2 files changed, 19 insertions(+), 14 deletions(-) >=20 > 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"= > =20 > -#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. > @@ -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 busse= s", 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/ You could always skirt the confusion by creative wording like "has multiple bus children". 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 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BMDSOodTDt69QUPMQrNmlilSPusdKpnaH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVdfKvAAoJEKeha0olJ0NqbLoIAKQmRvssqdABR0n+j57NB/En OSyVe39uRcOCXgUtsR9Y7xO9X423vA0P6AnleV9dPyT/yEPE7PV+HamuVWu4RW6A exnbtIcyA+K6N5tix83oZN4FOiZo8LX5YOd6NhVQbE94l0mYHqxrmkUtWiYEAiwY xEdbYwMrrGe0SkWuIZ77hP03OiG0kdXprGcZhJ27ZOfEbSaww16Aevj0AjLKutnb lv4/sKsCQ5f611+gIpe1RF4kYUr5ioE1v8hHW02BvDr9lIKO9I7efTkRE/Dqy5mh S7qM2iuSe5JGC8g0gXk+urHpWgulYx1RKynesUHrlHI9VMXRGW3MhvP5CsTHgHA= =kDz0 -----END PGP SIGNATURE----- --BMDSOodTDt69QUPMQrNmlilSPusdKpnaH--