From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuKdr-0007jI-GO for qemu-devel@nongnu.org; Thu, 26 Jul 2012 05:46:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuKdn-0004OE-H9 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 05:45:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuKdn-0004O7-94 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 05:45:55 -0400 Message-ID: <501111CD.9000701@redhat.com> Date: Thu, 26 Jul 2012 11:45:49 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1343249431-9245-1-git-send-email-lcapitulino@redhat.com> <87boj3dyxg.fsf@codemonkey.ws> In-Reply-To: <87boj3dyxg.fsf@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 00/14]: add printf-like human msg to error_set() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com, Luiz Capitulino , afaerber@suse.de Am 26.07.2012 04:43, schrieb Anthony Liguori: > Luiz Capitulino writes: > >> Basically, this series changes a call like: >> >> error_set(errp, QERR_DEVICE_NOT_FOUND, device); >> >> to: >> >> error_set(errp, QERR_DEVICE_NOT_FOUND, >> "Device 'device=%s' not found", device); >> >> In the first call, QERR_DEVICE_NOT_FOUND is a string containing a json dict: >> >> "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }" > > This is the wrong direction. Looking through the patch, this makes the > code much more redundant overall. You have dozens of calls that are > duplicating the same error message. This is not progress. I believe this is mostly because it's a mechanical conversion. Once this is done, we can change error messages to better fit the individual cases. > We should just stick with a simple QERR_GENERIC and call it a day. > Let's not needlessly complicate existing code. Why even have error codes when everything should become QERR_GENERIC? Or am I misunderstanding? Kevin