From patchwork Tue Apr 29 16:32:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 885753 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:38f:210b:807b with SMTP id g4csp421066wrq; Tue, 29 Apr 2025 09:32:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXvIW8f94EkOZlv7ZyAw9gMPt3QrfQt5YTKQAAdRdN72d0+p/HZpTkZGftf1YoAl96PrAhOnQ==@linaro.org X-Google-Smtp-Source: AGHT+IHgs+mWv1RMTWSjiv+/jT6TcpBMSAmpzRjMD5t6O15EyfCpDsnJSOVAaZy3MrQpwF8fb/ya X-Received: by 2002:a05:620a:d8c:b0:7c5:94b2:99da with SMTP id af79cd13be357-7cabe601b60mr512573385a.28.1745944374823; Tue, 29 Apr 2025 09:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745944374; cv=none; d=google.com; s=arc-20240605; b=Ahkxr1P8qChHIZv6oGX/JXXgFGIw35wcE87UxPZ684J7q+//I8v7l8R3az12xr0K9W FErJNatHnidrjP6OCT8eflvtTjIF5enZnsSYDlP3PX3ma8t9OJCslbvGmBB7DQEuOJhq yXARtG8qY5yXqaWku3Ns55JixdPN7hN38WQPUSHtCcvX9n59f8d7T5ZHWeDavQUmUQvs 6iRvu3vDCgyRkl8XVIuPAj/OqGa1fOH0OaNBEUdbCN4XCTiuAfYwNnA7IumoNYuokpTJ 4Y2+KMgsmjXdOojNUwv4W1HhHwtp1hneDKfq2CnSPzmPjVAUu0kGmtA+kTHwjQjeD6du LtJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S0W4rjS2ztSb/BLdpUMpJKYaRm/fmkPTpxWrZeMfG94=; fh=VpoOj6/1CfnXnId8RsjOwejE5iGBAtZkPVDD6AWC4p4=; b=bksC8ixJuOdShkPm9puPlE2+1Hsp3tR9d9QLNep/lSQOnMCJayteAyHAa6+XefgUTT YSDLLVZqOALUv5nlUzJDODnkN++KWihgqVrdMKVI1jKhS3xfXJDV+Z7Y/qyfjSdCf2bh uW2GqwUwBOu03igdn1EgUbOghMiBz+nJwjpkDeUvhvTwk4jLcqhAfR0Wfcub7JJYH2lN TtZ4mPITzCV9VXzcKAAGcHm2wV3GXN3YRDeaWfwOXKlSzGYq2Z0AtNQCZCVS9ZREcgF/ 7Vz9dA+pYK9s+QWjMyO2Uf8zjt41tgZ8Qvxeq16sm9NobzCfAaKYwwnbIUhGQcY6B2vv AqbA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDApYYNn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c958cd83afsi1249114085a.175.2025.04.29.09.32.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Apr 2025 09:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YDApYYNn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9nsf-0004IN-DD; Tue, 29 Apr 2025 12:32:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9nsZ-0004CJ-Mn for qemu-devel@nongnu.org; Tue, 29 Apr 2025 12:32:19 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9nsX-0004f0-3u for qemu-devel@nongnu.org; Tue, 29 Apr 2025 12:32:18 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-39c1ef4acf2so4725042f8f.0 for ; Tue, 29 Apr 2025 09:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745944335; x=1746549135; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S0W4rjS2ztSb/BLdpUMpJKYaRm/fmkPTpxWrZeMfG94=; b=YDApYYNng/YnsKWN7AwXVS0AQIvpldONnjPRRljxtn7Ge83Ghj7klSqfV6mKANbFD7 OHDzd0OhKFh1h0VxhECYKLsizHto+0RfekO3+pYYCU7EfK+7NIsqOrnu15LWeMgRiyHq TKXbigEF13i4oWt1zTnRt2OOVOasz3IdnAhIUpue7Y1+lQ6Avhgw4MmOi0bYiCVBAbTz GGBqLM+IqSgImnBCpJJLc7AkS1N5sr9QfJ3cf/nqrmmnvF/9/g9SnwiExsnyLqz4p2bj 3esTMZ7kwQQzqewTOfwqxV3B40uMlQYJiRvpWhI0L+1DAqUCIHBJS1xMkwrRx1pr3dci /nLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745944335; x=1746549135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S0W4rjS2ztSb/BLdpUMpJKYaRm/fmkPTpxWrZeMfG94=; b=FiTbFMmGNfZHtIl0jPzQuZbn61utbQOHuUQZHtdpyWElCebaU1s9WTbPYZNbQ0lKlJ nsZWL17dNMKbvmYx5N8UIQkEZ6aYjbKYMyTMAQ1y1DAf4rnsFr7KS9lNDhEmAcol2v3v jqEyLVigKQgIc/UN6UKco1Zm4JI1AJ2IHYAK34kPjbu1es+OPb0Bws2UAoQAWv+AOIEO GSqEJeB3HcwlDALcfXcdqdqaEc405XzB9pZfJxZF536WdexmN6M+qo2zv4/zO99Kd1Dw avlR/MzrR0Tz40pVBlWztDU/iVLFASVEMcFLenwvXAAoowxD60+1Yni1EuZiG1hn50Z1 oZEw== X-Gm-Message-State: AOJu0YycevTT8EOCffXW1ngUmkXsTyOKj43dYDZc9U1XsIDFaLBz+MAi BJoieS54RLuaP89tC6Nu2MJKgoPAIW//pVrSGXy1MHAaTaRnLRuX85FAPqYipKTuoiJgZq84xYZ U X-Gm-Gg: ASbGncs8/BAABNaHj3uEPw/yLRFb+7YrHoyKbl2qBb5vTpjh+9cWVf0C4yxxdGIhzyQ lhd/QYU/X/iSLDPRALH5RF9wSbMC2Th+9+wRnz2CAgdwcvDRFcf/n8DmhOzQvnBw0K2LzvECfI7 Zy6IH0vSCWrwjckPaG5qJQlVXxYfZSHottVRxafOyW1+kkR6CnV/jQbq55yFatuRugPPTwlA/m7 MoblE3GoFmM+V+fKMze/ojgkBTgy8G8fJr1YWrvbwAudMlSoJHGhVplr+ySyECSx0anc5pUdFw6 D/UnAdMUffZtfhCsBdembU3KVlNOeULRomQHrEzpSy/DE9s= X-Received: by 2002:a05:6000:4382:b0:3a0:7a8f:fc73 with SMTP id ffacd0b85a97d-3a08f79dc65mr23172f8f.14.1745944335481; Tue, 29 Apr 2025 09:32:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a073ca4cbcsm14176326f8f.25.2025.04.29.09.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Apr 2025 09:32:14 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: John Snow , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 1/2] docs: Create a uniquelabel Sphinx extension Date: Tue, 29 Apr 2025 17:32:11 +0100 Message-ID: <20250429163212.618953-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250429163212.618953-1-peter.maydell@linaro.org> References: <20250429163212.618953-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Sphinx requires that labels within documents are unique across the whole manual. This is because the "create a hyperlink" directive specifies only the name of the label, not a filename+label. Some Sphinx versions will warn about duplicate labels, but even if there is no warning there is still an ambiguity and no guarantee that the hyperlink will be created to the right target. For QEMU this is awkward, because we have various .rst.inc fragments which we include into multiple .rst files. If you define a label in the .rst.inc file then it will be a duplicate label. We have mostly worked around this by not putting labels into those .rst.inc files, or by adding "insert a label" functionality into the hxtool extension (see commit 1eeb432a953b0 "doc/sphinx/hxtool.py: add optional label argument to SRST directive"). This Sphinx extension adds a "uniquelabel" directive, which creates a label which is made unique by adding the name of the document to the label. The name of the generated label is "dir/file-labelname"; this is patterned on the generated label names that the hxtool SRST(label) directive creates. Signed-off-by: Peter Maydell --- docs/conf.py | 1 + docs/sphinx/uniquelabel.py | 74 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 docs/sphinx/uniquelabel.py diff --git a/docs/conf.py b/docs/conf.py index 7b5712e122f..562db95bbf8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -67,6 +67,7 @@ 'qapi_domain', 'qapidoc', 'qmp_lexer', + 'uniquelabel', ] if sphinx.version_info[:3] > (4, 0, 0): diff --git a/docs/sphinx/uniquelabel.py b/docs/sphinx/uniquelabel.py new file mode 100644 index 00000000000..cc4ab7f31c0 --- /dev/null +++ b/docs/sphinx/uniquelabel.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# +# Copyright (c) 2025 Linaro +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Sphinx extension to create a unique label by concatenating +# the name of the origin document with the label text. +# +# Sphinx requires that labels within documents are unique across +# the whole manual. This is because the "create a hyperlink" directive +# specifies only the name of the label, not a filename+label. +# Some Sphinx versions will warn about duplicate labels, but +# even if there is no warning there is still an ambiguity and no +# guarantee that the hyperlink will be created to the right target. +# +# For QEMU this is awkward, because we have various .rst.inc fragments +# which we include into multiple .rst files. If you define a label in +# the .rst.inc file then it will be a duplicate label. +# +# The uniquelabel directive is our fix for this: it creates a label +# whose name includes the name of the top level .rst file. This is then +# unique even if the .rst.inc file is included in multiple places, and +# when we create a hyperlink we can explicitly specify which label we +# are targeting. +# +# Concretely, if you have a foo/bar.rst and a foo/baz.rst that +# both include wat.rst.inc, then in wat.rst.inc you can write +# .. uniquelabel:: mylabel +# and it will be as if you had written a reference label: +# .. _foo/bar-mylabel +# or +# .. _foo/baz-mylabel +# depending on which file included wat.rst.inc, and you can link to +# whichever one you intend via any of the usual markup, e.g. +# `documentation of the thing in bar `. + +"""uniquelabel is a Sphinx extension that implements the uniquelabel directive""" + +from docutils import nodes +from docutils.statemachine import ViewList +from docutils.parsers.rst import directives, Directive +import sphinx + +__version__ = '1.0' + +class UniqueLabelDocDirective(Directive): + """Create a unique label by including the docname""" + required_arguments = 1 + optional_arguments = 0 + has_content = False + + def run(self): + env = self.state.document.settings.env + label = self.arguments[0] + + refline = ".. _" + env.docname + "-" + label + ":" + + rstlist = ViewList() + rstlist.append(refline, "generated text", 0) + + node = nodes.paragraph() + self.state.nested_parse(rstlist, 0, node) + return node.children + +def setup(app): + """ Register uniquelabel directive with Sphinx""" + app.add_directive('uniquelabel', UniqueLabelDocDirective) + + return dict( + version = __version__, + parallel_read_safe = True, + parallel_write_safe = True + ) From patchwork Tue Apr 29 16:32:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 885754 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:38f:210b:807b with SMTP id g4csp421452wrq; Tue, 29 Apr 2025 09:33:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWye7vM22+axjTA0Ja5Q00uVUbLALM+6FDeZJ9Yxz3/yyioVSJ90CjHSHqsGfkNhEJhJQ7Mxw==@linaro.org X-Google-Smtp-Source: AGHT+IFZUWc4n86+kY20w4S77KUuaO1LkzcTiLkVfXZNtggOwa5hEGdXyGBCwEhU2VSPScYWx53v X-Received: by 2002:a05:622a:4286:b0:478:db63:6f51 with SMTP id d75a77b69052e-4885b46fa61mr62168291cf.25.1745944425981; Tue, 29 Apr 2025 09:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745944425; cv=none; d=google.com; s=arc-20240605; b=l08423oI4Y1xk0ZmPE4beUM8l88xbNWfXVksDY5e+93yJMoqDV+CvA1m88BizXXWam l1KuVQegvqQdXWrbtoVqsEr01U8kDQkecqTGuSTBwDl76YI+adX0CTS20g7y3aM6JXN4 kOkqJtYRS6T1L+hPUHcQVBSxKZNg1e+tyGPnJ3bS/3Qs+T84xW8iJwZgbEkmHzD9m3Rc NizMtYngftsA6i8IRSgX7unI39nOSsfRgFDM1UO0m5MR1uqWp27LPkEFLfxhVoZHp2A4 7nk5xGj5giPvvlakkebwqatvaAdEI6EXTlcw2Wad0VvgHtoaipvp7ohGmZvjKwHRow9a 5XNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R9X12hAVFdbebjHYEQDRzia04epp7Dk4I6xOhWrWV8E=; fh=VpoOj6/1CfnXnId8RsjOwejE5iGBAtZkPVDD6AWC4p4=; b=W5OR18508yQz57CGvhWzy8DaEuEQ/Du+uc5xWb4r22s24xPg4/VoQyvkE5S8WIhViY A8aCM6z1Qq46M+m7MfJWF8vy0cOINOHWCvc4GdS3XLg4JvdifQXhSyyuvJbZT74KtDLU GM6rsoWOd2MxMhEWRyrshYjzPUmRrYW/pCXCJHr5uT2vCBOGbO1VlsbvGklr9EG4w3oi 7A4JTBGvBTev4M4STz6l0VvkLrsZ11z9y3n4ZCFEiFcWa7MbFZQWU2nwI4szg3WSy8gZ wKwQZzqbo4sxUY1Uh0oHWgU1W5fnyqo8GYlJesZOMIS251RvrF7kDO7qcTyyzKAuHyOb O9sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QEjWfLW1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47ea19869a1si126763351cf.288.2025.04.29.09.33.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Apr 2025 09:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QEjWfLW1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9nsx-0004XO-Ct; Tue, 29 Apr 2025 12:32:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9nsb-0004G4-A4 for qemu-devel@nongnu.org; Tue, 29 Apr 2025 12:32:23 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u9nsY-0004fM-Jp for qemu-devel@nongnu.org; Tue, 29 Apr 2025 12:32:20 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-39ac9aea656so7204212f8f.3 for ; Tue, 29 Apr 2025 09:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745944336; x=1746549136; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R9X12hAVFdbebjHYEQDRzia04epp7Dk4I6xOhWrWV8E=; b=QEjWfLW1b1uDEffAAvlEF6Lo8mCYXOInkxjKAq5NTYCTxXd4paXAuDjSV1oXOZkIDf fn9jA2txfZrRJYGdqoXPYiDVSwh0EV/1TJFDzIdWLWVpERXL15ZngmcPRdzD4OUa9Vmr xXlT3GjP/TPfvNPo67cep4PXW5xta7V5p3Dea3A9CsoWgzTaxdnbc/XPae0f5xGNZzbO /jt+Wt30/cJMChcr/Z2gYI2Wx4baDrmnfPbbcgndVPao0AFshaslbxuTnaXnbewb8AzI YPvVDDzNNaJFn7ceYX8HLxY+8/nq048k5wUpZrkZzpRcIFcHYdN5cMNnpY4nzSipTZQj w9tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745944336; x=1746549136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9X12hAVFdbebjHYEQDRzia04epp7Dk4I6xOhWrWV8E=; b=Z7KrzehU45UU61PN/okMOKtytTXvb79z+cQNLrCDuK0KzsGMChnAzA2v0ltpGUg9Mk AILDKNkMRi8RijHxno83vTNo3hj3r4KrnClZgXfJoW9vuUhcqCX+qtPl3p++gSATOAbT 4o6wrK+OMNK6XX0sxrJM3SmzHp5kR04JmbDWqh7aUKh5kUNbmB6Wf4bP/QfMbU8zwGSq lA0RKikhvbA8UXmeq7GtXht3Ouc1zz9M++Ldfih2tiONtgb/clSSR0k2XkqZSH9DkzbN yp3LWCsLLdKvQbhBQmmUcv5aX0WQAkZMYlcHo0io85Webicr03X7XDjm+NFvPrsqXg1a /9rg== X-Gm-Message-State: AOJu0YzqsxHgt5LK5kkkGsby4BcpySyjBVfjqag9Wxtd+P1SFY0c2zfq WJUoF+KJVHFWsXWOC1q7CAhjjMNIdPnA4tHJh9A08lnXNQ4bNXdftmyRZ87xRmNTv5W5ROafDbg Q X-Gm-Gg: ASbGnct6fgGZDI4Tch10XOkq5WCW4O9oXf3r24AG7nfiS3zvPLJneysRzHCLutvsixu bonYZqrW2kCJrq3aZJFGult32Xu137eq3nHJEj5O8rqRcm8KaTIwtacZzU59kNMt6uqAsBEVS9s jJqoHmIW2Ixz3ohSju0SPkYnCBDU1cbKK++3WhRE02v+m2UP8ZfRYMruVFJqDVm5aDgG/maeir7 G6WTO33whth6TQ/6EPyFLYnP9k3XQcQgyx8sf6gBZ9CszZTRzm7EmVO+AiQHnD7wJBOqf3qlN+z Zchkmbf1+uC+47u3ExO0TRpw9IRTpcwQjtjWsYlcybYbACo= X-Received: by 2002:a05:6000:4304:b0:39c:141a:6c67 with SMTP id ffacd0b85a97d-3a08f7a3ff1mr16922f8f.45.1745944336468; Tue, 29 Apr 2025 09:32:16 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a073ca4cbcsm14176326f8f.25.2025.04.29.09.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Apr 2025 09:32:15 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: John Snow , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 2/2] docs: Use uniquelabel in qemu-block-drivers.rst.inc Date: Tue, 29 Apr 2025 17:32:12 +0100 Message-ID: <20250429163212.618953-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250429163212.618953-1-peter.maydell@linaro.org> References: <20250429163212.618953-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use the uniquelabel directive for the 'nbd' label in qemu-block-drivers.rst.inc. This avoids a complaint from some Sphinx versions about it being a duplicate label, and means that we can reliably ensure that the link in codebase.rst goes to the document file that we intend (i.e. the section of the HTML manual on disk images, not the HTML copy of the qemu-block-drivers manpage). Signed-off-by: Peter Maydell --- docs/devel/codebase.rst | 2 +- docs/system/qemu-block-drivers.rst.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devel/codebase.rst b/docs/devel/codebase.rst index 40273e7d31e..f3f133e9adb 100644 --- a/docs/devel/codebase.rst +++ b/docs/devel/codebase.rst @@ -116,7 +116,7 @@ yet, so sometimes the source code is all you have. * `monitor `_: `Monitor ` implementation (HMP & QMP). * `nbd `_: - QEMU `NBD (Network Block Device) ` server. + QEMU `NBD (Network Block Device) ` server. * `net `_: Network (host) support. * `pc-bios `_: diff --git a/docs/system/qemu-block-drivers.rst.inc b/docs/system/qemu-block-drivers.rst.inc index cfe1acb78ae..1a405e47823 100644 --- a/docs/system/qemu-block-drivers.rst.inc +++ b/docs/system/qemu-block-drivers.rst.inc @@ -500,7 +500,7 @@ What you should *never* do: - expect it to work when loadvm'ing - write to the FAT directory on the host system while accessing it with the guest system -.. _nbd: +.. uniquelabel:: nbd NBD access ~~~~~~~~~~