#include "qapi/qapi-commands-dump.h"
#include "qapi/qapi-events-dump.h"
#include "qapi/qmp/qerror.h"
+#include "qemu/error-report.h"
#include "qemu/main-loop.h"
#include "hw/misc/vmcoreinfo.h"
#include "migration/blocker.h"
memcpy(buf + addr % page_size, hbuf, n);
addr += n;
- if (addr % page_size == 0) {
- /* we filled up the page */
+ if (addr % page_size == 0 || addr >= block->target_end) {
+ /* we filled up the page or the current block is finished */
break;
}
} else {