From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfOCC-0006hB-TO for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:20 -0500 Received: from [199.232.76.173] (port=57691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfOCC-0006gf-Et for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:20 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfOC8-0001Cj-KI for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13724) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfOC8-0001CB-0r for qemu-devel@nongnu.org; Wed, 10 Feb 2010 20:50:16 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1B1oDdY014759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Feb 2010 20:50:14 -0500 From: Luiz Capitulino Date: Wed, 10 Feb 2010 23:49:46 -0200 Message-Id: <1265853007-27300-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com Hi there, When I started converting handlers to the QObject style, I thought that returning an error code wouldn't be needed. That is, we have an error object already, so if the handler returns the error object it has failed, otherwise it has succeeded. This was also very convenient, because handlers have never returned an error code, and thus it would be easier to add a call to qemu_error_new() in the right place instead of returning error codes. Turns out we need both. Actually, I should not have abused the error object this way because (as Markus says) this is too fragile and we can end up reporting bogus errors to clients (among other problems). The good news is that it's easy to fix. All we have to do is to change cmd_new() (the handler callback) to return an error code and convert existing QObject handlers to it. This series does that and most of the patches are really straightforward conversions. Additionally, Markus has designed an excellent debug mechanism for QMP, which is implemented by the last patches in this series, and will allow us to catch important QObject conversion and error handling bugs in handlers. Thanks.