From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MzsnO-0000ui-T2 for qemu-devel@nongnu.org; Mon, 19 Oct 2009 10:01:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MzsnJ-0000qL-7Q for qemu-devel@nongnu.org; Mon, 19 Oct 2009 10:01:09 -0400 Received: from [199.232.76.173] (port=56226 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzsnJ-0000q8-3d for qemu-devel@nongnu.org; Mon, 19 Oct 2009 10:01:05 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:38691) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MzsnH-0006jp-Id for qemu-devel@nongnu.org; Mon, 19 Oct 2009 10:01:04 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e6.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9JE5rpu031746 for ; Mon, 19 Oct 2009 10:05:53 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9JE0iVE2257104 for ; Mon, 19 Oct 2009 10:00:45 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9JE0ZqL013592 for ; Mon, 19 Oct 2009 08:00:35 -0600 Message-ID: <4ADC7101.6020002@us.ibm.com> Date: Mon, 19 Oct 2009 09:00:33 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 7/9] qdev: Use QError for not found error References: <1255453026-18637-1-git-send-email-lcapitulino@redhat.com> <1255453026-18637-8-git-send-email-lcapitulino@redhat.com> <877huy6hzm.fsf@pike.pond.sub.org> <20091019101241.GA27871@redhat.com> In-Reply-To: <20091019101241.GA27871@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, kraxel@redhat.com, Markus Armbruster , Luiz Capitulino Daniel P. Berrange wrote: > hink just returning error codes to the client is far too little > information. I don't think we need the fully normalized structure > that Luiz originally proposed with bus/dev addresses split out, but > we certainly need to include a string description giving as much > detail as possible. If attaching a host USB device failed, I don't > want a single error code QERR_OPEN_FAILED, nor a generic message > like 'could not open device', i want the exact details, eg > > 'could not open device: permission denied' > 'could not open device: no such file or directory' > 'could not open device: device or resource busy' > > The localization issue is somewhat of a red herring though. This string > description is not something that clients would ultimately expose to the > user. The client apps would likely present a more generic error message > to the user, based off the error code. The error description received > from QEMU will instead be written out to the logs as a record for later > troubleshooting. eg if the user files a bug report, it will include the > full error details, so libvirt/qemu maintainers have a better chance of > figuring out what went wrong. > But then advanced users end up doing silly things like analyzing libvirt logs. Why do that when your own example is obviously "could not open device: %s", strerror(errno). We should pass {"error" : {"type": "OpenFailedException", "errno": errno}} -- Regards, Anthony Liguori