qemu: Move some enums impl to qemu_monitor.c

There are some enums that are declared in qemu_monitor.h but
implemented in qemu_monitor_json.c. While from compiler and
linker POV it doesn't matter, the code is cleaner if an enum is
implemented in .c file that corresponds to .h file which declared
the enum.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Michal Privoznik 2022-02-21 15:59:18 +01:00
parent 54814c87f3
commit ee5c273ec5
2 changed files with 40 additions and 34 deletions

View File

@ -111,6 +111,38 @@ static int qemuMonitorOnceInit(void)
VIR_ONCE_GLOBAL_INIT(qemuMonitor);
VIR_ENUM_IMPL(qemuMonitorJob,
QEMU_MONITOR_JOB_TYPE_LAST,
"",
"commit",
"stream",
"mirror",
"backup",
"create",
);
VIR_ENUM_IMPL(qemuMonitorJobStatus,
QEMU_MONITOR_JOB_STATUS_LAST,
"",
"created",
"running",
"paused",
"ready",
"standby",
"waiting",
"pending",
"aborting",
"concluded",
"undefined",
"null",
);
VIR_ENUM_IMPL(qemuMonitorCPUProperty,
QEMU_MONITOR_CPU_PROPERTY_LAST,
"boolean",
"string",
"number",
);
VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
QEMU_MONITOR_MIGRATION_STATUS_LAST,
@ -4473,6 +4505,14 @@ qemuMonitorTransactionBackup(virJSONValue *actions,
}
VIR_ENUM_IMPL(qemuMonitorDirtyRateCalcMode,
QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST,
"page-sampling",
"dirty-bitmap",
"dirty-ring",
);
int
qemuMonitorStartDirtyRateCalc(qemuMonitor *mon,
int seconds,

View File

@ -53,30 +53,6 @@ VIR_LOG_INIT("qemu.qemu_monitor_json");
#define LINE_ENDING "\r\n"
VIR_ENUM_IMPL(qemuMonitorJob,
QEMU_MONITOR_JOB_TYPE_LAST,
"",
"commit",
"stream",
"mirror",
"backup",
"create");
VIR_ENUM_IMPL(qemuMonitorJobStatus,
QEMU_MONITOR_JOB_STATUS_LAST,
"",
"created",
"running",
"paused",
"ready",
"standby",
"waiting",
"pending",
"aborting",
"concluded",
"undefined",
"null");
static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleStop(qemuMonitor *mon, virJSONValue *data);
@ -5347,11 +5323,6 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon,
}
VIR_ENUM_IMPL(qemuMonitorCPUProperty,
QEMU_MONITOR_CPU_PROPERTY_LAST,
"boolean", "string", "number",
);
static int
qemuMonitorJSONParseCPUModelProperty(const char *key,
virJSONValue *value,
@ -8740,11 +8711,6 @@ qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon,
migratable);
}
VIR_ENUM_IMPL(qemuMonitorDirtyRateCalcMode,
QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST,
"page-sampling",
"dirty-bitmap",
"dirty-ring");
int
qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon,