Skip to content

Commit

Permalink
xen: destroy_hvm_domain: Move reason into a variable
Browse files Browse the repository at this point in the history
We are going to want to reuse this.

No functional change.

Signed-off-by: Ian Jackson <[email protected]>
Reviewed-by: Anthony PERARD <[email protected]>
Acked-by: Stefano Stabellini <[email protected]>
  • Loading branch information
ijackson-citrix committed Apr 26, 2018
1 parent 4564e63 commit 74aae6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hw/i386/xen/xen-hvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,12 +1387,13 @@ void destroy_hvm_domain(bool reboot)
xc_interface *xc_handle;
int sts;

unsigned int reason = reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff;

xc_handle = xc_interface_open(0, 0, 0);
if (xc_handle == NULL) {
fprintf(stderr, "Cannot acquire xenctrl handle\n");
} else {
sts = xc_domain_shutdown(xc_handle, xen_domid,
reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff);
sts = xc_domain_shutdown(xc_handle, xen_domid, reason);
if (sts != 0) {
fprintf(stderr, "xc_domain_shutdown failed to issue %s, "
"sts %d, %s\n", reboot ? "reboot" : "poweroff",
Expand Down

0 comments on commit 74aae6b

Please sign in to comment.