From patchwork Mon Jul 3 12:25:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 9822625 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B0368602F0 for ; Mon, 3 Jul 2017 12:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A017A20683 for ; Mon, 3 Jul 2017 12:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9142E24B5B; Mon, 3 Jul 2017 12:26:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 19E3320683 for ; Mon, 3 Jul 2017 12:26:36 +0000 (UTC) Received: from localhost ([::1]:34730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS0R1-0006Xg-5q for patchwork-qemu-devel@patchwork.kernel.org; Mon, 03 Jul 2017 08:26:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS0Pk-0006V1-TH for qemu-devel@nongnu.org; Mon, 03 Jul 2017 08:25:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS0Pk-00085j-0Y for qemu-devel@nongnu.org; Mon, 03 Jul 2017 08:25:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dS0Ph-00083X-KZ; Mon, 03 Jul 2017 08:25:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0580C058ED7; Mon, 3 Jul 2017 12:25:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B0580C058ED7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mreitz@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B0580C058ED7 Received: from localhost (unknown [10.40.205.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FC4A895A8; Mon, 3 Jul 2017 12:25:12 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 3 Jul 2017 14:25:01 +0200 Message-Id: <20170703122505.32017-2-mreitz@redhat.com> In-Reply-To: <20170703122505.32017-1-mreitz@redhat.com> References: <20170703122505.32017-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 03 Jul 2017 12:25:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/5] qapi/qnull: Add own header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Markus Armbruster Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/qapi/qmp/qnull.h | 26 ++++++++++++++++++++++++++ include/qapi/qmp/qobject.h | 8 -------- include/qapi/qmp/types.h | 1 + qobject/qnull.c | 2 +- tests/check-qnull.c | 2 +- 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 include/qapi/qmp/qnull.h diff --git a/include/qapi/qmp/qnull.h b/include/qapi/qmp/qnull.h new file mode 100644 index 0000000..48edad4 --- /dev/null +++ b/include/qapi/qmp/qnull.h @@ -0,0 +1,26 @@ +/* + * QNull + * + * Copyright (C) 2015 Red Hat, Inc. + * + * Authors: + * Markus Armbruster + * + * This work is licensed under the terms of the GNU LGPL, version 2.1 + * or later. See the COPYING.LIB file in the top-level directory. + */ + +#ifndef QNULL_H +#define QNULL_H + +#include "qapi/qmp/qobject.h" + +extern QObject qnull_; + +static inline QObject *qnull(void) +{ + qobject_incref(&qnull_); + return &qnull_; +} + +#endif /* QNULL_H */ diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h index b8ddbca..ef1d1a9 100644 --- a/include/qapi/qmp/qobject.h +++ b/include/qapi/qmp/qobject.h @@ -93,12 +93,4 @@ static inline QType qobject_type(const QObject *obj) return obj->type; } -extern QObject qnull_; - -static inline QObject *qnull(void) -{ - qobject_incref(&qnull_); - return &qnull_; -} - #endif /* QOBJECT_H */ diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h index a4bc662..749ac44 100644 --- a/include/qapi/qmp/types.h +++ b/include/qapi/qmp/types.h @@ -19,5 +19,6 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" +#include "qapi/qmp/qnull.h" #endif /* QAPI_QMP_TYPES_H */ diff --git a/qobject/qnull.c b/qobject/qnull.c index c124d05..43918f1 100644 --- a/qobject/qnull.c +++ b/qobject/qnull.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" -#include "qapi/qmp/qobject.h" +#include "qapi/qmp/qnull.h" QObject qnull_ = { .type = QTYPE_QNULL, diff --git a/tests/check-qnull.c b/tests/check-qnull.c index 8dd1c96..4a67b9a 100644 --- a/tests/check-qnull.c +++ b/tests/check-qnull.c @@ -8,7 +8,7 @@ */ #include "qemu/osdep.h" -#include "qapi/qmp/qobject.h" +#include "qapi/qmp/qnull.h" #include "qemu-common.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h"