From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyVwj-0003pa-VO for qemu-devel@nongnu.org; Thu, 15 Oct 2009 15:25:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyVwe-0003p8-EZ for qemu-devel@nongnu.org; Thu, 15 Oct 2009 15:25:08 -0400 Received: from [199.232.76.173] (port=48605 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyVwe-0003p5-9N for qemu-devel@nongnu.org; Thu, 15 Oct 2009 15:25:04 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:6851) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyVwd-0003Td-Uw for qemu-devel@nongnu.org; Thu, 15 Oct 2009 15:25:04 -0400 Received: by fg-out-1718.google.com with SMTP id 22so1677593fge.10 for ; Thu, 15 Oct 2009 12:25:03 -0700 (PDT) Message-ID: <4AD77709.7090909@codemonkey.ws> Date: Thu, 15 Oct 2009 14:24:57 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v0 0/9] QError References: <1255453026-18637-1-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1255453026-18637-1-git-send-email-lcapitulino@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: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com Luiz Capitulino wrote: > This series adds infrastructure which will be needed by the future monitor > protocol to handle and emit error information correctly. > > QError is a QObject designed to stored error information in way that it can > be emitted by the protocol code or printed in an user friendly way. > > To use it in the Monitor and its handlers, I've added a function called > qemu_error_structed(), which builds on top of Gerd's QemuErrorSink API, this > means that it is also capable of printing error information to stderr. > > Basically, we have a QError member in the Monitor struct, which will be set > if an error has occurred. The Monitor's top level code will check it at > handler exit time and handle the error properly. > > QError represents an error, and it has the following properties: > > - Error code > - Error general description > - Error specific data > > Code and description are stored in a static table in the QError module itself, > the error specific data is generated at error time by the function calling > qemu_error_structed(). > > This design is based on the way I plan to emit error information in the > protocol, which is: > > { "error": { "code": json-number, > "desc": json-string, > "data": json-value } "id": json-value, "timestamp": json-string } > Why timestamp? > Besides introducing QError, this series also has simple usage examples for > qdev_device_add() and do_info_balloon(). > > Hopefully this is the last big piece of infrastructure before having the > protocol parser itself. > > Please, review carefully. > > Thanks. > > PS: Applies on top of my last series. > > >