libxl: support emulate mode of tsc timer

While at it, use members of libxl_tsc_mode enum instead of literal
int values.
This commit is contained in:
Jim Fehlig 2017-01-19 16:21:34 -07:00
parent 6e4759d069
commit 87df87e06b

View File

@ -318,13 +318,16 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
case VIR_DOMAIN_TIMER_NAME_TSC: case VIR_DOMAIN_TIMER_NAME_TSC:
switch (def->clock.timers[i]->mode) { switch (def->clock.timers[i]->mode) {
case VIR_DOMAIN_TIMER_MODE_NATIVE: case VIR_DOMAIN_TIMER_MODE_NATIVE:
b_info->tsc_mode = 2; b_info->tsc_mode = LIBXL_TSC_MODE_NATIVE;
break; break;
case VIR_DOMAIN_TIMER_MODE_PARAVIRT: case VIR_DOMAIN_TIMER_MODE_PARAVIRT:
b_info->tsc_mode = 3; b_info->tsc_mode = LIBXL_TSC_MODE_NATIVE_PARAVIRT;
break;
case VIR_DOMAIN_TIMER_MODE_EMULATE:
b_info->tsc_mode = LIBXL_TSC_MODE_ALWAYS_EMULATE;
break; break;
default: default:
b_info->tsc_mode = 1; b_info->tsc_mode = LIBXL_TSC_MODE_DEFAULT;
} }
break; break;