[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/26] migration: ensure htab_save_first completes af
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 08/26] migration: ensure htab_save_first completes after timeout |
Date: |
Thu, 18 Feb 2016 15:18:29 +1100 |
htab_save_first_pass could return without finishing its work due to
timeout. The patch checks if another invocation of it is necessary and
will call it in htab_save_complete if necessary.
Signed-off-by: Jianjun Duan <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
[removed overlong line]
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c85a125..276d6b4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1312,6 +1312,7 @@ static int htab_save_setup(QEMUFile *f, void *opaque)
static void htab_save_first_pass(QEMUFile *f, sPAPRMachineState *spapr,
int64_t max_ns)
{
+ bool has_timeout = max_ns != -1;
int htabslots = HTAB_SIZE(spapr) / HASH_PTE_SIZE_64;
int index = spapr->htab_save_index;
int64_t starttime = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
@@ -1345,7 +1346,8 @@ static void htab_save_first_pass(QEMUFile *f,
sPAPRMachineState *spapr,
qemu_put_buffer(f, HPTE(spapr->htab, chunkstart),
HASH_PTE_SIZE_64 * n_valid);
- if ((qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - starttime) > max_ns)
{
+ if (has_timeout &&
+ (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - starttime) > max_ns)
{
break;
}
}
@@ -1498,6 +1500,9 @@ static int htab_save_complete(QEMUFile *f, void *opaque)
}
close_htab_fd(spapr);
} else {
+ if (spapr->htab_first_pass) {
+ htab_save_first_pass(f, spapr, -1);
+ }
htab_save_later_pass(f, spapr, -1);
}
--
2.5.0
- [Qemu-devel] [PULL 02/26] target-ppc: Remove unused kvmppc_update_sdr1() stub, (continued)
- [Qemu-devel] [PULL 02/26] target-ppc: Remove unused kvmppc_update_sdr1() stub, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 17/26] cuda: port POWERDOWN command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 15/26] cuda: port SET_AUTO_RATE command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 09/26] hw/ppc/spapr: Add h_set_sprg0 hypercall, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 16/26] cuda: port SET_DEVICE_LIST command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 21/26] cuda: port GET_TIME command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 07/26] target-ppc: Remove hack for ppc_hash64_load_hpte*() with HV KVM, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 13/26] cuda: move unknown commands reject out of switch, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 12/26] cuda: add a framework to handle commands, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 10/26] hw/ppc/spapr: Implement h_set_dabr, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 08/26] migration: ensure htab_save_first completes after timeout,
David Gibson <=
- [Qemu-devel] [PULL 25/26] pseries: Include missing pseries-2.5 compat properties in pseries-2.4, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 14/26] cuda: port AUTOPOLL command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 19/26] cuda: port FILE_SERVER_FLAG command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 24/26] cuda: remove CUDA_GET_SET_IIC/CUDA_COMBINED_FORMAT_IIC commands, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 18/26] cuda: port RESET_SYSTEM command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 06/26] pseries: Move hash page table allocation to reset time, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 22/26] cuda: port SET_TIME command to new framework, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 26/26] hw/ppc/spapr: Halt CPU when powering off via RTAS call, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 04/26] pseries: Simplify handling of the hash page table fd, David Gibson, 2016/02/17
- [Qemu-devel] [PULL 05/26] pseries: Add helper to calculate recommended hash page table size, David Gibson, 2016/02/17