command run from the console. The command returns as soon as it has
executed the reboot action, which may be significantly before the
domain actually reboots.
-It requires PV drivers installed in your guest OS.
+
+For HVM domains this requires PV drivers to be installed in your guest
+OS. If PV drivers are not present but you have configured the guest OS
+to behave appropriately you may be able to use the I<button-press>
+subcommand to trigger a power button press.
The behavior of what happens to a domain when it reboots is set by the
B<on_reboot> parameter of the domain configuration file when the
Gracefully shuts down a domain. This coordinates with the domain OS
to perform graceful shutdown, so there is no guarantee that it will
succeed, and may take a variable length of time depending on what
-services must be shutdown in the domain. The command returns
-immediately after signally the domain unless that B<-w> flag is used.
-For HVM domains it requires PV drivers to be installed in your guest OS.
+services must be shutdown in the domain.
+
+For HVM domains this requires PV drivers to be installed in your guest
+OS. If PV drivers are not present but you have configured the guest OS
+to behave appropriately you may be able to use the I<button-press>
+subcommand to trigger a power button press.
+
+The command returns immediately after signally the domain unless that
+B<-w> flag is used.
The behavior of what happens to a domain when it reboots is set by the
B<on_shutdown> parameter of the domain configuration file when the
if (ret < 0)
return ret;
- if (!ret) {
- LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
- "PV control interface not available\n");
- return ERROR_FAIL;
- }
+ if (!ret)
+ return ERROR_NOPARAVIRT;
return libxl__domain_pvcontrol_write(gc, XBT_NULL, domid, cmd);
}
ERROR_BADFAIL = -7,
ERROR_GUEST_TIMEDOUT = -8,
ERROR_TIMEDOUT = -9,
+ ERROR_NOPARAVIRT = -10,
};
#define LIBXL_VERSION 0
find_domain(p);
rc=libxl_domain_shutdown(ctx, domid);
- if (rc) { fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1); }
+ if (rc) {
+ if (rc == ERROR_NOPARAVIRT) {
+ fprintf(stderr, "PV control interface not available:"
+ " external graceful shutdown not possible.\n");
+ fprintf(stderr, "Use \"xl button-press <dom> power\" or"
+ " \"xl destroy <dom>\".\n");
+ }
+ fprintf(stderr,"shutdown failed (rc=%d)\n",rc);exit(-1);
+ }
if (wait) {
libxl_waiter waiter;
int rc;
find_domain(p);
rc=libxl_domain_reboot(ctx, domid);
- if (rc) { fprintf(stderr,"reboot failed (rc=%d)\n",rc);exit(-1); }
+ if (rc) {
+ if (rc == ERROR_NOPARAVIRT) {
+ fprintf(stderr, "PV control interface not available:"
+ " external graceful reboot not possible.\n");
+ fprintf(stderr, "Use \"xl button-press <dom> power\" or"
+ " \"xl destroy <dom>\".\n");
+ }
+ fprintf(stderr,"reboot failed (rc=%d)\n",rc);exit(-1); }
}
static void list_domains_details(const libxl_dominfo *info, int nb_domain)