Skip to content

Commit 32cfefb

Browse files
author
Markus Armbruster
committed
qapi/machine: Rename CpuS390* to S390Cpu*, 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. CpuS390Entitlement has a 'prefix' to change the generated enumeration constants' prefix from CPU_S390_ENTITLEMENT to S390_CPU_ENTITLEMENT. Rename the type to S390CpuEntitlement, so that 'prefix' is not needed. Likewise change CpuS390Polarization to S390CpuPolarization, and CpuS390State to S390CpuState. Signed-off-by: Markus Armbruster <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Reviewed-by: Zhao Liu <[email protected]> Acked-by: Thomas Huth <[email protected]> Message-ID: <[email protected]>
1 parent 154fd4d commit 32cfefb

File tree

9 files changed

+23
-26
lines changed

9 files changed

+23
-26
lines changed

hw/core/qdev-properties-system.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,12 +1188,12 @@ const PropertyInfo qdev_prop_uuid = {
11881188

11891189
/* --- s390 cpu entitlement policy --- */
11901190

1191-
QEMU_BUILD_BUG_ON(sizeof(CpuS390Entitlement) != sizeof(int));
1191+
QEMU_BUILD_BUG_ON(sizeof(S390CpuEntitlement) != sizeof(int));
11921192

11931193
const PropertyInfo qdev_prop_cpus390entitlement = {
1194-
.name = "CpuS390Entitlement",
1194+
.name = "S390CpuEntitlement",
11951195
.description = "low/medium (default)/high",
1196-
.enum_table = &CpuS390Entitlement_lookup,
1196+
.enum_table = &S390CpuEntitlement_lookup,
11971197
.get = qdev_propinfo_get_enum,
11981198
.set = qdev_propinfo_set_enum,
11991199
.set_default_value = qdev_propinfo_set_default_value_enum,

hw/s390x/cpu-topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static void s390_topology_init(MachineState *ms)
105105
*/
106106
void s390_handle_ptf(S390CPU *cpu, uint8_t r1, uintptr_t ra)
107107
{
108-
CpuS390Polarization polarization;
108+
S390CpuPolarization polarization;
109109
CPUS390XState *env = &cpu->env;
110110
uint64_t reg = env->regs[r1];
111111
int fc = reg & S390_TOPO_FC_MASK;
@@ -357,7 +357,7 @@ static void s390_change_topology(uint16_t core_id,
357357
bool has_book_id, uint16_t book_id,
358358
bool has_drawer_id, uint16_t drawer_id,
359359
bool has_entitlement,
360-
CpuS390Entitlement entitlement,
360+
S390CpuEntitlement entitlement,
361361
bool has_dedicated, bool dedicated,
362362
Error **errp)
363363
{
@@ -446,7 +446,7 @@ void qmp_set_cpu_topology(uint16_t core,
446446
bool has_socket, uint16_t socket,
447447
bool has_book, uint16_t book,
448448
bool has_drawer, uint16_t drawer,
449-
bool has_entitlement, CpuS390Entitlement entitlement,
449+
bool has_entitlement, S390CpuEntitlement entitlement,
450450
bool has_dedicated, bool dedicated,
451451
Error **errp)
452452
{

include/hw/qdev-properties-system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extern const PropertyInfo qdev_prop_iothread_vq_mapping_list;
8888

8989
#define DEFINE_PROP_CPUS390ENTITLEMENT(_n, _s, _f, _d) \
9090
DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_cpus390entitlement, \
91-
CpuS390Entitlement)
91+
S390CpuEntitlement)
9292

9393
#define DEFINE_PROP_IOTHREAD_VQ_MAPPING_LIST(_name, _state, _field) \
9494
DEFINE_PROP(_name, _state, _field, qdev_prop_iothread_vq_mapping_list, \

include/hw/s390x/cpu-topology.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ typedef struct S390TopologyEntry {
3737

3838
typedef struct S390Topology {
3939
uint8_t *cores_per_socket;
40-
CpuS390Polarization polarization;
40+
S390CpuPolarization polarization;
4141
} S390Topology;
4242

4343
typedef QTAILQ_HEAD(, S390TopologyEntry) S390TopologyList;

qapi/machine-common.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
##
1010

1111
##
12-
# @CpuS390Entitlement:
12+
# @S390CpuEntitlement:
1313
#
1414
# An enumeration of CPU entitlements that can be assumed by a virtual
1515
# S390 CPU
1616
#
1717
# Since: 8.2
1818
##
19-
{ 'enum': 'CpuS390Entitlement',
20-
'prefix': 'S390_CPU_ENTITLEMENT',
19+
{ 'enum': 'S390CpuEntitlement',
2120
'data': [ 'auto', 'low', 'medium', 'high' ] }

qapi/machine-target.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,14 @@
405405
'TARGET_RISCV' ] } }
406406

407407
##
408-
# @CpuS390Polarization:
408+
# @S390CpuPolarization:
409409
#
410410
# An enumeration of CPU polarization that can be assumed by a virtual
411411
# S390 CPU
412412
#
413413
# Since: 8.2
414414
##
415-
{ 'enum': 'CpuS390Polarization',
416-
'prefix': 'S390_CPU_POLARIZATION',
415+
{ 'enum': 'S390CpuPolarization',
417416
'data': [ 'horizontal', 'vertical' ],
418417
'if': 'TARGET_S390X'
419418
}
@@ -450,7 +449,7 @@
450449
'*socket-id': 'uint16',
451450
'*book-id': 'uint16',
452451
'*drawer-id': 'uint16',
453-
'*entitlement': 'CpuS390Entitlement',
452+
'*entitlement': 'S390CpuEntitlement',
454453
'*dedicated': 'bool'
455454
},
456455
'features': [ 'unstable' ],
@@ -488,7 +487,7 @@
488487
# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
489488
##
490489
{ 'event': 'CPU_POLARIZATION_CHANGE',
491-
'data': { 'polarization': 'CpuS390Polarization' },
490+
'data': { 'polarization': 'S390CpuPolarization' },
492491
'features': [ 'unstable' ],
493492
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
494493
}
@@ -503,7 +502,7 @@
503502
# Since: 8.2
504503
##
505504
{ 'struct': 'CpuPolarizationInfo',
506-
'data': { 'polarization': 'CpuS390Polarization' },
505+
'data': { 'polarization': 'S390CpuPolarization' },
507506
'if': { 'all': [ 'TARGET_S390X', 'CONFIG_KVM' ] }
508507
}
509508

qapi/machine.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@
4141
'x86_64', 'xtensa', 'xtensaeb' ] }
4242

4343
##
44-
# @CpuS390State:
44+
# @S390CpuState:
4545
#
4646
# An enumeration of cpu states that can be assumed by a virtual S390
4747
# CPU
4848
#
4949
# Since: 2.12
5050
##
51-
{ 'enum': 'CpuS390State',
52-
'prefix': 'S390_CPU_STATE',
51+
{ 'enum': 'S390CpuState',
5352
'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
5453

5554
##
@@ -66,9 +65,9 @@
6665
# Since: 2.12
6766
##
6867
{ 'struct': 'CpuInfoS390',
69-
'data': { 'cpu-state': 'CpuS390State',
68+
'data': { 'cpu-state': 'S390CpuState',
7069
'*dedicated': 'bool',
71-
'*entitlement': 'CpuS390Entitlement' } }
70+
'*entitlement': 'S390CpuEntitlement' } }
7271

7372
##
7473
# @CpuInfoFast:

qapi/pragma.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
'BlockdevSnapshotWrapper',
4848
'BlockdevVmdkAdapterType',
4949
'ChardevBackendKind',
50-
'CpuS390Entitlement',
51-
'CpuS390Polarization',
52-
'CpuS390State',
5350
'CxlCorErrorType',
5451
'DisplayProtocol',
5552
'DriveBackupWrapper',
@@ -74,6 +71,9 @@
7471
'QKeyCode',
7572
'RbdAuthMode',
7673
'RbdImageEncryptionFormat',
74+
'S390CpuEntitlement',
75+
'S390CpuPolarization',
76+
'S390CpuState',
7777
'String',
7878
'StringWrapper',
7979
'SysEmuTarget',

target/s390x/cpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ typedef struct CPUArchState {
133133
int32_t book_id;
134134
int32_t drawer_id;
135135
bool dedicated;
136-
CpuS390Entitlement entitlement; /* Used only for vertical polarization */
136+
S390CpuEntitlement entitlement; /* Used only for vertical polarization */
137137
uint64_t cpuid;
138138
#endif
139139

0 commit comments

Comments
 (0)