Skip to contentSkip to conversation

migration/qmp: Update "resume" flag doc in "migrate" command

PATCH In review Peter Xu 2 participants 7 messages Oct 22, 2025 – Oct 23, 2025

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH 1/1 migration/qmp: Update "resume" flag doc in "migrate" command

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qapi/migration.json +4 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #
Signature · 1 line
2.50.1
#1 lore raw
Quoted 14 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qapi/migration.json +0 -0
index be0f3fcc12..48856078db 100644

qapi/migration.json line 1735

Quoted 5 lines
qapi/migration.json +1 -1
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

qapi/migration.json line 1741

Quoted 6 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

Remind me, how can migration get into and out of this state?

author
#2 lore raw
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 12 lines

qapi/migration.json line 1735

Quoted 10 lines
qapi/migration.json +1 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

Sure.

Quoted 9 lines

qapi/migration.json line 1741

Quoted 7 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

The QMP command "migrate" with resume=true set will be rejected, corresponds to:

migrate_prepare():

        if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
            error_setg(errp, "Cannot resume if there is no "
                       "paused migration");
            return false;
        }
Quoted 2 lines

Remind me, how can migration get into and out of this state?

It can happen if any interruption happened during a postcopy migration. So it needs to be postcopy-active state first, then something wrong happened e.g. the network is down. Then the channel will break on both sides of QEMU, and both QEMUs will jump into postcopy-paused.

To get out of the state, one needs to explicitly recover the migration, the core steps are:

- (optional) Run migrate_recover on dest QEMU to re-establish the ports, if the old listening ports are not available anymore.

- Run migrate on src QEMU with resume=true flag here to resume the postcopy migration.

If the recover succeeded, it'll switch from postcopy-paused finally back to postcopy-active.

Thanks,

Signature · 1 line
Peter Xu
#3 lore raw
Quoted 40 lines · Peter Xu
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 12 lines

qapi/migration.json line 1735

Quoted 10 lines
qapi/migration.json +1 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

Sure.

Quoted 9 lines

qapi/migration.json line 1741

Quoted 7 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

The QMP command "migrate" with resume=true set will be rejected, corresponds to:

Quoted 6 lines

migrate_prepare():

        if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
            error_setg(errp, "Cannot resume if there is no "
                       "paused migration");
            return false;
        }

Makes sense, thanks!

I'd suggest something like 'Resume fails unless migration is in "postcopy-paused" state. (default: false, since 3.0)'

Quoted 13 lines
Quoted 1 line

Remind me, how can migration get into and out of this state?

It can happen if any interruption happened during a postcopy migration. So it needs to be postcopy-active state first, then something wrong happened e.g. the network is down. Then the channel will break on both sides of QEMU, and both QEMUs will jump into postcopy-paused.

To get out of the state, one needs to explicitly recover the migration, the core steps are:

- (optional) Run migrate_recover on dest QEMU to re-establish the ports, if the old listening ports are not available anymore.

Quoted 7 lines

- Run migrate on src QEMU with resume=true flag here to resume the postcopy migration.

If the recover succeeded, it'll switch from postcopy-paused finally back to postcopy-active.

Thanks,

Got it, thanks!

author
#4 lore raw
Quoted 49 lines · Markus Armbruster
Quoted 40 lines · Peter Xu
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 12 lines

qapi/migration.json line 1735

Quoted 10 lines
qapi/migration.json +1 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

Sure.

Quoted 9 lines

qapi/migration.json line 1741

Quoted 7 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

The QMP command "migrate" with resume=true set will be rejected, corresponds to:

Quoted 6 lines

migrate_prepare():

        if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
            error_setg(errp, "Cannot resume if there is no "
                       "paused migration");
            return false;
        }
Quoted 4 lines

Makes sense, thanks!

I'd suggest something like 'Resume fails unless migration is in "postcopy-paused" state. (default: false, since 3.0)'

Since it's still a "migrate" QMP command, should I use "the command will fail"? I also re-arranged the words slightly.. would below look a better next version as a whole?

# @resume: when set, use the new uri/channels specified to resume paused

#     postcopy migration.  This flag should only be used if the previous
#     postcopy migration was interrupted.  The command will fail unless
#     migration is in "postcopy-paused" state.  (default: false, since 3.0)

Thanks,

Signature · 1 line
Peter Xu
Reviewed-by
#5 lore raw
Quoted 59 lines · Peter Xu
Quoted 49 lines · Markus Armbruster
Quoted 40 lines · Peter Xu
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 12 lines

qapi/migration.json line 1735

Quoted 10 lines
qapi/migration.json +1 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

Sure.

Quoted 9 lines

qapi/migration.json line 1741

Quoted 7 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

The QMP command "migrate" with resume=true set will be rejected, corresponds to:

Quoted 6 lines

migrate_prepare():

        if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
            error_setg(errp, "Cannot resume if there is no "
                       "paused migration");
            return false;
        }
Quoted 4 lines

Makes sense, thanks!

I'd suggest something like 'Resume fails unless migration is in "postcopy-paused" state. (default: false, since 3.0)'

Since it's still a "migrate" QMP command, should I use "the command will fail"? I also re-arranged the words slightly.. would below look a better next version as a whole?

Quoted 6 lines

# @resume: when set, use the new uri/channels specified to resume paused

#     postcopy migration.  This flag should only be used if the previous
#     postcopy migration was interrupted.  The command will fail unless
#     migration is in "postcopy-paused" state.  (default: false, since 3.0)

Thanks,

I like it.

author
#6 lore raw
Quoted 66 lines · Markus Armbruster
Quoted 64 lines · Peter Xu
Quoted 49 lines · Markus Armbruster
Quoted 40 lines · Peter Xu
Quoted 11 lines · Markus Armbruster
Quoted 9 lines · Peter Xu

It wasn't obvious how the resume flag should be used when staring at the QAPI doc. Enrich it to be crystal clear.

---
 qapi/migration.json | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 12 lines

qapi/migration.json line 1735

Quoted 10 lines
qapi/migration.json +1 -1
index be0f3fcc12..48856078db 100644
@@ -1732,7 +1732,10 @@
 # @detach: this argument exists only for compatibility reasons and is
 #     ignored by QEMU
 #
-# @resume: resume one paused migration, default "off".  (since 3.0)
+# @resume: when set, resume one paused postcopy migration, using the new

Scratch "one" unless there can be more than one.

Sure.

Quoted 9 lines

qapi/migration.json line 1741

Quoted 7 lines
qapi/migration.json +3 -0
+#     URI/channels specified to replace the old/broken channels.  The user
+#     should make sure the migration is in "postcopy-paused" state before
+#     the resume request.  Default "off".  (since 3.0)
 #
 # Features:
 #

What happens when migration is not in state "postcopy-paused"?

The QMP command "migrate" with resume=true set will be rejected, corresponds to:

Quoted 6 lines

migrate_prepare():

        if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
            error_setg(errp, "Cannot resume if there is no "
                       "paused migration");
            return false;
        }
Quoted 4 lines

Makes sense, thanks!

I'd suggest something like 'Resume fails unless migration is in "postcopy-paused" state. (default: false, since 3.0)'

Since it's still a "migrate" QMP command, should I use "the command will fail"? I also re-arranged the words slightly.. would below look a better next version as a whole?

# @resume: when set, use the new uri/channels specified to resume paused

#     postcopy migration.  This flag should only be used if the previous
#     postcopy migration was interrupted.  The command will fail unless
#     migration is in "postcopy-paused" state.  (default: false, since 3.0)
Quoted 5 lines
Quoted 1 line

Thanks,

I like it.

Rather than a new resend to bother everyone, I'll just queue it with the amended version and the tag.. thanks Markus!

Signature · 1 line
Peter Xu