* [Qemu-devel] [PULL 00/10] Migration queue
@ 2015-02-05 16:24 Juan Quintela
2015-02-06 10:38 ` Peter Maydell
0 siblings, 1 reply; 19+ messages in thread
From: Juan Quintela @ 2015-02-05 16:24 UTC (permalink / raw)
To: qemu-devel
Hi
This is the migration queue. Thanks to Amit for doing almost all the work.
There were a Makefile missing dependency to make test-vmstate compile with the json changes,
Alex agreed with the changes.
List of things:
- vmstate checker fix (amit)
- better tracing and errors (dgilbert)
- json description for migration stream (alex)
- mc146818rtc fix for subsection (Zhang).
Please apply
Thanks, Juan.
The following changes since commit cd07b19307bd185dccfd39052ac66d2730b32857:
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150205' into staging (2015-02-05 14:22:51 +0000)
are available in the git repository at:
git://github.com/juanquintela/qemu.git tags/migration/20150205
for you to fetch changes up to bb426311901776b95b021cece831b69dce4ef5ee:
fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail (2015-02-05 17:16:14 +0100)
----------------------------------------------------------------
migration/next for 20150205
----------------------------------------------------------------
Alexander Graf (4):
QJSON: Add JSON writer
qemu-file: Add fast ftell code path
migration: Append JSON description of migration stream
Add migration stream analyzation script
Amit Shah (1):
vmstate-static-checker: update whitelist
Dr. David Alan Gilbert (4):
savevm: Convert fprintf to error_report
Migration: Add lots of trace events
Print errors in some of the early migration failure cases.
Tracify migration/rdma.c
Zhang Haoyu (1):
fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail
Makefile.objs | 1 +
hw/pci/pci.c | 2 +-
hw/scsi/spapr_vscsi.c | 2 +-
hw/timer/mc146818rtc.c | 2 +-
hw/virtio/virtio.c | 2 +-
include/migration/migration.h | 1 +
include/migration/qemu-file.h | 1 +
include/migration/vmstate.h | 3 +-
include/qjson.h | 29 ++
migration/qemu-file.c | 16 ++
migration/rdma.c | 333 ++++++++++-----------
migration/vmstate.c | 217 +++++++++++++-
qjson.c | 129 +++++++++
savevm.c | 92 ++++--
scripts/analyze-migration.py | 592 ++++++++++++++++++++++++++++++++++++++
scripts/vmstate-static-checker.py | 2 +
tests/Makefile | 3 +-
tests/test-vmstate.c | 6 +-
trace-events | 73 ++++-
19 files changed, 1274 insertions(+), 232 deletions(-)
create mode 100644 include/qjson.h
create mode 100644 qjson.c
create mode 100755 scripts/analyze-migration.py
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] Migration queue
2015-02-05 16:24 [Qemu-devel] [PULL 00/10] Migration queue Juan Quintela
@ 2015-02-06 10:38 ` Peter Maydell
0 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2015-02-06 10:38 UTC (permalink / raw)
To: Juan Quintela; +Cc: QEMU Developers
On 5 February 2015 at 16:24, Juan Quintela <quintela@redhat.com> wrote:
> Hi
>
> This is the migration queue. Thanks to Amit for doing almost all the work.
> There were a Makefile missing dependency to make test-vmstate compile with the json changes,
> Alex agreed with the changes.
>
> List of things:
> - vmstate checker fix (amit)
> - better tracing and errors (dgilbert)
> - json description for migration stream (alex)
> - mc146818rtc fix for subsection (Zhang).
>
> Please apply
>
> Thanks, Juan.
>
> The following changes since commit cd07b19307bd185dccfd39052ac66d2730b32857:
>
> Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150205' into staging (2015-02-05 14:22:51 +0000)
>
> are available in the git repository at:
>
> git://github.com/juanquintela/qemu.git tags/migration/20150205
>
> for you to fetch changes up to bb426311901776b95b021cece831b69dce4ef5ee:
>
> fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail (2015-02-05 17:16:14 +0100)
>
> ----------------------------------------------------------------
> migration/next for 20150205
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 00/10] migration queue
@ 2018-02-14 15:39 Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose Dr. David Alan Gilbert (git)
` (11 more replies)
0 siblings, 12 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217:
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000)
are available in the Git repository at:
git://github.com/dagrh/qemu.git tags/pull-migration-20180214a
for you to fetch changes up to 3e0c8050ebba3f55dc2d92b3790a3cfb80786d07:
migration: pass MigrationState to migrate_init() (2018-02-14 10:37:09 +0000)
----------------------------------------------------------------
Migration pull 20180214
Note that the 'Add test for migration to bad destination' displays
a 'Connection refused' during running, but still gives the correct exit
code and OK (It's checking that the source doesn't fail when
it can't connect, so that's the right error).
If it's particularly disliked that patch can be skipped individually.
----------------------------------------------------------------
Dr. David Alan Gilbert (3):
tests/migration: Add source to PC boot block
migration: Fix early failure cleanup
tests/migration: Add test for migration to bad destination
Greg Kurz (1):
migration: improve documentation of postcopy-ram
Peter Xu (5):
migration: better error handling with QEMUFile
migration: reuse mis->userfault_quit_fd
migration: provide postcopy_fault_thread_notify()
migration: allow send_rq to fail
migration: pass MigrationState to migrate_init()
Ross Lagerwall (1):
migration/xen: Check return value of qemu_fclose
docs/devel/migration.rst | 4 +-
hmp-commands.hx | 3 +-
migration/migration.c | 47 +++++++++----
migration/migration.h | 10 +--
migration/postcopy-ram.c | 60 ++++++++++------
migration/postcopy-ram.h | 2 +
migration/ram.c | 33 ++++++---
migration/savevm.c | 48 +++++++++++--
qapi/migration.json | 10 +--
tests/migration-test.c | 117 ++++++++++++++-----------------
tests/migration/rebuild-x86-bootblock.sh | 33 +++++++++
tests/migration/x86-a-b-bootblock.h | 51 ++++++++++++++
tests/migration/x86-a-b-bootblock.s | 92 ++++++++++++++++++++++++
13 files changed, 388 insertions(+), 122 deletions(-)
create mode 100755 tests/migration/rebuild-x86-bootblock.sh
create mode 100644 tests/migration/x86-a-b-bootblock.h
create mode 100644 tests/migration/x86-a-b-bootblock.s
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 02/10] migration: improve documentation of postcopy-ram Dr. David Alan Gilbert (git)
` (10 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Ross Lagerwall <ross.lagerwall@citrix.com>
QEMUFile uses buffered IO so when writing small amounts (such as the Xen
device state file), the actual write call and any errors that may occur
only happen as part of qemu_fclose(). Therefore, report IO errors when
saving the device state under Xen by checking the return value of
qemu_fclose().
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Message-Id: <20180206163039.23661-1-ross.lagerwall@citrix.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/savevm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 3f611c02e8..68b652ff76 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2284,8 +2284,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
f = qemu_fopen_channel_output(QIO_CHANNEL(ioc));
object_unref(OBJECT(ioc));
ret = qemu_save_device_state(f);
- qemu_fclose(f);
- if (ret < 0) {
+ if (ret < 0 || qemu_fclose(f) < 0) {
error_setg(errp, QERR_IO_ERROR);
} else {
/* libxl calls the QMP command "stop" before calling
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 02/10] migration: improve documentation of postcopy-ram
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 03/10] tests/migration: Add source to PC boot block Dr. David Alan Gilbert (git)
` (9 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Greg Kurz <groug@kaod.org>
This capability must have the same value on both source and destination,
otherwise migration fails (commit 875fcd013ab6 "migration: incoming
postcopy advise sanity checks").
Let's write it down in various places where postcopy-ram is documented.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <151801810352.29167.4832480228518630626.stgit@bahia.lan>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
docs/devel/migration.rst | 4 ++--
hmp-commands.hx | 3 ++-
qapi/migration.json | 10 ++++++----
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index bf97080dac..9d1b7657f0 100644
--- a/docs/devel/migration.rst
+++ b/docs/devel/migration.rst
@@ -387,8 +387,8 @@ doesn't finish in a given time the switch is made to postcopy.
Enabling postcopy
-----------------
-To enable postcopy, issue this command on the monitor prior to the
-start of migration:
+To enable postcopy, issue this command on the monitor (both source and
+destination) prior to the start of migration:
``migrate_set_capability postcopy-ram on``
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 15620c94d3..d26eb4119b 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1041,7 +1041,8 @@ ETEXI
.params = "",
.help = "Followup to a migration command to switch the migration"
" to postcopy mode. The postcopy-ram capability must "
- "be set before the original migration command.",
+ "be set on both source and destination before the "
+ "original migration command .",
.cmd = hmp_migrate_start_postcopy,
},
diff --git a/qapi/migration.json b/qapi/migration.json
index 4cd3d13158..7f465a1902 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -327,8 +327,10 @@
# to speed up convergence of RAM migration. (since 1.6)
#
# @postcopy-ram: Start executing on the migration target before all of RAM has
-# been migrated, pulling the remaining pages along as needed. NOTE: If
-# the migration fails during postcopy the VM will fail. (since 2.6)
+# been migrated, pulling the remaining pages along as needed. The
+# capacity must have the same setting on both source and target
+# or migration will not even start. NOTE: If the migration fails during
+# postcopy the VM will fail. (since 2.6)
#
# @x-colo: If enabled, migration will never end, and the state of the VM on the
# primary side will be migrated continuously to the VM on secondary
@@ -742,8 +744,8 @@
# @migrate-start-postcopy:
#
# Followup to a migration command to switch the migration to postcopy mode.
-# The postcopy-ram capability must be set before the original migration
-# command.
+# The postcopy-ram capability must be set on both source and destination
+# before the original migration command.
#
# Since: 2.5
#
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 03/10] tests/migration: Add source to PC boot block
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 02/10] migration: improve documentation of postcopy-ram Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 04/10] migration: Fix early failure cleanup Dr. David Alan Gilbert (git)
` (8 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The boot block used in the migration test is currently only
shipped as a hex (with the source in the git commit message of ea0c6d62),
change this to actually include the source.
A script is added to rebuild the header but the expectation is that
the generated hex is shipped as well as the .s, so that
there's no requirement to have just the right assembler etc.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180213100606.5379-1-dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Removed blank line at end of script
---
tests/migration-test.c | 52 ++----------------
tests/migration/rebuild-x86-bootblock.sh | 33 ++++++++++++
tests/migration/x86-a-b-bootblock.h | 51 ++++++++++++++++++
tests/migration/x86-a-b-bootblock.s | 92 ++++++++++++++++++++++++++++++++
4 files changed, 180 insertions(+), 48 deletions(-)
create mode 100755 tests/migration/rebuild-x86-bootblock.sh
create mode 100644 tests/migration/x86-a-b-bootblock.h
create mode 100644 tests/migration/x86-a-b-bootblock.s
diff --git a/tests/migration-test.c b/tests/migration-test.c
index d0abad40f5..97fdb1988e 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -1,7 +1,7 @@
/*
* QTest testcase for migration
*
- * Copyright (c) 2016 Red Hat, Inc. and/or its affiliates
+ * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
* based on the vhost-user-test.c that is:
* Copyright (c) 2014 Virtual Open Systems Sarl.
*
@@ -78,59 +78,15 @@ static bool ufd_version_check(void)
static const char *tmpfs;
/* A simple PC boot sector that modifies memory (1-100MB) quickly
- * outputing a 'B' every so often if it's still running.
+ * outputting a 'B' every so often if it's still running.
*/
-unsigned char bootsect[] = {
- 0xfa, 0x0f, 0x01, 0x16, 0x74, 0x7c, 0x66, 0xb8, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x22, 0xc0, 0x66, 0xea, 0x20, 0x7c, 0x00, 0x00, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x92, 0x0c, 0x02,
- 0xe6, 0x92, 0xb8, 0x10, 0x00, 0x00, 0x00, 0x8e, 0xd8, 0x66, 0xb8, 0x41,
- 0x00, 0x66, 0xba, 0xf8, 0x03, 0xee, 0xb3, 0x00, 0xb8, 0x00, 0x00, 0x10,
- 0x00, 0xfe, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x40,
- 0x06, 0x7c, 0xf2, 0xfe, 0xc3, 0x75, 0xe9, 0x66, 0xb8, 0x42, 0x00, 0x66,
- 0xba, 0xf8, 0x03, 0xee, 0xeb, 0xde, 0x66, 0x90, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00,
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00, 0x27, 0x00, 0x5c, 0x7c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
-};
+#include "tests/migration/x86-a-b-bootblock.h"
static void init_bootfile_x86(const char *bootpath)
{
FILE *bootfile = fopen(bootpath, "wb");
- g_assert_cmpint(fwrite(bootsect, 512, 1, bootfile), ==, 1);
+ g_assert_cmpint(fwrite(x86_bootsect, 512, 1, bootfile), ==, 1);
fclose(bootfile);
}
diff --git a/tests/migration/rebuild-x86-bootblock.sh b/tests/migration/rebuild-x86-bootblock.sh
new file mode 100755
index 0000000000..86cec5d284
--- /dev/null
+++ b/tests/migration/rebuild-x86-bootblock.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+#
+# Author: dgilbert@redhat.com
+
+ASMFILE=$PWD/tests/migration/x86-a-b-bootblock.s
+HEADER=$PWD/tests/migration/x86-a-b-bootblock.h
+
+if [ ! -e "$ASMFILE" ]
+then
+ echo "Couldn't find $ASMFILE" >&2
+ exit 1
+fi
+
+ASM_WORK_DIR=$(mktemp -d --tmpdir X86BB.XXXXXX)
+cd "$ASM_WORK_DIR" &&
+as --32 -march=i486 "$ASMFILE" -o x86.o &&
+objcopy -O binary x86.o x86.boot &&
+dd if=x86.boot of=x86.bootsect bs=256 count=2 skip=124 &&
+xxd -i x86.bootsect |
+sed -e 's/.*int.*//' > x86.hex &&
+cat - x86.hex <<HERE > "$HEADER"
+/* This file is automatically generated from
+ * tests/migration/x86-a-b-bootblock.s, edit that and then run
+ * tests/migration/rebuild-x86-bootblock.sh to update,
+ * and then remember to send both in your patch submission.
+ */
+HERE
+
+rm x86.hex x86.bootsect x86.boot x86.o
+cd .. && rmdir "$ASM_WORK_DIR"
diff --git a/tests/migration/x86-a-b-bootblock.h b/tests/migration/x86-a-b-bootblock.h
new file mode 100644
index 0000000000..78a151fe2a
--- /dev/null
+++ b/tests/migration/x86-a-b-bootblock.h
@@ -0,0 +1,51 @@
+/* This file is automatically generated from
+ * tests/migration/x86-a-b-bootblock.s, edit that and then run
+ * tests/migration/rebuild-x86-bootblock.sh to update,
+ * and then remember to send both in your patch submission.
+ */
+unsigned char x86_bootsect[] = {
+ 0xfa, 0x0f, 0x01, 0x16, 0x74, 0x7c, 0x66, 0xb8, 0x01, 0x00, 0x00, 0x00,
+ 0x0f, 0x22, 0xc0, 0x66, 0xea, 0x20, 0x7c, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x92, 0x0c, 0x02,
+ 0xe6, 0x92, 0xb8, 0x10, 0x00, 0x00, 0x00, 0x8e, 0xd8, 0x66, 0xb8, 0x41,
+ 0x00, 0x66, 0xba, 0xf8, 0x03, 0xee, 0xb3, 0x00, 0xb8, 0x00, 0x00, 0x10,
+ 0x00, 0xfe, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x40,
+ 0x06, 0x7c, 0xf2, 0xfe, 0xc3, 0x75, 0xe9, 0x66, 0xb8, 0x42, 0x00, 0x66,
+ 0xba, 0xf8, 0x03, 0xee, 0xeb, 0xde, 0x66, 0x90, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00, 0x27, 0x00, 0x5c, 0x7c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
+};
+
diff --git a/tests/migration/x86-a-b-bootblock.s b/tests/migration/x86-a-b-bootblock.s
new file mode 100644
index 0000000000..b1642641a7
--- /dev/null
+++ b/tests/migration/x86-a-b-bootblock.s
@@ -0,0 +1,92 @@
+# x86 bootblock used in migration test
+# repeatedly increments the first byte of each page in a 100MB
+# range.
+# Outputs an initial 'A' on serial followed by repeated 'B's
+#
+# run tests/migration/rebuild-x86-bootblock.sh
+# to regenerate the hex, and remember to include both the .h and .s
+# in any patches.
+#
+# Copyright (c) 2016 Red Hat, Inc. and/or its affiliates
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
+# See the COPYING file in the top-level directory.
+#
+# Author: dgilbert@redhat.com
+
+
+.code16
+.org 0x7c00
+ .file "fill.s"
+ .text
+ .globl start
+ .type start, @function
+start: # at 0x7c00 ?
+ cli
+ lgdt gdtdesc
+ mov $1,%eax
+ mov %eax,%cr0 # Protected mode enable
+ data32 ljmp $8,$0x7c20
+
+.org 0x7c20
+.code32
+ # A20 enable - not sure I actually need this
+ inb $0x92,%al
+ or $2,%al
+ outb %al, $0x92
+
+ # set up DS for the whole of RAM (needed on KVM)
+ mov $16,%eax
+ mov %eax,%ds
+
+ mov $65,%ax
+ mov $0x3f8,%dx
+ outb %al,%dx
+
+ # bl keeps a counter so we limit the output speed
+ mov $0, %bl
+mainloop:
+ # Start from 1MB
+ mov $(1024*1024),%eax
+innerloop:
+ incb (%eax)
+ add $4096,%eax
+ cmp $(100*1024*1024),%eax
+ jl innerloop
+
+ inc %bl
+ jnz mainloop
+
+ mov $66,%ax
+ mov $0x3f8,%dx
+ outb %al,%dx
+
+ jmp mainloop
+
+ # GDT magic from old (GPLv2) Grub startup.S
+ .p2align 2 /* force 4-byte alignment */
+gdt:
+ .word 0, 0
+ .byte 0, 0, 0, 0
+
+ /* -- code segment --
+ * base = 0x00000000, limit = 0xFFFFF (4 KiB Granularity), present
+ * type = 32bit code execute/read, DPL = 0
+ */
+ .word 0xFFFF, 0
+ .byte 0, 0x9A, 0xCF, 0
+
+ /* -- data segment --
+ * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
+ * type = 32 bit data read/write, DPL = 0
+ */
+ .word 0xFFFF, 0
+ .byte 0, 0x92, 0xCF, 0
+
+gdtdesc:
+ .word 0x27 /* limit */
+ .long gdt /* addr */
+
+/* I'm a bootable disk */
+.org 0x7dfe
+ .byte 0x55
+ .byte 0xAA
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 04/10] migration: Fix early failure cleanup
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (2 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 03/10] tests/migration: Add source to PC boot block Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 05/10] tests/migration: Add test for migration to bad destination Dr. David Alan Gilbert (git)
` (7 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Avoid crash in cleanup after a very early migration failure
(possibly due to my 688a3dcba980bf01344a 'Route errors down ...')
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180212160340.15333-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
migration/ram.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 8333d8e35e..7095c1040e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1602,11 +1602,13 @@ static void xbzrle_load_cleanup(void)
static void ram_state_cleanup(RAMState **rsp)
{
- migration_page_queue_free(*rsp);
- qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
- qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
- g_free(*rsp);
- *rsp = NULL;
+ if (*rsp) {
+ migration_page_queue_free(*rsp);
+ qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
+ qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
+ g_free(*rsp);
+ *rsp = NULL;
+ }
}
static void xbzrle_cleanup(void)
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 05/10] tests/migration: Add test for migration to bad destination
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (3 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 04/10] migration: Fix early failure cleanup Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 06/10] migration: better error handling with QEMUFile Dr. David Alan Gilbert (git)
` (6 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Check the source survives.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180212160340.15333-3-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
---
tests/migration-test.c | 65 ++++++++++++++++++++++++++++++++++++++------------
1 file changed, 50 insertions(+), 15 deletions(-)
diff --git a/tests/migration-test.c b/tests/migration-test.c
index 97fdb1988e..74f9361bdd 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -434,28 +434,31 @@ static void test_migrate_start(QTestState **from, QTestState **to,
g_free(cmd_dst);
}
-static void test_migrate_end(QTestState *from, QTestState *to)
+static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
{
unsigned char dest_byte_a, dest_byte_b, dest_byte_c, dest_byte_d;
qtest_quit(from);
- qtest_memread(to, start_address, &dest_byte_a, 1);
+ if (test_dest) {
+ qtest_memread(to, start_address, &dest_byte_a, 1);
- /* Destination still running, wait for a byte to change */
- do {
- qtest_memread(to, start_address, &dest_byte_b, 1);
- usleep(1000 * 10);
- } while (dest_byte_a == dest_byte_b);
+ /* Destination still running, wait for a byte to change */
+ do {
+ qtest_memread(to, start_address, &dest_byte_b, 1);
+ usleep(1000 * 10);
+ } while (dest_byte_a == dest_byte_b);
+
+ qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}");
- qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}");
- /* With it stopped, check nothing changes */
- qtest_memread(to, start_address, &dest_byte_c, 1);
- usleep(1000 * 200);
- qtest_memread(to, start_address, &dest_byte_d, 1);
- g_assert_cmpint(dest_byte_c, ==, dest_byte_d);
+ /* With it stopped, check nothing changes */
+ qtest_memread(to, start_address, &dest_byte_c, 1);
+ usleep(1000 * 200);
+ qtest_memread(to, start_address, &dest_byte_d, 1);
+ g_assert_cmpint(dest_byte_c, ==, dest_byte_d);
- check_guests_ram(to);
+ check_guests_ram(to);
+ }
qtest_quit(to);
@@ -547,7 +550,38 @@ static void test_migrate(void)
g_free(uri);
- test_migrate_end(from, to);
+ test_migrate_end(from, to, true);
+}
+
+static void test_baddest(void)
+{
+ QTestState *from, *to;
+ QDict *rsp, *rsp_return;
+ const char *status;
+ bool failed;
+
+ test_migrate_start(&from, &to, "tcp:0:0");
+ migrate(from, "tcp:0:0");
+ do {
+ rsp = wait_command(from, "{ 'execute': 'query-migrate' }");
+ rsp_return = qdict_get_qdict(rsp, "return");
+
+ status = qdict_get_str(rsp_return, "status");
+
+ g_assert(!strcmp(status, "setup") || !(strcmp(status, "failed")));
+ failed = !strcmp(status, "failed");
+ QDECREF(rsp);
+ } while (!failed);
+
+ /* Is the machine currently running? */
+ rsp = wait_command(from, "{ 'execute': 'query-status' }");
+ g_assert(qdict_haskey(rsp, "return"));
+ rsp_return = qdict_get_qdict(rsp, "return");
+ g_assert(qdict_haskey(rsp_return, "running"));
+ g_assert(qdict_get_bool(rsp_return, "running"));
+ QDECREF(rsp);
+
+ test_migrate_end(from, to, false);
}
int main(int argc, char **argv)
@@ -571,6 +605,7 @@ int main(int argc, char **argv)
qtest_add_func("/migration/postcopy/unix", test_migrate);
qtest_add_func("/migration/deprecated", test_deprecated);
+ qtest_add_func("/migration/bad_dest", test_baddest);
ret = g_test_run();
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 06/10] migration: better error handling with QEMUFile
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (4 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 05/10] tests/migration: Add test for migration to bad destination Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 07/10] migration: reuse mis->userfault_quit_fd Dr. David Alan Gilbert (git)
` (5 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Peter Xu <peterx@redhat.com>
If the postcopy down due to some reason, we can always see this on dst:
qemu-system-x86_64: RP: Received invalid message 0x0000 length 0x0000
However in most cases that's not the real issue. The problem is that
qemu_get_be16() has no way to show whether the returned data is valid or
not, and we are _always_ assuming it is valid. That's possibly not wise.
The best approach to solve this would be: refactoring QEMUFile interface
to allow the APIs to return error if there is. However it needs quite a
bit of work and testing. For now, let's explicitly check the validity
first before using the data in all places for qemu_get_*().
This patch tries to fix most of the cases I can see. Only if we are with
this, can we make sure we are processing the valid data, and also can we
make sure we can capture the channel down events correctly.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-2-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 5 +++++
migration/ram.c | 21 +++++++++++++++++----
migration/savevm.c | 40 ++++++++++++++++++++++++++++++++++++++--
3 files changed, 60 insertions(+), 6 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 86d69120a6..e2a5a832c6 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1709,6 +1709,11 @@ static void *source_return_path_thread(void *opaque)
header_type = qemu_get_be16(rp);
header_len = qemu_get_be16(rp);
+ if (qemu_file_get_error(rp)) {
+ mark_source_rp_bad(ms);
+ goto out;
+ }
+
if (header_type >= MIG_RP_MSG_MAX ||
header_type == MIG_RP_MSG_INVALID) {
error_report("RP: Received invalid message 0x%04x length 0x%04x",
diff --git a/migration/ram.c b/migration/ram.c
index 7095c1040e..5e33e5cc79 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2700,6 +2700,16 @@ static int ram_load_postcopy(QEMUFile *f)
uint8_t ch;
addr = qemu_get_be64(f);
+
+ /*
+ * If qemu file error, we should stop here, and then "addr"
+ * may be invalid
+ */
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ break;
+ }
+
flags = addr & ~TARGET_PAGE_MASK;
addr &= TARGET_PAGE_MASK;
@@ -2780,9 +2790,15 @@ static int ram_load_postcopy(QEMUFile *f)
error_report("Unknown combination of migration flags: %#x"
" (postcopy mode)", flags);
ret = -EINVAL;
+ break;
+ }
+
+ /* Detect for any possible file errors */
+ if (!ret && qemu_file_get_error(f)) {
+ ret = qemu_file_get_error(f);
}
- if (place_needed) {
+ if (!ret && place_needed) {
/* This gets called at the last target page in the host page */
void *place_dest = host + TARGET_PAGE_SIZE - block->page_size;
@@ -2794,9 +2810,6 @@ static int ram_load_postcopy(QEMUFile *f)
place_source, block);
}
}
- if (!ret) {
- ret = qemu_file_get_error(f);
- }
}
return ret;
diff --git a/migration/savevm.c b/migration/savevm.c
index 68b652ff76..967c3bca0d 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1781,6 +1781,11 @@ static int loadvm_process_command(QEMUFile *f)
cmd = qemu_get_be16(f);
len = qemu_get_be16(f);
+ /* Check validity before continue processing of cmds */
+ if (qemu_file_get_error(f)) {
+ return qemu_file_get_error(f);
+ }
+
trace_loadvm_process_command(cmd, len);
if (cmd >= MIG_CMD_MAX || cmd == MIG_CMD_INVALID) {
error_report("MIG_CMD 0x%x unknown (len 0x%x)", cmd, len);
@@ -1846,6 +1851,7 @@ static int loadvm_process_command(QEMUFile *f)
*/
static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)
{
+ int ret;
uint8_t read_mark;
uint32_t read_section_id;
@@ -1856,6 +1862,13 @@ static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)
read_mark = qemu_get_byte(f);
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ error_report("%s: Read section footer failed: %d",
+ __func__, ret);
+ return false;
+ }
+
if (read_mark != QEMU_VM_SECTION_FOOTER) {
error_report("Missing section footer for %s", se->idstr);
return false;
@@ -1891,6 +1904,13 @@ qemu_loadvm_section_start_full(QEMUFile *f, MigrationIncomingState *mis)
instance_id = qemu_get_be32(f);
version_id = qemu_get_be32(f);
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ error_report("%s: Failed to read instance/version ID: %d",
+ __func__, ret);
+ return ret;
+ }
+
trace_qemu_loadvm_state_section_startfull(section_id, idstr,
instance_id, version_id);
/* Find savevm section */
@@ -1938,6 +1958,13 @@ qemu_loadvm_section_part_end(QEMUFile *f, MigrationIncomingState *mis)
section_id = qemu_get_be32(f);
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ error_report("%s: Failed to read section ID: %d",
+ __func__, ret);
+ return ret;
+ }
+
trace_qemu_loadvm_state_section_partend(section_id);
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (se->load_section_id == section_id) {
@@ -2005,8 +2032,14 @@ static int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis)
uint8_t section_type;
int ret = 0;
- while ((section_type = qemu_get_byte(f)) != QEMU_VM_EOF) {
- ret = 0;
+ while (true) {
+ section_type = qemu_get_byte(f);
+
+ if (qemu_file_get_error(f)) {
+ ret = qemu_file_get_error(f);
+ break;
+ }
+
trace_qemu_loadvm_state_section(section_type);
switch (section_type) {
case QEMU_VM_SECTION_START:
@@ -2030,6 +2063,9 @@ static int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis)
goto out;
}
break;
+ case QEMU_VM_EOF:
+ /* This is the end of migration */
+ goto out;
default:
error_report("Unknown savevm section type %d", section_type);
ret = -EINVAL;
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 07/10] migration: reuse mis->userfault_quit_fd
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (5 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 06/10] migration: better error handling with QEMUFile Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 08/10] migration: provide postcopy_fault_thread_notify() Dr. David Alan Gilbert (git)
` (4 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Peter Xu <peterx@redhat.com>
It was only used for quitting the page fault thread before. Let it be
something more useful - now we can use it to notify a "wake" for the
page fault thread (for any reason), and it only means "quit" if the
fault_thread_quit is set.
Since we changed what it does, renaming it to userfault_event_fd.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-3-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.h | 6 ++++--
migration/postcopy-ram.c | 29 ++++++++++++++++++++---------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/migration/migration.h b/migration/migration.h
index 848f638a20..75c72d3c8f 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -35,6 +35,8 @@ struct MigrationIncomingState {
bool have_fault_thread;
QemuThread fault_thread;
QemuSemaphore fault_thread_sem;
+ /* Set this when we want the fault thread to quit */
+ bool fault_thread_quit;
bool have_listen_thread;
QemuThread listen_thread;
@@ -42,8 +44,8 @@ struct MigrationIncomingState {
/* For the kernel to send us notifications */
int userfault_fd;
- /* To tell the fault_thread to quit */
- int userfault_quit_fd;
+ /* To notify the fault_thread to wake, e.g., when need to quit */
+ int userfault_event_fd;
QEMUFile *to_src_file;
QemuMutex rp_mutex; /* We send replies from multiple threads */
void *postcopy_tmp_page;
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index bec6c2c66b..9ad4f20f82 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -387,17 +387,18 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
* currently be at 0, we're going to increment it to 1
*/
tmp64 = 1;
- if (write(mis->userfault_quit_fd, &tmp64, 8) == 8) {
+ atomic_set(&mis->fault_thread_quit, 1);
+ if (write(mis->userfault_event_fd, &tmp64, 8) == 8) {
trace_postcopy_ram_incoming_cleanup_join();
qemu_thread_join(&mis->fault_thread);
} else {
/* Not much we can do here, but may as well report it */
- error_report("%s: incrementing userfault_quit_fd: %s", __func__,
+ error_report("%s: incrementing userfault_event_fd: %s", __func__,
strerror(errno));
}
trace_postcopy_ram_incoming_cleanup_closeuf();
close(mis->userfault_fd);
- close(mis->userfault_quit_fd);
+ close(mis->userfault_event_fd);
mis->have_fault_thread = false;
}
@@ -520,7 +521,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
pfd[0].fd = mis->userfault_fd;
pfd[0].events = POLLIN;
pfd[0].revents = 0;
- pfd[1].fd = mis->userfault_quit_fd;
+ pfd[1].fd = mis->userfault_event_fd;
pfd[1].events = POLLIN; /* Waiting for eventfd to go positive */
pfd[1].revents = 0;
@@ -530,8 +531,18 @@ static void *postcopy_ram_fault_thread(void *opaque)
}
if (pfd[1].revents) {
- trace_postcopy_ram_fault_thread_quit();
- break;
+ uint64_t tmp64 = 0;
+
+ /* Consume the signal */
+ if (read(mis->userfault_event_fd, &tmp64, 8) != 8) {
+ /* Nothing obviously nicer than posting this error. */
+ error_report("%s: read() failed", __func__);
+ }
+
+ if (atomic_read(&mis->fault_thread_quit)) {
+ trace_postcopy_ram_fault_thread_quit();
+ break;
+ }
}
ret = read(mis->userfault_fd, &msg, sizeof(msg));
@@ -610,9 +621,9 @@ int postcopy_ram_enable_notify(MigrationIncomingState *mis)
}
/* Now an eventfd we use to tell the fault-thread to quit */
- mis->userfault_quit_fd = eventfd(0, EFD_CLOEXEC);
- if (mis->userfault_quit_fd == -1) {
- error_report("%s: Opening userfault_quit_fd: %s", __func__,
+ mis->userfault_event_fd = eventfd(0, EFD_CLOEXEC);
+ if (mis->userfault_event_fd == -1) {
+ error_report("%s: Opening userfault_event_fd: %s", __func__,
strerror(errno));
close(mis->userfault_fd);
return -1;
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 08/10] migration: provide postcopy_fault_thread_notify()
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (6 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 07/10] migration: reuse mis->userfault_quit_fd Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 09/10] migration: allow send_rq to fail Dr. David Alan Gilbert (git)
` (3 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Peter Xu <peterx@redhat.com>
A general helper to notify the fault thread.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-4-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/postcopy-ram.c | 35 ++++++++++++++++++++---------------
migration/postcopy-ram.h | 2 ++
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 9ad4f20f82..032abfbf1a 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -377,25 +377,15 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
trace_postcopy_ram_incoming_cleanup_entry();
if (mis->have_fault_thread) {
- uint64_t tmp64;
-
if (qemu_ram_foreach_block(cleanup_range, mis)) {
return -1;
}
- /*
- * Tell the fault_thread to exit, it's an eventfd that should
- * currently be at 0, we're going to increment it to 1
- */
- tmp64 = 1;
+ /* Let the fault thread quit */
atomic_set(&mis->fault_thread_quit, 1);
- if (write(mis->userfault_event_fd, &tmp64, 8) == 8) {
- trace_postcopy_ram_incoming_cleanup_join();
- qemu_thread_join(&mis->fault_thread);
- } else {
- /* Not much we can do here, but may as well report it */
- error_report("%s: incrementing userfault_event_fd: %s", __func__,
- strerror(errno));
- }
+ postcopy_fault_thread_notify(mis);
+ trace_postcopy_ram_incoming_cleanup_join();
+ qemu_thread_join(&mis->fault_thread);
+
trace_postcopy_ram_incoming_cleanup_closeuf();
close(mis->userfault_fd);
close(mis->userfault_event_fd);
@@ -824,6 +814,21 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mis)
/* ------------------------------------------------------------------------- */
+void postcopy_fault_thread_notify(MigrationIncomingState *mis)
+{
+ uint64_t tmp64 = 1;
+
+ /*
+ * Wakeup the fault_thread. It's an eventfd that should currently
+ * be at 0, we're going to increment it to 1
+ */
+ if (write(mis->userfault_event_fd, &tmp64, 8) != 8) {
+ /* Not much we can do here, but may as well report it */
+ error_report("%s: incrementing failed: %s", __func__,
+ strerror(errno));
+ }
+}
+
/**
* postcopy_discard_send_init: Called at the start of each RAMBlock before
* asking to discard individual ranges.
diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
index 77ea0fd264..14f6cadcbd 100644
--- a/migration/postcopy-ram.h
+++ b/migration/postcopy-ram.h
@@ -114,4 +114,6 @@ PostcopyState postcopy_state_get(void);
/* Set the state and return the old state */
PostcopyState postcopy_state_set(PostcopyState new_state);
+void postcopy_fault_thread_notify(MigrationIncomingState *mis);
+
#endif
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 09/10] migration: allow send_rq to fail
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (7 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 08/10] migration: provide postcopy_fault_thread_notify() Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 10/10] migration: pass MigrationState to migrate_init() Dr. David Alan Gilbert (git)
` (2 subsequent siblings)
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Peter Xu <peterx@redhat.com>
We will not allow failures to happen when sending data from destination
to source via the return path. However it is possible that there can be
errors along the way. This patch allows the migrate_send_rp_message()
to return error when it happens, and further extended it to
migrate_send_rp_req_pages().
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-9-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 35 ++++++++++++++++++++++++++++-------
migration/migration.h | 2 +-
2 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index e2a5a832c6..913f658c3e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -205,17 +205,35 @@ static void deferred_incoming_migration(Error **errp)
* Send a message on the return channel back to the source
* of the migration.
*/
-static void migrate_send_rp_message(MigrationIncomingState *mis,
- enum mig_rp_message_type message_type,
- uint16_t len, void *data)
+static int migrate_send_rp_message(MigrationIncomingState *mis,
+ enum mig_rp_message_type message_type,
+ uint16_t len, void *data)
{
+ int ret = 0;
+
trace_migrate_send_rp_message((int)message_type, len);
qemu_mutex_lock(&mis->rp_mutex);
+
+ /*
+ * It's possible that the file handle got lost due to network
+ * failures.
+ */
+ if (!mis->to_src_file) {
+ ret = -EIO;
+ goto error;
+ }
+
qemu_put_be16(mis->to_src_file, (unsigned int)message_type);
qemu_put_be16(mis->to_src_file, len);
qemu_put_buffer(mis->to_src_file, data, len);
qemu_fflush(mis->to_src_file);
+
+ /* It's possible that qemu file got error during sending */
+ ret = qemu_file_get_error(mis->to_src_file);
+
+error:
qemu_mutex_unlock(&mis->rp_mutex);
+ return ret;
}
/* Request a range of pages from the source VM at the given
@@ -225,11 +243,12 @@ static void migrate_send_rp_message(MigrationIncomingState *mis,
* Start: Address offset within the RB
* Len: Length in bytes required - must be a multiple of pagesize
*/
-void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char *rbname,
- ram_addr_t start, size_t len)
+int migrate_send_rp_req_pages(MigrationIncomingState *mis, const char *rbname,
+ ram_addr_t start, size_t len)
{
uint8_t bufc[12 + 1 + 255]; /* start (8), len (4), rbname up to 256 */
size_t msglen = 12; /* start + len */
+ enum mig_rp_message_type msg_type;
*(uint64_t *)bufc = cpu_to_be64((uint64_t)start);
*(uint32_t *)(bufc + 8) = cpu_to_be32((uint32_t)len);
@@ -241,10 +260,12 @@ void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char *rbname,
bufc[msglen++] = rbname_len;
memcpy(bufc + msglen, rbname, rbname_len);
msglen += rbname_len;
- migrate_send_rp_message(mis, MIG_RP_MSG_REQ_PAGES_ID, msglen, bufc);
+ msg_type = MIG_RP_MSG_REQ_PAGES_ID;
} else {
- migrate_send_rp_message(mis, MIG_RP_MSG_REQ_PAGES, msglen, bufc);
+ msg_type = MIG_RP_MSG_REQ_PAGES;
}
+
+ return migrate_send_rp_message(mis, msg_type, msglen, bufc);
}
void qemu_start_incoming_migration(const char *uri, Error **errp)
diff --git a/migration/migration.h b/migration/migration.h
index 75c72d3c8f..f515b8994f 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -230,7 +230,7 @@ void migrate_send_rp_shut(MigrationIncomingState *mis,
uint32_t value);
void migrate_send_rp_pong(MigrationIncomingState *mis,
uint32_t value);
-void migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rbname,
+int migrate_send_rp_req_pages(MigrationIncomingState *mis, const char* rbname,
ram_addr_t start, size_t len);
#endif
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 10/10] migration: pass MigrationState to migrate_init()
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (8 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 09/10] migration: allow send_rq to fail Dr. David Alan Gilbert (git)
@ 2018-02-14 15:39 ` Dr. David Alan Gilbert (git)
2018-02-15 15:45 ` [Qemu-devel] [PULL 00/10] migration queue Peter Maydell
2018-02-16 14:25 ` Peter Maydell
11 siblings, 0 replies; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-02-14 15:39 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, ross.lagerwall
From: Peter Xu <peterx@redhat.com>
Let the callers take the object, then pass it to migrate_init().
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180208103132.28452-12-peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 7 ++-----
migration/migration.h | 2 +-
migration/savevm.c | 5 ++++-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 913f658c3e..0aa596f867 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1258,10 +1258,8 @@ bool migration_is_idle(void)
return false;
}
-MigrationState *migrate_init(void)
+void migrate_init(MigrationState *s)
{
- MigrationState *s = migrate_get_current();
-
/*
* Reinitialise all migration state, except
* parameters/capabilities that the user set, and
@@ -1291,7 +1289,6 @@ MigrationState *migrate_init(void)
s->vm_was_running = false;
s->iteration_initial_bytes = 0;
s->threshold_size = 0;
- return s;
}
static GSList *migration_blockers;
@@ -1399,7 +1396,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
migrate_set_block_incremental(s, true);
}
- s = migrate_init();
+ migrate_init(s);
if (strstart(uri, "tcp:", &p)) {
tcp_start_outgoing_migration(s, p, &local_err);
diff --git a/migration/migration.h b/migration/migration.h
index f515b8994f..82cf926b17 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -193,7 +193,7 @@ void migrate_fd_error(MigrationState *s, const Error *error);
void migrate_fd_connect(MigrationState *s, Error *error_in);
-MigrationState *migrate_init(void);
+void migrate_init(MigrationState *s);
bool migration_is_blocked(Error **errp);
/* True if outgoing migration has entered postcopy phase */
bool migration_in_postcopy(void);
diff --git a/migration/savevm.c b/migration/savevm.c
index 967c3bca0d..8e6d872452 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1257,8 +1257,11 @@ void qemu_savevm_state_cleanup(void)
static int qemu_savevm_state(QEMUFile *f, Error **errp)
{
int ret;
- MigrationState *ms = migrate_init();
+ MigrationState *ms = migrate_get_current();
MigrationStatus status;
+
+ migrate_init(ms);
+
ms->to_dst_file = f;
if (migration_is_blocked(errp)) {
--
2.14.3
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] migration queue
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (9 preceding siblings ...)
2018-02-14 15:39 ` [Qemu-devel] [PULL 10/10] migration: pass MigrationState to migrate_init() Dr. David Alan Gilbert (git)
@ 2018-02-15 15:45 ` Peter Maydell
2018-02-15 20:19 ` Dr. David Alan Gilbert
2018-02-16 14:25 ` Peter Maydell
11 siblings, 1 reply; 19+ messages in thread
From: Peter Maydell @ 2018-02-15 15:45 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git)
Cc: QEMU Developers, Juan Quintela, Peter Xu, Greg Kurz,
Ross Lagerwall
On 14 February 2018 at 15:39, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217:
>
> Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000)
>
> are available in the Git repository at:
>
> git://github.com/dagrh/qemu.git tags/pull-migration-20180214a
>
> for you to fetch changes up to 3e0c8050ebba3f55dc2d92b3790a3cfb80786d07:
>
> migration: pass MigrationState to migrate_init() (2018-02-14 10:37:09 +0000)
>
> ----------------------------------------------------------------
> Migration pull 20180214
>
> Note that the 'Add test for migration to bad destination' displays
> a 'Connection refused' during running, but still gives the correct exit
> code and OK (It's checking that the source doesn't fail when
> it can't connect, so that's the right error).
> If it's particularly disliked that patch can be skipped individually.
>
> ----------------------------------------------------------------
Hi. This fails 'make check' on aarch64 host:
QTEST_QEMU_BINARY=hppa-softmmu/qemu-system-hppa
QTEST_QEMU_IMG=qemu-img MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((
${RANDOM
:-0} % 255 + 1))} gtester -k --verbose -m=quick tests/boot-serial-test
tests/qmp-test tests/device-introspect-test test
s/qom-test tests/test-hmp
TEST: tests/boot-serial-test... (pid=2306)
/hppa/boot-serial/hppa: **
ERROR:/home/pm215/qemu/tests/boot-serial-test.c:137:check_guest_output:
assertion failed: (output_ok)
FAIL
GTester: last random seed: R02S43359b02a322915508b897be44a0e9c6
(pid=7220)
FAIL: tests/boot-serial-test
thanks
-- PMM
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] migration queue
2018-02-15 15:45 ` [Qemu-devel] [PULL 00/10] migration queue Peter Maydell
@ 2018-02-15 20:19 ` Dr. David Alan Gilbert
2018-02-16 6:14 ` Thomas Huth
0 siblings, 1 reply; 19+ messages in thread
From: Dr. David Alan Gilbert @ 2018-02-15 20:19 UTC (permalink / raw)
To: Peter Maydell
Cc: QEMU Developers, Juan Quintela, Peter Xu, Greg Kurz,
Ross Lagerwall
* Peter Maydell (peter.maydell@linaro.org) wrote:
> On 14 February 2018 at 15:39, Dr. David Alan Gilbert (git)
> <dgilbert@redhat.com> wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217:
> >
> > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000)
> >
> > are available in the Git repository at:
> >
> > git://github.com/dagrh/qemu.git tags/pull-migration-20180214a
> >
> > for you to fetch changes up to 3e0c8050ebba3f55dc2d92b3790a3cfb80786d07:
> >
> > migration: pass MigrationState to migrate_init() (2018-02-14 10:37:09 +0000)
> >
> > ----------------------------------------------------------------
> > Migration pull 20180214
> >
> > Note that the 'Add test for migration to bad destination' displays
> > a 'Connection refused' during running, but still gives the correct exit
> > code and OK (It's checking that the source doesn't fail when
> > it can't connect, so that's the right error).
> > If it's particularly disliked that patch can be skipped individually.
> >
> > ----------------------------------------------------------------
>
> Hi. This fails 'make check' on aarch64 host:
> QTEST_QEMU_BINARY=hppa-softmmu/qemu-system-hppa
> QTEST_QEMU_IMG=qemu-img MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((
> ${RANDOM
> :-0} % 255 + 1))} gtester -k --verbose -m=quick tests/boot-serial-test
> tests/qmp-test tests/device-introspect-test test
> s/qom-test tests/test-hmp
> TEST: tests/boot-serial-test... (pid=2306)
> /hppa/boot-serial/hppa: **
> ERROR:/home/pm215/qemu/tests/boot-serial-test.c:137:check_guest_output:
> assertion failed: (output_ok)
> FAIL
> GTester: last random seed: R02S43359b02a322915508b897be44a0e9c6
> (pid=7220)
> FAIL: tests/boot-serial-test
I can't obviously see a reason why it should in any way affect that
test; however I'll try and grab an aarch64 box tomorrow.
Dave
>
>
> thanks
> -- PMM
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] migration queue
2018-02-15 20:19 ` Dr. David Alan Gilbert
@ 2018-02-16 6:14 ` Thomas Huth
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2018-02-16 6:14 UTC (permalink / raw)
To: Dr. David Alan Gilbert, Peter Maydell
Cc: Ross Lagerwall, Greg Kurz, QEMU Developers, Peter Xu,
Juan Quintela
On 15.02.2018 21:19, Dr. David Alan Gilbert wrote:
> * Peter Maydell (peter.maydell@linaro.org) wrote:
>> On 14 February 2018 at 15:39, Dr. David Alan Gilbert (git)
>> <dgilbert@redhat.com> wrote:
>>> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>>>
>>> The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217:
>>>
>>> Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000)
>>>
>>> are available in the Git repository at:
>>>
>>> git://github.com/dagrh/qemu.git tags/pull-migration-20180214a
>>>
>>> for you to fetch changes up to 3e0c8050ebba3f55dc2d92b3790a3cfb80786d07:
>>>
>>> migration: pass MigrationState to migrate_init() (2018-02-14 10:37:09 +0000)
>>>
>>> ----------------------------------------------------------------
>>> Migration pull 20180214
>>>
>>> Note that the 'Add test for migration to bad destination' displays
>>> a 'Connection refused' during running, but still gives the correct exit
>>> code and OK (It's checking that the source doesn't fail when
>>> it can't connect, so that's the right error).
>>> If it's particularly disliked that patch can be skipped individually.
>>>
>>> ----------------------------------------------------------------
>>
>> Hi. This fails 'make check' on aarch64 host:
>> QTEST_QEMU_BINARY=hppa-softmmu/qemu-system-hppa
>> QTEST_QEMU_IMG=qemu-img MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((
>> ${RANDOM
>> :-0} % 255 + 1))} gtester -k --verbose -m=quick tests/boot-serial-test
>> tests/qmp-test tests/device-introspect-test test
>> s/qom-test tests/test-hmp
>> TEST: tests/boot-serial-test... (pid=2306)
>> /hppa/boot-serial/hppa: **
>> ERROR:/home/pm215/qemu/tests/boot-serial-test.c:137:check_guest_output:
>> assertion failed: (output_ok)
>> FAIL
>> GTester: last random seed: R02S43359b02a322915508b897be44a0e9c6
>> (pid=7220)
>> FAIL: tests/boot-serial-test
>
> I can't obviously see a reason why it should in any way affect that
> test; however I'll try and grab an aarch64 box tomorrow.
For the records: It's a bug in the boot-serial tester. I've just sent a
mail with a fix: "tests/boot-serial-test: Fix problem with timeout due
to dropped characters".
Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] migration queue
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
` (10 preceding siblings ...)
2018-02-15 15:45 ` [Qemu-devel] [PULL 00/10] migration queue Peter Maydell
@ 2018-02-16 14:25 ` Peter Maydell
11 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2018-02-16 14:25 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git)
Cc: QEMU Developers, Juan Quintela, Peter Xu, Greg Kurz,
Ross Lagerwall
On 14 February 2018 at 15:39, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217:
>
> Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000)
>
> are available in the Git repository at:
>
> git://github.com/dagrh/qemu.git tags/pull-migration-20180214a
>
> for you to fetch changes up to 3e0c8050ebba3f55dc2d92b3790a3cfb80786d07:
>
> migration: pass MigrationState to migrate_init() (2018-02-14 10:37:09 +0000)
>
> ----------------------------------------------------------------
> Migration pull 20180214
>
> Note that the 'Add test for migration to bad destination' displays
> a 'Connection refused' during running, but still gives the correct exit
> code and OK (It's checking that the source doesn't fail when
> it can't connect, so that's the right error).
> If it's particularly disliked that patch can be skipped individually.
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Qemu-devel] [PULL 00/10] migration queue
@ 2018-06-15 15:15 Dr. David Alan Gilbert (git)
2018-06-15 18:23 ` Peter Maydell
0 siblings, 1 reply; 19+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-06-15 15:15 UTC (permalink / raw)
To: qemu-devel, quintela, peterx, groug, vsementsov, xiaoguangrong,
bala24
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The following changes since commit 2702c2d3eb74e3908c0c5dbf3a71c8987595a86e:
Merge remote-tracking branch 'remotes/stsquad/tags/pull-travis-updates-140618-1' into staging (2018-06-15 12:49:36 +0100)
are available in the Git repository at:
git://github.com/dagrh/qemu.git tags/pull-migration-20180615a
for you to fetch changes up to 650af8907bd567db914b7ce3a7e9df4c323f4619:
migration: calculate expected_downtime with ram_bytes_remaining() (2018-06-15 14:40:56 +0100)
----------------------------------------------------------------
Migration pull 2018-06-15
----------------------------------------------------------------
Balamuruhan S (1):
migration: calculate expected_downtime with ram_bytes_remaining()
Dr. David Alan Gilbert (5):
migration: Fixes for non-migratable RAMBlocks
migration: Poison ramblock loops in migration
migration/postcopy: Add max-postcopy-bandwidth parameter
migration: Wake rate limiting for urgent requests
migration/postcopy: Wake rate limit sleep on postcopy request
Greg Kurz (1):
typedefs: add QJSON
Vladimir Sementsov-Ogievskiy (1):
migration/block-dirty-bitmap: fix dirty_bitmap_load
Xiao Guangrong (2):
migration: fix counting xbzrle cache_miss_rate
migration: introduce migration_update_rates
hmp.c | 7 ++++
include/exec/ramlist.h | 4 ++-
include/migration/vmstate.h | 2 --
include/qemu/typedefs.h | 1 +
migration/block-dirty-bitmap.c | 3 ++
migration/migration.c | 73 ++++++++++++++++++++++++++++++++++++++----
migration/migration.h | 11 +++++++
migration/qjson.h | 2 --
migration/ram.c | 53 ++++++++++++++++++++----------
migration/rdma.c | 2 +-
migration/trace-events | 2 ++
qapi/migration.json | 19 +++++++++--
12 files changed, 146 insertions(+), 33 deletions(-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Qemu-devel] [PULL 00/10] migration queue
2018-06-15 15:15 Dr. David Alan Gilbert (git)
@ 2018-06-15 18:23 ` Peter Maydell
0 siblings, 0 replies; 19+ messages in thread
From: Peter Maydell @ 2018-06-15 18:23 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git)
Cc: QEMU Developers, Juan Quintela, Peter Xu, Greg Kurz,
Vladimir Sementsov-Ogievskiy, xiaoguangrong, bala24
On 15 June 2018 at 16:15, Dr. David Alan Gilbert (git)
<dgilbert@redhat.com> wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The following changes since commit 2702c2d3eb74e3908c0c5dbf3a71c8987595a86e:
>
> Merge remote-tracking branch 'remotes/stsquad/tags/pull-travis-updates-140618-1' into staging (2018-06-15 12:49:36 +0100)
>
> are available in the Git repository at:
>
> git://github.com/dagrh/qemu.git tags/pull-migration-20180615a
>
> for you to fetch changes up to 650af8907bd567db914b7ce3a7e9df4c323f4619:
>
> migration: calculate expected_downtime with ram_bytes_remaining() (2018-06-15 14:40:56 +0100)
>
> ----------------------------------------------------------------
> Migration pull 2018-06-15
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2018-06-15 18:24 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 02/10] migration: improve documentation of postcopy-ram Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 03/10] tests/migration: Add source to PC boot block Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 04/10] migration: Fix early failure cleanup Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 05/10] tests/migration: Add test for migration to bad destination Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 06/10] migration: better error handling with QEMUFile Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 07/10] migration: reuse mis->userfault_quit_fd Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 08/10] migration: provide postcopy_fault_thread_notify() Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 09/10] migration: allow send_rq to fail Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 10/10] migration: pass MigrationState to migrate_init() Dr. David Alan Gilbert (git)
2018-02-15 15:45 ` [Qemu-devel] [PULL 00/10] migration queue Peter Maydell
2018-02-15 20:19 ` Dr. David Alan Gilbert
2018-02-16 6:14 ` Thomas Huth
2018-02-16 14:25 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2018-06-15 15:15 Dr. David Alan Gilbert (git)
2018-06-15 18:23 ` Peter Maydell
2015-02-05 16:24 [Qemu-devel] [PULL 00/10] Migration queue Juan Quintela
2015-02-06 10:38 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).