conf: rename lifecycle enum values to correspond with typedef keyword

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-10-10 14:32:11 +02:00
parent 86fde4d2b2
commit 21068580d6
14 changed files with 54 additions and 54 deletions

View File

@ -208,7 +208,7 @@ VIR_ENUM_IMPL(virDomainCapsFeature, VIR_DOMAIN_CAPS_FEATURE_LAST,
"syslog", "syslog",
"wake_alarm") "wake_alarm")
VIR_ENUM_IMPL(virDomainLifecycle, VIR_DOMAIN_LIFECYCLE_LAST, VIR_ENUM_IMPL(virDomainLifecycle, VIR_DOMAIN_LIFECYCLE_ACTION_LAST,
"destroy", "destroy",
"restart", "restart",
"rename-restart", "rename-restart",
@ -18593,14 +18593,14 @@ virDomainDefParseXML(xmlDocPtr xml,
if (virDomainEventActionParseXML(ctxt, "on_reboot", if (virDomainEventActionParseXML(ctxt, "on_reboot",
"string(./on_reboot[1])", "string(./on_reboot[1])",
&def->onReboot, &def->onReboot,
VIR_DOMAIN_LIFECYCLE_RESTART, VIR_DOMAIN_LIFECYCLE_ACTION_RESTART,
virDomainLifecycleTypeFromString) < 0) virDomainLifecycleTypeFromString) < 0)
goto error; goto error;
if (virDomainEventActionParseXML(ctxt, "on_poweroff", if (virDomainEventActionParseXML(ctxt, "on_poweroff",
"string(./on_poweroff[1])", "string(./on_poweroff[1])",
&def->onPoweroff, &def->onPoweroff,
VIR_DOMAIN_LIFECYCLE_DESTROY, VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY,
virDomainLifecycleTypeFromString) < 0) virDomainLifecycleTypeFromString) < 0)
goto error; goto error;

View File

@ -1792,12 +1792,12 @@ typedef enum {
} virDomainCapsFeature; } virDomainCapsFeature;
typedef enum { typedef enum {
VIR_DOMAIN_LIFECYCLE_DESTROY, VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY,
VIR_DOMAIN_LIFECYCLE_RESTART, VIR_DOMAIN_LIFECYCLE_ACTION_RESTART,
VIR_DOMAIN_LIFECYCLE_RESTART_RENAME, VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME,
VIR_DOMAIN_LIFECYCLE_PRESERVE, VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE,
VIR_DOMAIN_LIFECYCLE_LAST VIR_DOMAIN_LIFECYCLE_ACTION_LAST
} virDomainLifecycleAction; } virDomainLifecycleAction;
typedef enum { typedef enum {

View File

@ -98,19 +98,19 @@ static libxl_action_on_shutdown
libxlActionFromVirLifecycle(virDomainLifecycleAction action) libxlActionFromVirLifecycle(virDomainLifecycleAction action)
{ {
switch (action) { switch (action) {
case VIR_DOMAIN_LIFECYCLE_DESTROY: case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
return LIBXL_ACTION_ON_SHUTDOWN_DESTROY; return LIBXL_ACTION_ON_SHUTDOWN_DESTROY;
case VIR_DOMAIN_LIFECYCLE_RESTART: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
return LIBXL_ACTION_ON_SHUTDOWN_RESTART; return LIBXL_ACTION_ON_SHUTDOWN_RESTART;
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
return LIBXL_ACTION_ON_SHUTDOWN_RESTART_RENAME; return LIBXL_ACTION_ON_SHUTDOWN_RESTART_RENAME;
case VIR_DOMAIN_LIFECYCLE_PRESERVE: case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
return LIBXL_ACTION_ON_SHUTDOWN_PRESERVE; return LIBXL_ACTION_ON_SHUTDOWN_PRESERVE;
case VIR_DOMAIN_LIFECYCLE_LAST: case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
break; break;
} }

View File

@ -468,13 +468,13 @@ libxlDomainShutdownThread(void *opaque)
VIR_DOMAIN_EVENT_STOPPED, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN); VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
switch ((virDomainLifecycleAction) vm->def->onPoweroff) { switch ((virDomainLifecycleAction) vm->def->onPoweroff) {
case VIR_DOMAIN_LIFECYCLE_DESTROY: case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
goto destroy; goto destroy;
case VIR_DOMAIN_LIFECYCLE_RESTART: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
goto restart; goto restart;
case VIR_DOMAIN_LIFECYCLE_PRESERVE: case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
case VIR_DOMAIN_LIFECYCLE_LAST: case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
goto endjob; goto endjob;
} }
} else if (xl_reason == LIBXL_SHUTDOWN_REASON_CRASH) { } else if (xl_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
@ -508,13 +508,13 @@ libxlDomainShutdownThread(void *opaque)
VIR_DOMAIN_EVENT_STOPPED, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN); VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
switch ((virDomainLifecycleAction) vm->def->onReboot) { switch ((virDomainLifecycleAction) vm->def->onReboot) {
case VIR_DOMAIN_LIFECYCLE_DESTROY: case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
goto destroy; goto destroy;
case VIR_DOMAIN_LIFECYCLE_RESTART: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
goto restart; goto restart;
case VIR_DOMAIN_LIFECYCLE_PRESERVE: case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
case VIR_DOMAIN_LIFECYCLE_LAST: case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
goto endjob; goto endjob;
} }
} else { } else {

View File

@ -1015,9 +1015,9 @@ lxcParseConfigString(const char *config,
vmdef->id = -1; vmdef->id = -1;
virDomainDefSetMemoryTotal(vmdef, 64 * 1024); virDomainDefSetMemoryTotal(vmdef, 64 * 1024);
vmdef->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; vmdef->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
vmdef->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY; vmdef->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
vmdef->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; vmdef->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
vmdef->virtType = VIR_DOMAIN_VIRT_LXC; vmdef->virtType = VIR_DOMAIN_VIRT_LXC;
/* Value not handled by the LXC driver, setting to /* Value not handled by the LXC driver, setting to

View File

@ -6519,8 +6519,8 @@ qemuBuildPMCommandLine(virCommandPtr cmd,
bool allowReboot = true; bool allowReboot = true;
/* Only add -no-reboot option if each event destroys domain */ /* Only add -no-reboot option if each event destroys domain */
if (def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY && if (def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY &&
def->onPoweroff == VIR_DOMAIN_LIFECYCLE_DESTROY && def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY &&
(def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY || (def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY ||
def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY)) { def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY)) {
allowReboot = false; allowReboot = false;

View File

@ -1981,8 +1981,8 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
if (!(vm = qemuDomObjFromDomain(dom))) if (!(vm = qemuDomObjFromDomain(dom)))
goto cleanup; goto cleanup;
if (vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_RESTART || if (vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART ||
vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_RESTART_RENAME) { vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME) {
isReboot = true; isReboot = true;
agentFlag = QEMU_AGENT_SHUTDOWN_REBOOT; agentFlag = QEMU_AGENT_SHUTDOWN_REBOOT;
VIR_INFO("Domain on_poweroff setting overridden, attempting reboot"); VIR_INFO("Domain on_poweroff setting overridden, attempting reboot");
@ -2076,8 +2076,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
if (!(vm = qemuDomObjFromDomain(dom))) if (!(vm = qemuDomObjFromDomain(dom)))
goto cleanup; goto cleanup;
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY || if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_PRESERVE) { vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
agentFlag = QEMU_AGENT_SHUTDOWN_POWERDOWN; agentFlag = QEMU_AGENT_SHUTDOWN_POWERDOWN;
isReboot = false; isReboot = false;
VIR_INFO("Domain on_reboot setting overridden, shutting down"); VIR_INFO("Domain on_reboot setting overridden, shutting down");

View File

@ -1886,9 +1886,9 @@ qemuParseCommandLine(virCapsPtr caps,
goto error; goto error;
def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC; def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC;
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY; def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
def->virtType = VIR_DOMAIN_VIRT_QEMU; def->virtType = VIR_DOMAIN_VIRT_QEMU;
if (VIR_STRDUP(def->emulator, progargv[0]) < 0) if (VIR_STRDUP(def->emulator, progargv[0]) < 0)
goto error; goto error;
@ -2195,7 +2195,7 @@ qemuParseCommandLine(virCapsPtr caps,
} else if (STREQ(arg, "-no-acpi")) { } else if (STREQ(arg, "-no-acpi")) {
def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ABSENT; def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ABSENT;
} else if (STREQ(arg, "-no-reboot")) { } else if (STREQ(arg, "-no-reboot")) {
def->onReboot = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
} else if (STREQ(arg, "-no-kvm")) { } else if (STREQ(arg, "-no-kvm")) {
def->virtType = VIR_DOMAIN_VIRT_QEMU; def->virtType = VIR_DOMAIN_VIRT_QEMU;
} else if (STREQ(arg, "-enable-kvm")) { } else if (STREQ(arg, "-enable-kvm")) {

View File

@ -496,8 +496,8 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
VIR_WARN("Failed to save status on vm %s", vm->def->name); VIR_WARN("Failed to save status on vm %s", vm->def->name);
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY || if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_PRESERVE) { vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;

View File

@ -1920,22 +1920,22 @@ static int testDomainReboot(virDomainPtr domain,
VIR_DOMAIN_SHUTDOWN_USER); VIR_DOMAIN_SHUTDOWN_USER);
switch (privdom->def->onReboot) { switch (privdom->def->onReboot) {
case VIR_DOMAIN_LIFECYCLE_DESTROY: case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF, virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF,
VIR_DOMAIN_SHUTOFF_SHUTDOWN); VIR_DOMAIN_SHUTOFF_SHUTDOWN);
break; break;
case VIR_DOMAIN_LIFECYCLE_RESTART: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING, virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
VIR_DOMAIN_RUNNING_BOOTED); VIR_DOMAIN_RUNNING_BOOTED);
break; break;
case VIR_DOMAIN_LIFECYCLE_PRESERVE: case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF, virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF,
VIR_DOMAIN_SHUTOFF_SHUTDOWN); VIR_DOMAIN_SHUTOFF_SHUTDOWN);
break; break;
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME: case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING, virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
VIR_DOMAIN_RUNNING_BOOTED); VIR_DOMAIN_RUNNING_BOOTED);
break; break;

View File

@ -1578,8 +1578,8 @@ virVMXParseConfig(virVMXContext *ctx,
} }
/* def:lifecycle */ /* def:lifecycle */
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY; def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
/* def:os */ /* def:os */

View File

@ -1887,8 +1887,8 @@ prlsdkLoadDomain(vzDriverPtr driver,
def->virtType = VIR_DOMAIN_VIRT_VZ; def->virtType = VIR_DOMAIN_VIRT_VZ;
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY; def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
/* get RAM parameters */ /* get RAM parameters */
@ -2591,8 +2591,8 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
return -1; return -1;
} }
if (def->onReboot != VIR_DOMAIN_LIFECYCLE_RESTART || if (def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_RESTART ||
def->onPoweroff != VIR_DOMAIN_LIFECYCLE_DESTROY || def->onPoweroff != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) { def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",

View File

@ -131,9 +131,9 @@ enum xen_on_normal_exit
actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action) actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action)
{ {
enum xen_on_normal_exit num = XEN_ON_NORMAL_EXIT_RESTART; enum xen_on_normal_exit num = XEN_ON_NORMAL_EXIT_RESTART;
if (action == VIR_DOMAIN_LIFECYCLE_DESTROY) if (action == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY)
num = XEN_ON_NORMAL_EXIT_DESTROY; num = XEN_ON_NORMAL_EXIT_DESTROY;
else if (action == VIR_DOMAIN_LIFECYCLE_RESTART) else if (action == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART)
num = XEN_ON_NORMAL_EXIT_RESTART; num = XEN_ON_NORMAL_EXIT_RESTART;
return num; return num;
} }
@ -201,11 +201,11 @@ map2LibvirtBootOrder(char c)
virDomainLifecycleAction virDomainLifecycleAction
xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action) xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action)
{ {
virDomainLifecycleAction num = VIR_DOMAIN_LIFECYCLE_RESTART; virDomainLifecycleAction num = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
if (action == XEN_ON_NORMAL_EXIT_DESTROY) if (action == XEN_ON_NORMAL_EXIT_DESTROY)
num = VIR_DOMAIN_LIFECYCLE_DESTROY; num = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
else if (action == XEN_ON_NORMAL_EXIT_RESTART) else if (action == XEN_ON_NORMAL_EXIT_RESTART)
num = VIR_DOMAIN_LIFECYCLE_RESTART; num = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
return num; return num;
} }

View File

@ -1246,7 +1246,7 @@ xenParseSxpr(const struct sexpr *root,
goto error; goto error;
} }
} else { } else {
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY; def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
} }
tmp = sexpr_node(root, "domain/on_reboot"); tmp = sexpr_node(root, "domain/on_reboot");
@ -1257,7 +1257,7 @@ xenParseSxpr(const struct sexpr *root,
goto error; goto error;
} }
} else { } else {
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART; def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
} }
tmp = sexpr_node(root, "domain/on_crash"); tmp = sexpr_node(root, "domain/on_crash");