*
* If @flags is set to zero, then the hypervisor will choose the
* method of shutdown it considers best. To have greater control
- * pass exactly one of the virDomainShutdownFlagValues.
+ * pass one or more of the virDomainShutdownFlagValues. The order
+ * in which the hypervisor tries each shutdown method is undefined,
+ * and a hypervisor is not required to support all methods.
*
* Returns 0 in case of success and -1 in case of failure.
*/
goto error;
}
- /* At most one of these two flags should be set. */
- if ((flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) &&
- (flags & VIR_DOMAIN_SHUTDOWN_GUEST_AGENT)) {
- virReportInvalidArg(flags, "%s",
- _("flags for acpi power button and guest agent are mutually exclusive"));
- goto error;
- }
-
conn = domain->conn;
if (conn->driver->domainShutdownFlags) {
*
* If @flags is set to zero, then the hypervisor will choose the
* method of shutdown it considers best. To have greater control
- * pass exactly one of the virDomainRebootFlagValues.
+ * pass one or more of the virDomainShutdownFlagValues. The order
+ * in which the hypervisor tries each shutdown method is undefined,
+ * and a hypervisor is not required to support all methods.
*
* To use guest agent (VIR_DOMAIN_REBOOT_GUEST_AGENT) the domain XML
* must have <channel> configured.
goto error;
}
- /* At most one of these two flags should be set. */
- if ((flags & VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) &&
- (flags & VIR_DOMAIN_REBOOT_GUEST_AGENT)) {
- virReportInvalidArg(flags, "%s",
- _("flags for acpi power button and guest agent are mutually exclusive"));
- goto error;
- }
-
conn = domain->conn;
if (conn->driver->domainReboot) {
virCheckFlags(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN |
VIR_DOMAIN_SHUTDOWN_GUEST_AGENT, -1);
+ /* At most one of these two flags should be set. */
+ if ((flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) &&
+ (flags & VIR_DOMAIN_SHUTDOWN_GUEST_AGENT)) {
+ virReportInvalidArg(flags, "%s",
+ _("flags for acpi power button and guest agent are mutually exclusive"));
+ return -1;
+ }
+
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
qemuDriverUnlock(driver);
virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN |
VIR_DOMAIN_REBOOT_GUEST_AGENT , -1);
+ /* At most one of these two flags should be set. */
+ if ((flags & VIR_DOMAIN_REBOOT_ACPI_POWER_BTN) &&
+ (flags & VIR_DOMAIN_REBOOT_GUEST_AGENT)) {
+ virReportInvalidArg(flags, "%s",
+ _("flags for acpi power button and guest agent are mutually exclusive"));
+ return -1;
+ }
+
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
qemuDriverUnlock(driver);