diff options
author | Markus Armbruster <armbru@redhat.com> | 2024-09-04 13:18:36 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2024-09-10 14:03:45 +0200 |
commit | 64f5e9db7706c8f4a7d7b521596caae9a1106337 (patch) | |
tree | e19a9828129489d052072ce771cd631067cb18bf | |
parent | b1019999e86ca816eb1754ff8b907a61ae294969 (diff) | |
download | qemu-64f5e9db7706c8f4a7d7b521596caae9a1106337.zip qemu-64f5e9db7706c8f4a7d7b521596caae9a1106337.tar.gz qemu-64f5e9db7706c8f4a7d7b521596caae9a1106337.tar.bz2 |
qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefix
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>
Message-ID: <20240904111836.3273842-20-armbru@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r-- | hw/vfio/migration.c | 2 | ||||
-rw-r--r-- | qapi/vfio.json | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 262d42a..17199b7 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) { diff --git a/qapi/vfio.json b/qapi/vfio.json index eccca82..b53b7ca 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' } } |