Skip to contentSkip to conversation

migration: Don't try and recover return path in non-postcopy

PATCH In review Dr. David Alan Gilbert (git) 3 participants 4 messages Oct 7, 2019 – Oct 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: Don't try and recover return path in non-postcopy

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

In normal precopy we can't do reconnection recovery - but we also don't need to, since you can just rerun migration.
At the moment if the 'return-path' capability is on, we use the return path in precopy to give a postiive 'OK' to the end of migration; however if migration fails then we fall into the postcopy recovery path and hang. This fixes it by only running the return path in the postcopy case.

---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index 5f7e4d15e9..d5d9b31bb7 100644
@@ -2481,7 +2481,7 @@ retry:
 out:
     res = qemu_file_get_error(rp);
     if (res) {
-        if (res == -EIO) {
+        if (res == -EIO && migration_in_postcopy()) {
             /*
              * Maybe there is something we can do: it looks like a
              * network down issue, and we pause for a recovery.
Signature · 1 line
2.21.0
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Mon, 7 Oct 2019 11:35:07 +0100 "Dr. David Alan Gilbert (git)"…

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

In normal precopy we can't do reconnection recovery - but we also don't need to, since you can just rerun migration.
At the moment if the 'return-path' capability is on, we use the return path in precopy to give a postiive 'OK' to the end

s/postiive/positive

Quoted 7 lines

of migration; however if migration fails then we fall into the postcopy recovery path and hang. This fixes it by only running the return path in the postcopy case.

---

Thanks !

Quoted 16 lines
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index 5f7e4d15e9..d5d9b31bb7 100644
@@ -2481,7 +2481,7 @@ retry:
 out:
     res = qemu_file_get_error(rp);
     if (res) {
-        if (res == -EIO) {
+        if (res == -EIO && migration_in_postcopy()) {
             /*
              * Maybe there is something we can do: it looks like a
              * network down issue, and we pause for a recovery.
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 21 lines · Dr. David Alan Gilbert (git)

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

In normal precopy we can't do reconnection recovery - but we also don't need to, since you can just rerun migration.
At the moment if the 'return-path' capability is on, we use the return path in precopy to give a postiive 'OK' to the end of migration; however if migration fails then we fall into the postcopy recovery path and hang. This fixes it by only running the return path in the postcopy case.

---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +0 -0
index 5f7e4d15e9..d5d9b31bb7 100644

migration/migration.c retry: · line 2484

Quoted 5 lines
migration/migration.c +1 -1
@@ -2481,7 +2481,7 @@ retry:
 out:
     res = qemu_file_get_error(rp);
     if (res) {
-        if (res == -EIO) {
+        if (res == -EIO && migration_in_postcopy()) {

Makes sense! I saw that in qemu_loadvm_state_main() we're using (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING) to check. That also makes sense because I think we can't really do the recover if the migration stream failed at status like POSTCOPY_INCOMING_DISCARD even if it switched to POSTCOPY_ACTIVE... However that should really be a very corner case even if it's true, and afaict it's nowhere worse...

Signature · 1 line
Peter Xu
#3 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 10 lines · * Dr. David Alan Gilbert (git) ([email protected]) wrote:

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

In normal precopy we can't do reconnection recovery - but we also don't need to, since you can just rerun migration.
At the moment if the 'return-path' capability is on, we use the return path in precopy to give a postiive 'OK' to the end of migration; however if migration fails then we fall into the postcopy recovery path and hang. This fixes it by only running the return path in the postcopy case.

Quoted 2 lines

Queued

Quoted 21 lines
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index 5f7e4d15e9..d5d9b31bb7 100644
@@ -2481,7 +2481,7 @@ retry:
 out:
     res = qemu_file_get_error(rp);
     if (res) {
-        if (res == -EIO) {
+        if (res == -EIO && migration_in_postcopy()) {
             /*
              * Maybe there is something we can do: it looks like a
              * network down issue, and we pause for a recovery.
Signature · 1 line
2.21.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK