From: Michal Privoznik Date: Tue, 7 Oct 2025 07:32:47 +0000 (+0200) Subject: src: Drop needless typecast to virDomainTimerNameType X-Git-Tag: v11.9.0-rc1~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b71d327793bbd6d31c953ad33365c160899cc2b;p=thirdparty%2Flibvirt.git src: Drop needless typecast to virDomainTimerNameType This was missed in v8.10.0-rc1~229 which switched the 'name' member of _virDomainTimerDef struct from int to virDomainTimerNameType. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 9d8301169b..0cbc09b6b0 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -397,7 +397,7 @@ libxlMakeDomBuildInfo(virDomainDef *def, } for (i = 0; i < clock.ntimers; i++) { - switch ((virDomainTimerNameType) clock.timers[i]->name) { + switch (clock.timers[i]->name) { case VIR_DOMAIN_TIMER_NAME_TSC: switch (clock.timers[i]->mode) { case VIR_DOMAIN_TIMER_MODE_NATIVE: diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index a050f0ab6e..666c6cae20 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -2093,7 +2093,7 @@ xenFormatHypervisorFeatures(virConf *conf, virDomainDef *def) } for (i = 0; i < def->clock.ntimers; i++) { - switch ((virDomainTimerNameType)def->clock.timers[i]->name) { + switch (def->clock.timers[i]->name) { case VIR_DOMAIN_TIMER_NAME_TSC: switch (def->clock.timers[i]->mode) { case VIR_DOMAIN_TIMER_MODE_NATIVE: diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index f566a5468e..1c637be38b 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -335,7 +335,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDef *def, if (timer->present == VIR_TRISTATE_BOOL_NO) continue; - switch ((virDomainTimerNameType)timer->name) { + switch (timer->name) { case VIR_DOMAIN_TIMER_NAME_PLATFORM: case VIR_DOMAIN_TIMER_NAME_TSC: case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index fb7f8e0bc2..3f4c8efdcf 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1502,7 +1502,7 @@ virLXCControllerSetupTimers(virLXCController *ctrl) if (timer->present == VIR_TRISTATE_BOOL_NO) continue; - switch ((virDomainTimerNameType)timer->name) { + switch (timer->name) { case VIR_DOMAIN_TIMER_NAME_PLATFORM: case VIR_DOMAIN_TIMER_NAME_TSC: case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 08e2a5147d..f7af92fe35 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6047,7 +6047,7 @@ qemuBuildClockCommandLine(virCommand *cmd, } for (i = 0; i < def->clock.ntimers; i++) { - switch ((virDomainTimerNameType)def->clock.timers[i]->name) { + switch (def->clock.timers[i]->name) { case VIR_DOMAIN_TIMER_NAME_PLATFORM: /* qemuDomainDefValidateClockTimers will handle this * error condition */ @@ -6491,7 +6491,7 @@ qemuBuildCpuCommandLine(virCommand *cmd, for (i = 0; i < def->clock.ntimers; i++) { virDomainTimerDef *timer = def->clock.timers[i]; - switch ((virDomainTimerNameType)timer->name) { + switch (timer->name) { case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: if (timer->present != VIR_TRISTATE_BOOL_ABSENT) { /* QEMU expects on/off -> virTristateSwitch. */ @@ -7200,7 +7200,7 @@ qemuBuildMachineCommandLine(virCommand *cmd, } for (i = 0; i < def->clock.ntimers; i++) { - switch ((virDomainTimerNameType)def->clock.timers[i]->name) { + switch (def->clock.timers[i]->name) { case VIR_DOMAIN_TIMER_NAME_HPET: /* qemuBuildClockCommandLine handles the old-style config via '-no-hpet' */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_HPET) && diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 7f3ffe8bd5..8dac5c76d0 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -477,7 +477,7 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def, for (i = 0; i < def->clock.ntimers; i++) { virDomainTimerDef *timer = def->clock.timers[i]; - switch ((virDomainTimerNameType)timer->name) { + switch (timer->name) { case VIR_DOMAIN_TIMER_NAME_PLATFORM: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unsupported timer type (name) '%1$s'"),