diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-05-29 04:32:13 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-05-29 04:32:13 -0500 |
commit | dd86df756e02b684718dd5378725927361b0ad36 (patch) | |
tree | a642cf4e3e95059cc45db625cb4587522915514d /xen-all.c | |
parent | 422831fc81a4565d9687bc00bac685261a5dd67a (diff) | |
parent | 180640ea071c98739b6cc55b8d03367bcb442b94 (diff) | |
download | qemu-dd86df756e02b684718dd5378725927361b0ad36.zip qemu-dd86df756e02b684718dd5378725927361b0ad36.tar.gz qemu-dd86df756e02b684718dd5378725927361b0ad36.tar.bz2 |
Merge remote-tracking branch 'sstabellini/for_1.1_rc3' into staging
* sstabellini/for_1.1_rc3:
Call xc_domain_shutdown with the reboot flag when the guest requests a reboot.
xen: Fix PV-on-HVM
xen_disk: properly update stats in ioreq_release()
xen_disk: use bdrv_aio_flush instead of bdrv_flush
xen_disk: remove syncwrite option
xen: disable rtc_clock
xen: do not initialize the interval timer and PCSPK emulator
Diffstat (limited to 'xen-all.c')
-rw-r--r-- | xen-all.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -603,6 +603,10 @@ void xen_vcpu_init(void) qemu_register_reset(xen_reset_vcpu, first_cpu); xen_reset_vcpu(first_cpu); } + /* if rtc_clock is left to default (host_clock), disable it */ + if (rtc_clock == host_clock) { + qemu_clock_enable(rtc_clock, false); + } } /* get the ioreq packets from share mem */ @@ -856,7 +860,7 @@ static void cpu_handle_ioreq(void *opaque) "data: %"PRIx64", count: %" FMT_ioreq_size ", size: %" FMT_ioreq_size "\n", req->state, req->data_is_ptr, req->addr, req->data, req->count, req->size); - destroy_hvm_domain(); + destroy_hvm_domain(false); return; } @@ -870,10 +874,11 @@ static void cpu_handle_ioreq(void *opaque) */ if (runstate_is_running()) { if (qemu_shutdown_requested_get()) { - destroy_hvm_domain(); + destroy_hvm_domain(false); } if (qemu_reset_requested_get()) { qemu_system_reset(VMRESET_REPORT); + destroy_hvm_domain(true); } } @@ -1159,7 +1164,7 @@ int xen_hvm_init(void) return 0; } -void destroy_hvm_domain(void) +void destroy_hvm_domain(bool reboot) { XenXC xc_handle; int sts; @@ -1168,12 +1173,15 @@ void destroy_hvm_domain(void) if (xc_handle == XC_HANDLER_INITIAL_VALUE) { fprintf(stderr, "Cannot acquire xenctrl handle\n"); } else { - sts = xc_domain_shutdown(xc_handle, xen_domid, SHUTDOWN_poweroff); + sts = xc_domain_shutdown(xc_handle, xen_domid, + reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff); if (sts != 0) { - fprintf(stderr, "? xc_domain_shutdown failed to issue poweroff, " - "sts %d, %s\n", sts, strerror(errno)); + fprintf(stderr, "xc_domain_shutdown failed to issue %s, " + "sts %d, %s\n", reboot ? "reboot" : "poweroff", + sts, strerror(errno)); } else { - fprintf(stderr, "Issued domain %d poweroff\n", xen_domid); + fprintf(stderr, "Issued domain %d %s\n", xen_domid, + reboot ? "reboot" : "poweroff"); } xc_interface_close(xc_handle); } |