From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, "Cédric Le Goater" <clg@redhat.com>
Subject: [PULL 04/19] qapi/common: Drop temporary 'prefix'
Date: Tue, 10 Sep 2024 18:46:59 +0200 [thread overview]
Message-ID: <20240910164714.1993531-5-armbru@redhat.com> (raw)
In-Reply-To: <20240910164714.1993531-1-armbru@redhat.com>
Recent commit "qapi: Smarter camel_to_upper() to reduce need for
'prefix'" added a temporary 'prefix' to delay changing the generated
code.
Revert it. This improves OffAutoPCIBAR's generated enumeration
constant prefix from OFF_AUTOPCIBAR to OFF_AUTO_PCIBAR.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-ID: <20240904111836.3273842-5-armbru@redhat.com>
---
qapi/common.json | 1 -
hw/vfio/pci.c | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/qapi/common.json b/qapi/common.json
index 25726d3113..7558ce5430 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -92,7 +92,6 @@
# Since: 2.12
##
{ 'enum': 'OffAutoPCIBAR',
- 'prefix': 'OFF_AUTOPCIBAR', # TODO drop
'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] }
##
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2407720c35..0a99e55247 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1452,7 +1452,7 @@ static bool vfio_pci_relocate_msix(VFIOPCIDevice *vdev, Error **errp)
int target_bar = -1;
size_t msix_sz;
- if (!vdev->msix || vdev->msix_relo == OFF_AUTOPCIBAR_OFF) {
+ if (!vdev->msix || vdev->msix_relo == OFF_AUTO_PCIBAR_OFF) {
return true;
}
@@ -1464,7 +1464,7 @@ static bool vfio_pci_relocate_msix(VFIOPCIDevice *vdev, Error **errp)
/* PCI BARs must be a power of 2 */
msix_sz = pow2ceil(msix_sz);
- if (vdev->msix_relo == OFF_AUTOPCIBAR_AUTO) {
+ if (vdev->msix_relo == OFF_AUTO_PCIBAR_AUTO) {
/*
* TODO: Lookup table for known devices.
*
@@ -1479,7 +1479,7 @@ static bool vfio_pci_relocate_msix(VFIOPCIDevice *vdev, Error **errp)
return false;
}
} else {
- target_bar = (int)(vdev->msix_relo - OFF_AUTOPCIBAR_BAR0);
+ target_bar = (int)(vdev->msix_relo - OFF_AUTO_PCIBAR_BAR0);
}
/* I/O port BARs cannot host MSI-X structures */
@@ -1624,7 +1624,7 @@ static bool vfio_msix_early_setup(VFIOPCIDevice *vdev, Error **errp)
} else if (vfio_pci_is(vdev, PCI_VENDOR_ID_BAIDU,
PCI_DEVICE_ID_KUNLUN_VF)) {
msix->pba_offset = 0xb400;
- } else if (vdev->msix_relo == OFF_AUTOPCIBAR_OFF) {
+ } else if (vdev->msix_relo == OFF_AUTO_PCIBAR_OFF) {
error_setg(errp, "hardware reports invalid configuration, "
"MSIX PBA outside of specified BAR");
g_free(msix);
@@ -3403,7 +3403,7 @@ static Property vfio_pci_dev_properties[] = {
nv_gpudirect_clique,
qdev_prop_nv_gpudirect_clique, uint8_t),
DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_relo,
- OFF_AUTOPCIBAR_OFF),
+ OFF_AUTO_PCIBAR_OFF),
#ifdef CONFIG_IOMMUFD
DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd,
TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *),
--
2.46.0
next prev parent reply other threads:[~2024-09-10 16:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 16:46 [PULL 00/19] QAPI patches patches for 2024-09-10 Markus Armbruster
2024-09-10 16:46 ` [PULL 01/19] qapi: Smarter camel_to_upper() to reduce need for 'prefix' Markus Armbruster
2024-09-10 16:46 ` [PULL 02/19] tests/qapi-schema: Drop temporary 'prefix' Markus Armbruster
2024-09-10 16:46 ` [PULL 03/19] qapi/block-core: " Markus Armbruster
2024-09-10 16:46 ` Markus Armbruster [this message]
2024-09-10 16:47 ` [PULL 05/19] qapi/crypto: " Markus Armbruster
2024-09-10 16:47 ` [PULL 06/19] qapi/ebpf: " Markus Armbruster
2024-09-10 16:47 ` [PULL 07/19] qapi/machine: " Markus Armbruster
2024-09-10 16:47 ` [PULL 08/19] qapi/ui: " Markus Armbruster
2024-09-10 16:47 ` [PULL 09/19] qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix' Markus Armbruster
2024-09-10 16:47 ` [PULL 10/19] qapi/crypto: Drop unwanted 'prefix' Markus Armbruster
2024-09-10 16:47 ` [PULL 11/19] qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix Markus Armbruster
2024-09-10 16:47 ` [PULL 12/19] qapi/crypto: Rename QCryptoCipherAlgorithm " Markus Armbruster
2024-09-10 16:47 ` [PULL 13/19] qapi/crypto: Rename QCryptoIVGenAlgorithm " Markus Armbruster
2024-09-10 16:47 ` [PULL 14/19] qapi/crypto: Rename QCryptoAkCipherAlgorithm " Markus Armbruster
2024-09-10 16:47 ` [PULL 15/19] qapi/crypto: Rename QCryptoRSAPaddingAlgorithm " Markus Armbruster
2024-09-10 16:47 ` [PULL 16/19] qapi/crypto: Rename QCryptoAFAlg to QCryptoAFAlgo Markus Armbruster
2024-09-10 16:47 ` [PULL 17/19] qapi/cryptodev: Drop unwanted 'prefix' Markus Armbruster
2024-09-10 16:47 ` [PULL 18/19] qapi/cryptodev: Rename QCryptodevBackendAlgType to *Algo, and drop prefix Markus Armbruster
2024-09-10 16:47 ` [PULL 19/19] qapi/vfio: Rename VfioMigrationState to Qapi*, " Markus Armbruster
2024-09-11 12:17 ` [PULL 00/19] QAPI patches patches for 2024-09-10 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240910164714.1993531-5-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=clg@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).