From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyUqA-0000Ga-Sg for qemu-devel@nongnu.org; Thu, 15 Oct 2009 14:14:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyUq6-0000DQ-85 for qemu-devel@nongnu.org; Thu, 15 Oct 2009 14:14:18 -0400 Received: from [199.232.76.173] (port=51854 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyUq6-0000DL-1Z for qemu-devel@nongnu.org; Thu, 15 Oct 2009 14:14:14 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:41462) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MyUq5-0004lh-LH for qemu-devel@nongnu.org; Thu, 15 Oct 2009 14:14:13 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e37.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9FID58Q026775 for ; Thu, 15 Oct 2009 12:13:05 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9FIDt0b155506 for ; Thu, 15 Oct 2009 12:13:59 -0600 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 n9FIDsuK014492 for ; Thu, 15 Oct 2009 12:13:54 -0600 Subject: Re: [Qemu-devel] [PATCH 6/9] QError: Add qdev not found error From: Hollis Blanchard In-Reply-To: <20091015145208.1d871f09@doriath> References: <1255453026-18637-1-git-send-email-lcapitulino@redhat.com> <1255453026-18637-7-git-send-email-lcapitulino@redhat.com> <1255561330.29192.2.camel@slab.beaverton.ibm.com> <20091015103405.591e2f3b@doriath> <1255626960.29192.7.camel@slab.beaverton.ibm.com> <20091015145208.1d871f09@doriath> Content-Type: text/plain Date: Thu, 15 Oct 2009 11:13:53 -0700 Message-Id: <1255630433.29192.16.camel@slab.beaverton.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com On Thu, 2009-10-15 at 14:52 -0300, Luiz Capitulino wrote: > > > You could easily have > > qemu_error(code, "device not found"); > > This doesn't solve the problems I mentioned above, besides I don't > see why you need to specify both, the error code and the description, > they describe the same thing. This is how FTP and other protocols work, for example. You supplied a perfect example: qemu_error(404, "husb: host usb device %d.%d is already open\n", bus_num, addr); In this case, an interactive client could only display the "pretty" text. A machine client would interpret the code as Markus described in a previous mail (temporary server error, permanent server error, etc). In case of a permanent server error, the client could *also* pass through the pretty text to display to the user. > Also, they must not change after the protocol gets into production, > having them defined in the same place will help. This seems really unnecessary and too much abstraction. Aside from that, we should certainly be able to change the pretty text, for example, to provide additional clarification to the user. The machine-interpreted code, on the other hand, wouldn't change. -- Hollis Blanchard IBM Linux Technology Center