From patchwork Fri Oct 30 17:46:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1391197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=xW0Tgk+/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CN8sM0kCyz9sSn for ; Sat, 31 Oct 2020 04:47:32 +1100 (AEDT) Received: from localhost ([::1]:49824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYYUr-0005pS-4e for incoming@patchwork.ozlabs.org; Fri, 30 Oct 2020 13:47:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYYUW-0005pJ-1x for qemu-devel@nongnu.org; Fri, 30 Oct 2020 13:47:08 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:38931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYYUU-0002cE-BJ for qemu-devel@nongnu.org; Fri, 30 Oct 2020 13:47:07 -0400 Received: by mail-wm1-x330.google.com with SMTP id d3so3697260wma.4 for ; Fri, 30 Oct 2020 10:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=28SgNa3EluWUvbAzV8yhw6h4WUxhavGJS1xTF5jSc7o=; b=xW0Tgk+/e+5YCX0etdavOkr/d5VuOH9G3UcNn82btAN4Id6xUf8FMny0JvRKi6w2P6 sPIHcRjOBP7r3B5uYqfv3nKy4vcstoPGv3W6TjW5wA3Nfm5j55+vt0JsiYz3YhasuQ4R j+9B2S0NX37bPNCCmzkjYHhCFHbFcIoTFRfZDjNqpJloK1N2EHY7Zfddn1wZMa9OQnpz B7PpPlwl77Ge6qfWxyrpH2gF+DkvNUpQ5Ms13yXowKPz9V2aL7himQjtEKk+NRAYzcNl /vM9suF9NIJ/1YI0uPrOQrR/EdO+PGL2cWLht8FPA8djsHP/FCjDV3CkWz3q6uHs5v78 xaCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=28SgNa3EluWUvbAzV8yhw6h4WUxhavGJS1xTF5jSc7o=; b=AtQAt8Fc3x0NobxedpXDssTwmSg61+GAFVLyiw7Mh/o3ogPowrku3N4KREWcbcQycl u7P4dg1KI46GexYHFhwr5XniAosiqJ3XLnqdeZXMkgpBbn4DKCFGklUDbLbBkWygWvf6 Rnedhw+eOqyJjAbE9ffxQmFk359izdqHni/AJzWN/j6udbuO8rdNsxvV2Y1SQUBRnFqL juMKSKJCPkQCOoNhEl4ayy4Qs3IkDJd1gpKjUDiXUqzwCVzQrsEUXdJXjW/A8H664GII YqHNBXpnfSiQXFdsGxhP/+HwYNIucANcG1lBwPk5jvLnp9nZPW3G10cIUNgiy9NtVRO8 lvUA== X-Gm-Message-State: AOAM530PUSXZDV3uurN2WB/hjX99Bac1L0EoX57ZGJ9M+tDZUtfdnHUd YX/sXUNJ3HXsqgyb7HnqGnGcQD0aKsd/hg== X-Google-Smtp-Source: ABdhPJzaToe3/QPz8pUIe9JSbB7FQ5LCgGznWmd9BUzygqdEPlxVFULsxHLAmQf9+eWbKLGHbJYKlg== X-Received: by 2002:a05:600c:218a:: with SMTP id e10mr3899763wme.7.1604080024164; Fri, 30 Oct 2020 10:47:04 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 1sm12522655wre.61.2020.10.30.10.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 10:47:03 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 1/2] scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments Date: Fri, 30 Oct 2020 17:46:59 +0000 Message-Id: <20201030174700.7204-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201030174700.7204-1-peter.maydell@linaro.org> References: <20201030174700.7204-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The kerneldoc script currently emits Sphinx markup for a macro with arguments that uses the c:function directive. This is correct for Sphinx versions earlier than Sphinx 3, where c:macro doesn't allow documentation of macros with arguments and c:function is not picky about the syntax of what it is passed. However, in Sphinx 3 the c:macro directive was enhanced to support macros with arguments, and c:function was made more picky about what syntax it accepted. When kerneldoc is told that it needs to produce output for Sphinx 3 or later, make it emit c:function only for functions and c:macro for macros with arguments. We assume that anything with a return type is a function and anything without is a macro. This fixes the Sphinx error: /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/qom/object.h:155:Error in declarator If declarator-id with parameters (e.g., 'void f(int arg)'): Invalid C declaration: Expected identifier in nested name. [error at 25] DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME) -------------------------^ If parenthesis in noptr-declarator (e.g., 'void (*f(int arg))(double)'): Error in declarator or parameters Invalid C declaration: Expecting "(" in parameters. [error at 39] DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME) ---------------------------------------^ Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Tested-by: Stefan Hajnoczi --- scripts/kernel-doc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0ff62bb6a2d..4fbaaa05e38 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -839,7 +839,23 @@ sub output_function_rst(%) { output_highlight_rst($args{'purpose'}); $start = "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: "; + if ((split(/\./, $sphinx_version))[0] >= 3) { + # Sphinx 3 and later distinguish macros and functions and + # complain if you use c:function with something that's not + # syntactically valid as a function declaration. + # We assume that anything with a return type is a function + # and anything without is a macro. + if ($args{'functiontype'} ne "") { + print ".. c:function:: "; + } else { + print ".. c:macro:: "; + } + } else { + # Older Sphinx don't support documenting macros that take + # arguments with c:macro, and don't complain about the use + # of c:function for this. + print ".. c:function:: "; + } } if ($args{'functiontype'} ne "") { $start .= $args{'functiontype'} . " " . $args{'function'} . " ("; From patchwork Fri Oct 30 17:47:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1391204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Xqju9OGz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CN8th4fFcz9sSf for ; Sat, 31 Oct 2020 04:48:44 +1100 (AEDT) Received: from localhost ([::1]:54056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYYW2-0007ZS-Lz for incoming@patchwork.ozlabs.org; Fri, 30 Oct 2020 13:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYYUX-0005pl-2k for qemu-devel@nongnu.org; Fri, 30 Oct 2020 13:47:09 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYYUV-0002cL-7r for qemu-devel@nongnu.org; Fri, 30 Oct 2020 13:47:08 -0400 Received: by mail-wm1-x343.google.com with SMTP id 13so3642907wmf.0 for ; Fri, 30 Oct 2020 10:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kaf6S3CXD8ewRwpMNYi9VPm3Wdu0Xi27kiY4zNfIfao=; b=Xqju9OGzIk+DT/+hopWc1Rf5owoU7lCz+EjhLUNFfywNmVaYD3POevbHQMK6FTVS77 lbj5MPRS4sNKNcIHtmzfrzVBFGHMwtGlRAZuV/loEAvMaGTq0ORUOtRPxtzbPKsD4nLI xYQWRT7Te1fp10rT/LSYiCEpW4XVUN6ixmQsFpk8toYZeP7UfgBEH8PPBvTFW7N7XtcX CWsgS1Cted8X+BJdvyS2ta1DU5zfwMpIH7LJP+ZOeevVkMs6FmLGCpg3JjEEdza5XlQ/ 8u5RbQ/Ru8F1c0J05/YKnq7K4kx+/C98tF5N50VCP/LGCR0/NUlftBDO+pjNYkoN28di e1jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kaf6S3CXD8ewRwpMNYi9VPm3Wdu0Xi27kiY4zNfIfao=; b=VeycjZq1W0Dzv7W/whS6679gdsr/xCTMTCebKbDVmMdYzSv5e9l6D0rEc3D0Np+JQm P8nyVw+dH68bD3m2xEeYvFIcgdvQ/muKDQmQNf2LSjUDiNrkiSLbXLpROPhatnjI/x3o h5/p+uX2DMeduDexiq7bg/o2DRpBXC3dWYp0krpEDIi+27oU2dD0xRYbCs3KSpvfHFOY kg2QWm/TOy/7iRqhHHantOFkjZWkBJOg1S8wihND8Tb0OmfnBDmXislpTzyH4vawBIP6 1PWPNp9v8Egf29E5XmLn+5KTkiwVCGCdaq3qjv2r4OBUbrcTVk8aTbJXKLoJFe/HRgtv 9TZA== X-Gm-Message-State: AOAM531m8/sf6zAjMxLxhjRhuY9pweIPxfTTPRn+vopIIGJ8/L9mx24s IPpyPj293OYcqBROUkf7AU+k0Tfd6M8gMg== X-Google-Smtp-Source: ABdhPJwXW8DBizZO10IHaeymYB7sYn8caHfESqSXMJOlJImrC2qyLKsl9N4skMChJrLBQOCjvwwF+A== X-Received: by 2002:a1c:e90a:: with SMTP id q10mr3825304wmc.57.1604080025609; Fri, 30 Oct 2020 10:47:05 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 1sm12522655wre.61.2020.10.30.10.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 10:47:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/2] qemu-option-trace.rst.inc: Don't use option:: markup Date: Fri, 30 Oct 2020 17:47:00 +0000 Message-Id: <20201030174700.7204-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201030174700.7204-1-peter.maydell@linaro.org> References: <20201030174700.7204-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Sphinx 3.2 is pickier than earlier versions about the option:: markup, and complains about our usage in qemu-option-trace.rst: ../../docs/qemu-option-trace.rst.inc:4:Malformed option description '[enable=]PATTERN', should look like "opt", "-opt args", "--opt args", "/opt args" or "+opt args" In this file, we're really trying to document the different parts of the top-level --trace option, which qemu-nbd.rst and qemu-img.rst have already introduced with an option:: markup. So it's not right to use option:: here anyway. Switch to a different markup (definition lists) which gives about the same formatted output. (Unlike option::, this markup doesn't produce index entries; but at the moment we don't do anything much with indexes anyway, and in any case I think it doesn't make much sense to have individual index entries for the sub-parts of the --trace option.) Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrangé Tested-by: Stefan Hajnoczi --- docs/qemu-option-trace.rst.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/qemu-option-trace.rst.inc b/docs/qemu-option-trace.rst.inc index 7e09773a9c5..d7acbe67f73 100644 --- a/docs/qemu-option-trace.rst.inc +++ b/docs/qemu-option-trace.rst.inc @@ -1,7 +1,7 @@ Specify tracing options. -.. option:: [enable=]PATTERN +``[enable=]PATTERN`` Immediately enable events matching *PATTERN* (either event name or a globbing pattern). This option is only @@ -11,7 +11,7 @@ Specify tracing options. Use :option:`-trace help` to print a list of names of trace points. -.. option:: events=FILE +``events=FILE`` Immediately enable events listed in *FILE*. The file must contain one event name (as listed in the ``trace-events-all`` @@ -19,7 +19,7 @@ Specify tracing options. available if QEMU has been compiled with the ``simple``, ``log`` or ``ftrace`` tracing backend. -.. option:: file=FILE +``file=FILE`` Log output traces to *FILE*. This option is only available if QEMU has been compiled with