if ( pagebuf_get(xch, ctx, &pagebuf, io_fd, dom) ) {
PERROR("error when buffering batch, finishing");
- goto out;
+ /*
+ * Remus: discard the current incomplete checkpoint and restore
+ * backup from the last complete checkpoint.
+ */
+ goto finish;
}
memset(&tmptail, 0, sizeof(tmptail));
tmptail.ishvm = hvm;
if ( buffer_tail(xch, ctx, &tmptail, io_fd, max_vcpu_id, vcpumap,
ext_vcpucontext, vcpuextstate_size) < 0 ) {
ERROR ("error buffering image tail, finishing");
- goto out;
+ /*
+ * Remus: discard the current incomplete checkpoint and restore
+ * backup from the last complete checkpoint.
+ */
+ goto finish;
}
tailbuf_free(&tailbuf);
memcpy(&tailbuf, &tmptail, sizeof(tailbuf));
goto loadpages;
+ /* With Remus: restore from last complete checkpoint */
finish:
if ( hvm )
goto finish_hvm;