Skip to contentSkip to conversation

migration queue

GIT PULL Applied Dr. David Alan Gilbert (git) 2 participants 5 messages Oct 31, 2018 – Nov 2, 2018

lore
Share & tools
lore
#0 lore raw

From: "Dr. David Alan Gilbert" <[email protected]>

The following changes since commit a2e002ff7913ce93aa0f7dbedd2123dce5f1a9cd:

Merge remote-tracking branch 'remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request' into staging (2018-10-30 15:49:55 +0000)

are available in the Git repository at:

git://github.com/dagrh/qemu.git tags/pull-migration-20181031a

for you to fetch changes up to 3d63da16fbcd05405efd5946000cdb45474a9bad:

migration: avoid segmentfault when take a snapshot of a VM which being migrated (2018-10-31 09:38:59 +0000)

----------------------------------------------------------------
Minor migration fixes 2018-10-31

----------------------------------------------------------------
Jia Lina (1):
migration: avoid segmentfault when take a snapshot of a VM which being migrated

Zhang Chen (1):
qapi: Fix COLOStatus and query-colo-status since version

wangguang (1):
COLO: Fix Colo doc secondeary should be secondary

 docs/COLO-FT.txt      |  2 +-
 migration/migration.c |  2 +-
 migration/migration.h |  2 ++
 migration/savevm.c    | 19 +++++++++++--------
 qapi/migration.json   |  4 ++--
 5 files changed, 17 insertions(+), 12 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/3] COLO: Fix Colo doc secondeary should be secondary

From: wangguang <[email protected]>

---
 docs/COLO-FT.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/COLO-FT.txt +1 -1
index 6302469d0e..e2686bb338 100644
@@ -173,7 +173,7 @@ Secondary:
 { 'execute': 'nbd-server-start',
   'arguments': {'addr': {'type': 'inet', 'data': {'host': 'xx.xx.xx.xx', 'port': '8889'} } }
 }
-{'execute': 'nbd-server-add', 'arguments': {'device': 'secondeary-disk0', 'writable': true } }
+{'execute': 'nbd-server-add', 'arguments': {'device': 'secondary-disk0', 'writable': true } }
 
 Note:
   a. The qmp command nbd-server-start and nbd-server-add must be run
Signature · 1 line
2.19.1
#2 lore raw

[Qemu-devel] [PULL 2/3] qapi: Fix COLOStatus and query-colo-status since version

In reply to Dr. David Alan Gilbert (git)

From: Zhang Chen <[email protected]>

This structure and command have missed qemu version 3.0, so fix it to since version 3.1.

Message-Id: <[email protected]>

---
 qapi/migration.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qapi/migration.json +2 -2
index 0928f4b727..38d4c41d88 100644
@@ -1317,7 +1317,7 @@
 #
 # @reason: describes the reason for the COLO exit.
 #
-# Since: 3.0
+# Since: 3.1
 ##
 { 'struct': 'COLOStatus',
   'data': { 'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
@@ -1334,7 +1334,7 @@
 # -> { "execute": "query-colo-status" }
 # <- { "return": { "mode": "primary", "active": true, "reason": "request" } }
 #
-# Since: 3.0
+# Since: 3.1
 ##
 { 'command': 'query-colo-status',
   'returns': 'COLOStatus' }
Signature · 1 line
2.19.1
#3 lore raw

[Qemu-devel] [PULL 3/3] migration: avoid segmentfault when take a snapshot of a VM which being migrated

In reply to Dr. David Alan Gilbert (git)

From: Jia Lina <[email protected]>

During an active background migration, snapshot will trigger a segmentfault. As snapshot clears the "current_migration" struct and updates "to_dst_file" before it finds out that there is a migration task, Migration accesses the null pointer in "current_migration" struct and qemu crashes eventually.

Message-Id: <[email protected]>

---
 migration/migration.c |  2 +-
 migration/migration.h |  2 ++
 migration/savevm.c    | 19 +++++++++++--------
 3 files changed, 14 insertions(+), 9 deletions(-)
migration/migration.c +1 -1
index 8b36e7f184..b261c1e4ce 100644
@@ -742,7 +742,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
  * Return true if we're already in the middle of a migration
  * (i.e. any of the active or setup states)
  */
-static bool migration_is_setup_or_active(int state)
+bool migration_is_setup_or_active(int state)
 {
     switch (state) {
     case MIGRATION_STATUS_ACTIVE:
migration/migration.h +2 -0
index f7813f8261..e413d4d8b6 100644
@@ -241,6 +241,8 @@ void migrate_fd_error(MigrationState *s, const Error *error);
 
 void migrate_fd_connect(MigrationState *s, Error *error_in);
 
+bool migration_is_setup_or_active(int state);
+
 void migrate_init(MigrationState *s);
 bool migration_is_blocked(Error **errp);
 /* True if outgoing migration has entered postcopy phase */
migration/savevm.c +11 -8
index 9992af4db4..ef707b8c43 100644
@@ -1327,21 +1327,25 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
     MigrationState *ms = migrate_get_current();
     MigrationStatus status;
 
-    migrate_init(ms);
-
-    ms->to_dst_file = f;
+    if (migration_is_setup_or_active(ms->state) ||
+        ms->state == MIGRATION_STATUS_CANCELLING ||
+        ms->state == MIGRATION_STATUS_COLO) {
+        error_setg(errp, QERR_MIGRATION_ACTIVE);
+        return -EINVAL;
+    }
 
     if (migration_is_blocked(errp)) {
-        ret = -EINVAL;
-        goto done;
+        return -EINVAL;
     }
 
     if (migrate_use_block()) {
         error_setg(errp, "Block migration and snapshots are incompatible");
-        ret = -EINVAL;
-        goto done;
+        return -EINVAL;
     }
 
+    migrate_init(ms);
+    ms->to_dst_file = f;
+
     qemu_mutex_unlock_iothread();
     qemu_savevm_state_header(f);
     qemu_savevm_state_setup(f);
@@ -1363,7 +1367,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
         error_setg_errno(errp, -ret, "Error while writing VM state");
     }
 
-done:
     if (ret != 0) {
         status = MIGRATION_STATUS_FAILED;
     } else {
Signature · 1 line
2.19.1
#4 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 10 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

The following changes since commit a2e002ff7913ce93aa0f7dbedd2123dce5f1a9cd:

Merge remote-tracking branch 'remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request' into staging (2018-10-30 15:49:55 +0000)

are available in the Git repository at:

git://github.com/dagrh/qemu.git tags/pull-migration-20181031a

Quoted 8 lines

for you to fetch changes up to 3d63da16fbcd05405efd5946000cdb45474a9bad:

migration: avoid segmentfault when take a snapshot of a VM which being migrated (2018-10-31 09:38:59 +0000)

----------------------------------------------------------------
Minor migration fixes 2018-10-31

----------------------------------------------------------------

Applied, thanks.

-- PMM