``preserve``
The domain will be terminated and its resource preserved to allow analysis.
``rename-restart``
- The domain will be terminated and then restarted with a new name.
+ The domain will be terminated and then restarted with a new name. (Only
+ supported by the libxl hypervisor driver.)
QEMU/KVM supports the ``on_poweroff`` and ``on_reboot`` events handling the
``destroy`` and ``restart`` actions. The ``preserve`` action for an
-``on_reboot`` event is treated as a ``destroy`` and the ``rename-restart``
-action for an ``on_poweroff`` event is treated as a ``restart`` event.
+``on_reboot`` event is treated as a ``destroy``.
The ``on_crash`` event supports these additional actions :since:`since 0.8.4` .
return 0;
}
+
+int
+qemuValidateLifecycleAction(virDomainLifecycleAction onPoweroff,
+ virDomainLifecycleAction onReboot,
+ virDomainLifecycleAction onCrash)
+{
+ /* The qemu driver doesn't yet implement any meaningful handling for
+ * VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME */
+ if (onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME ||
+ onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME ||
+ onCrash == VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("qemu driver doesn't support the 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int
+qemuValidateDomainLifecycleAction(const virDomainDef *def)
+{
+ return qemuValidateLifecycleAction(def->onPoweroff,
+ def->onReboot,
+ def->onCrash);
+}
+
+
int
qemuValidateDomainDef(const virDomainDef *def,
void *opaque,
}
}
+ if (qemuValidateDomainLifecycleAction(def) < 0)
+ return -1;
+
if (qemuValidateDomainDefCpu(driver, def, qemuCaps) < 0)
return -1;
const virDomainDef *def,
void *opaque,
void *parseOpaque);
+
+int
+qemuValidateLifecycleAction(virDomainLifecycleAction onPoweroff,
+ virDomainLifecycleAction onReboot,
+ virDomainLifecycleAction onCrash);