From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmjJr-0005id-Ty for qemu-devel@nongnu.org; Thu, 15 Oct 2015 10:15:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmjJl-0008S4-Fy for qemu-devel@nongnu.org; Thu, 15 Oct 2015 10:15:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmjJk-0008RV-P6 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 10:15:40 -0400 From: Markus Armbruster Date: Thu, 15 Oct 2015 16:15:31 +0200 Message-Id: <1444918537-18107-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 0/6] qobject: Make conversion from QObject * accept null List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com The qobject_to_FOO() crash on null, which is a trap for the unwary. Return null instead, and simplify a few callers. Throw in a patch to drop QObject_HEAD. Luiz, I'm happy to take this through my tree, since got a QMP series based on it (to be posted shortly). Markus Armbruster (6): qobject: Drop QObject_HEAD qbool: Make conversion from QObject * accept null qdict: Make conversion from QObject * accept null qfloat qint: Make conversion from QObject * accept null qlist: Make conversion from QObject * accept null qstring: Make conversion from QObject * accept null include/qapi/qmp/qbool.h | 2 +- include/qapi/qmp/qdict.h | 2 +- include/qapi/qmp/qfloat.h | 2 +- include/qapi/qmp/qint.h | 2 +- include/qapi/qmp/qlist.h | 2 +- include/qapi/qmp/qobject.h | 4 ---- include/qapi/qmp/qstring.h | 2 +- qapi/qmp-input-visitor.c | 40 ++++++++++++++++++++++------------------ qga/main.c | 11 +++-------- qobject/qbool.c | 4 ++-- qobject/qdict.c | 39 ++++++++++++--------------------------- qobject/qfloat.c | 4 ++-- qobject/qint.c | 4 ++-- qobject/qlist.c | 3 +-- qobject/qstring.c | 4 ++-- 15 files changed, 52 insertions(+), 73 deletions(-) -- 2.4.3