[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/19] qapi/vfio: Rename VfioMigrationState to Qapi*, and drop
From: |
Markus Armbruster |
Subject: |
[PATCH v2 19/19] qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefix |
Date: |
Wed, 4 Sep 2024 13:18:36 +0200 |
QAPI's 'prefix' feature can make the connection between enumeration
type and its constants less than obvious. It's best used with
restraint.
VfioMigrationState has a 'prefix' that overrides the generated
enumeration constants' prefix to QAPI_VFIO_MIGRATION_STATE.
We could simply drop 'prefix', but then the enumeration constants
would look as if they came from kernel header linux/vfio.h.
Rename the type to QapiVfioMigrationState instead, so that 'prefix' is
not needed.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
qapi/vfio.json | 9 ++++-----
hw/vfio/migration.c | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/qapi/vfio.json b/qapi/vfio.json
index eccca82068..b53b7caecd 100644
--- a/qapi/vfio.json
+++ b/qapi/vfio.json
@@ -7,7 +7,7 @@
##
##
-# @VfioMigrationState:
+# @QapiVfioMigrationState:
#
# An enumeration of the VFIO device migration states.
#
@@ -32,10 +32,9 @@
#
# Since: 9.1
##
-{ 'enum': 'VfioMigrationState',
+{ 'enum': 'QapiVfioMigrationState',
'data': [ 'stop', 'running', 'stop-copy', 'resuming', 'running-p2p',
- 'pre-copy', 'pre-copy-p2p' ],
- 'prefix': 'QAPI_VFIO_MIGRATION_STATE' }
+ 'pre-copy', 'pre-copy-p2p' ] }
##
# @VFIO_MIGRATION:
@@ -63,5 +62,5 @@
'data': {
'device-id': 'str',
'qom-path': 'str',
- 'device-state': 'VfioMigrationState'
+ 'device-state': 'QapiVfioMigrationState'
} }
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 262d42a46e..17199b73ae 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -81,7 +81,7 @@ static const char *mig_state_to_str(enum
vfio_device_mig_state state)
}
}
-static VfioMigrationState
+static QapiVfioMigrationState
mig_state_to_qapi_state(enum vfio_device_mig_state state)
{
switch (state) {
--
2.46.0
- [PATCH v2 00/19] qapi: Reduce use of 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 02/19] tests/qapi-schema: Drop temporary 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 10/19] qapi/crypto: Drop unwanted 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 19/19] qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefix,
Markus Armbruster <=
- [PATCH v2 13/19] qapi/crypto: Rename QCryptoIVGenAlgorithm to *Algo, and drop prefix, Markus Armbruster, 2024/09/04
- [PATCH v2 18/19] qapi/cryptodev: Rename QCryptodevBackendAlgType to *Algo, and drop prefix, Markus Armbruster, 2024/09/04
- [PATCH v2 14/19] qapi/crypto: Rename QCryptoAkCipherAlgorithm to *Algo, and drop prefix, Markus Armbruster, 2024/09/04
- [PATCH v2 15/19] qapi/crypto: Rename QCryptoRSAPaddingAlgorithm to *Algo, and drop prefix, Markus Armbruster, 2024/09/04
- [PATCH v2 09/19] qapi/machine: Rename CpuS390* to S390Cpu*, and drop 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 06/19] qapi/ebpf: Drop temporary 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 05/19] qapi/crypto: Drop temporary 'prefix', Markus Armbruster, 2024/09/04
- [PATCH v2 03/19] qapi/block-core: Drop temporary 'prefix', Markus Armbruster, 2024/09/04