mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
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:
parent
86fde4d2b2
commit
21068580d6
@ -208,7 +208,7 @@ VIR_ENUM_IMPL(virDomainCapsFeature, VIR_DOMAIN_CAPS_FEATURE_LAST,
|
||||
"syslog",
|
||||
"wake_alarm")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainLifecycle, VIR_DOMAIN_LIFECYCLE_LAST,
|
||||
VIR_ENUM_IMPL(virDomainLifecycle, VIR_DOMAIN_LIFECYCLE_ACTION_LAST,
|
||||
"destroy",
|
||||
"restart",
|
||||
"rename-restart",
|
||||
@ -18593,14 +18593,14 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
if (virDomainEventActionParseXML(ctxt, "on_reboot",
|
||||
"string(./on_reboot[1])",
|
||||
&def->onReboot,
|
||||
VIR_DOMAIN_LIFECYCLE_RESTART,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_RESTART,
|
||||
virDomainLifecycleTypeFromString) < 0)
|
||||
goto error;
|
||||
|
||||
if (virDomainEventActionParseXML(ctxt, "on_poweroff",
|
||||
"string(./on_poweroff[1])",
|
||||
&def->onPoweroff,
|
||||
VIR_DOMAIN_LIFECYCLE_DESTROY,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY,
|
||||
virDomainLifecycleTypeFromString) < 0)
|
||||
goto error;
|
||||
|
||||
|
@ -1792,12 +1792,12 @@ typedef enum {
|
||||
} virDomainCapsFeature;
|
||||
|
||||
typedef enum {
|
||||
VIR_DOMAIN_LIFECYCLE_DESTROY,
|
||||
VIR_DOMAIN_LIFECYCLE_RESTART,
|
||||
VIR_DOMAIN_LIFECYCLE_RESTART_RENAME,
|
||||
VIR_DOMAIN_LIFECYCLE_PRESERVE,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_RESTART,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME,
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE,
|
||||
|
||||
VIR_DOMAIN_LIFECYCLE_LAST
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_LAST
|
||||
} virDomainLifecycleAction;
|
||||
|
||||
typedef enum {
|
||||
|
@ -98,19 +98,19 @@ static libxl_action_on_shutdown
|
||||
libxlActionFromVirLifecycle(virDomainLifecycleAction action)
|
||||
{
|
||||
switch (action) {
|
||||
case VIR_DOMAIN_LIFECYCLE_DESTROY:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
||||
return LIBXL_ACTION_ON_SHUTDOWN_DESTROY;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART:
|
||||
return LIBXL_ACTION_ON_SHUTDOWN_RESTART;
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_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;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
||||
return LIBXL_ACTION_ON_SHUTDOWN_PRESERVE;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_LAST:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -468,13 +468,13 @@ libxlDomainShutdownThread(void *opaque)
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
|
||||
switch ((virDomainLifecycleAction) vm->def->onPoweroff) {
|
||||
case VIR_DOMAIN_LIFECYCLE_DESTROY:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
||||
goto destroy;
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART:
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
||||
goto restart;
|
||||
case VIR_DOMAIN_LIFECYCLE_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_LAST:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
||||
goto endjob;
|
||||
}
|
||||
} else if (xl_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
|
||||
@ -508,13 +508,13 @@ libxlDomainShutdownThread(void *opaque)
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
|
||||
switch ((virDomainLifecycleAction) vm->def->onReboot) {
|
||||
case VIR_DOMAIN_LIFECYCLE_DESTROY:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
||||
goto destroy;
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART:
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
||||
goto restart;
|
||||
case VIR_DOMAIN_LIFECYCLE_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_LAST:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
||||
goto endjob;
|
||||
}
|
||||
} else {
|
||||
|
@ -1015,9 +1015,9 @@ lxcParseConfigString(const char *config,
|
||||
vmdef->id = -1;
|
||||
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->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
vmdef->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
vmdef->virtType = VIR_DOMAIN_VIRT_LXC;
|
||||
|
||||
/* Value not handled by the LXC driver, setting to
|
||||
|
@ -6519,8 +6519,8 @@ qemuBuildPMCommandLine(virCommandPtr cmd,
|
||||
bool allowReboot = true;
|
||||
|
||||
/* Only add -no-reboot option if each event destroys domain */
|
||||
if (def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY &&
|
||||
def->onPoweroff == VIR_DOMAIN_LIFECYCLE_DESTROY &&
|
||||
if (def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY &&
|
||||
def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY &&
|
||||
(def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY ||
|
||||
def->onCrash == VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY)) {
|
||||
allowReboot = false;
|
||||
|
@ -1981,8 +1981,8 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
if (vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_RESTART ||
|
||||
vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_RESTART_RENAME) {
|
||||
if (vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART ||
|
||||
vm->def->onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME) {
|
||||
isReboot = true;
|
||||
agentFlag = QEMU_AGENT_SHUTDOWN_REBOOT;
|
||||
VIR_INFO("Domain on_poweroff setting overridden, attempting reboot");
|
||||
@ -2076,8 +2076,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY ||
|
||||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_PRESERVE) {
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
||||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
|
||||
agentFlag = QEMU_AGENT_SHUTDOWN_POWERDOWN;
|
||||
isReboot = false;
|
||||
VIR_INFO("Domain on_reboot setting overridden, shutting down");
|
||||
|
@ -1886,9 +1886,9 @@ qemuParseCommandLine(virCapsPtr caps,
|
||||
goto error;
|
||||
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->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
def->virtType = VIR_DOMAIN_VIRT_QEMU;
|
||||
if (VIR_STRDUP(def->emulator, progargv[0]) < 0)
|
||||
goto error;
|
||||
@ -2195,7 +2195,7 @@ qemuParseCommandLine(virCapsPtr caps,
|
||||
} else if (STREQ(arg, "-no-acpi")) {
|
||||
def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ABSENT;
|
||||
} 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")) {
|
||||
def->virtType = VIR_DOMAIN_VIRT_QEMU;
|
||||
} else if (STREQ(arg, "-enable-kvm")) {
|
||||
|
@ -496,8 +496,8 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_DESTROY ||
|
||||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_PRESERVE) {
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
||||
vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
@ -1920,22 +1920,22 @@ static int testDomainReboot(virDomainPtr domain,
|
||||
VIR_DOMAIN_SHUTDOWN_USER);
|
||||
|
||||
switch (privdom->def->onReboot) {
|
||||
case VIR_DOMAIN_LIFECYCLE_DESTROY:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF,
|
||||
VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_BOOTED);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_PRESERVE:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_SHUTOFF,
|
||||
VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_LIFECYCLE_RESTART_RENAME:
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_BOOTED);
|
||||
break;
|
||||
|
@ -1578,8 +1578,8 @@ virVMXParseConfig(virVMXContext *ctx,
|
||||
}
|
||||
|
||||
/* def:lifecycle */
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
|
||||
|
||||
/* def:os */
|
||||
|
@ -1887,8 +1887,8 @@ prlsdkLoadDomain(vzDriverPtr driver,
|
||||
|
||||
def->virtType = VIR_DOMAIN_VIRT_VZ;
|
||||
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
def->onCrash = VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY;
|
||||
|
||||
/* get RAM parameters */
|
||||
@ -2591,8 +2591,8 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->onReboot != VIR_DOMAIN_LIFECYCLE_RESTART ||
|
||||
def->onPoweroff != VIR_DOMAIN_LIFECYCLE_DESTROY ||
|
||||
if (def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_RESTART ||
|
||||
def->onPoweroff != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
||||
def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) {
|
||||
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
|
@ -131,9 +131,9 @@ enum xen_on_normal_exit
|
||||
actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action)
|
||||
{
|
||||
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;
|
||||
else if (action == VIR_DOMAIN_LIFECYCLE_RESTART)
|
||||
else if (action == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART)
|
||||
num = XEN_ON_NORMAL_EXIT_RESTART;
|
||||
return num;
|
||||
}
|
||||
@ -201,11 +201,11 @@ map2LibvirtBootOrder(char c)
|
||||
virDomainLifecycleAction
|
||||
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)
|
||||
num = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
num = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
else if (action == XEN_ON_NORMAL_EXIT_RESTART)
|
||||
num = VIR_DOMAIN_LIFECYCLE_RESTART;
|
||||
num = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
|
||||
return num;
|
||||
}
|
||||
|
||||
|
@ -1246,7 +1246,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
|
||||
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY;
|
||||
}
|
||||
|
||||
tmp = sexpr_node(root, "domain/on_reboot");
|
||||
@ -1257,7 +1257,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART;
|
||||
def->onReboot = VIR_DOMAIN_LIFECYCLE_ACTION_RESTART;
|
||||
}
|
||||
|
||||
tmp = sexpr_node(root, "domain/on_crash");
|
||||
|
Loading…
x
Reference in New Issue
Block a user