Skip to contentSkip to conversation

migrate_incoming cleanups

PATCH In review Dr. David Alan Gilbert (git) 5 participants 10 messages Feb 26, 2015 – Mar 17, 2015

lore
Share & tools
lore
#0 lore raw

cover migrate_incoming cleanups

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

This is a series of minor fixes from Markus's review:
http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg04079.html

To be applied after the exisitng set of -incoming defer patches.

Dr. David Alan Gilbert (3):
migrate_incoming: use hmp_handle_error
Warn against the use of the string as uri parameter to
migrate-incoming
migrate_incoming: Cleanup/clarify error messages

 hmp.c                 | 6 +-----
 migration/migration.c | 8 ++++++--
 qapi-schema.json      | 3 +++
 3 files changed, 10 insertions(+), 7 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/3 migrate_incoming: use hmp_handle_error

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

---
 hmp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
hmp.c +1 -5
index 761e5ef..e713e06 100644
@@ -1091,11 +1091,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
 
     qmp_migrate_incoming(uri, &err);
 
-    if (err) {
-        monitor_printf(mon, "%s\n", error_get_pretty(err));
-        error_free(err);
-        return;
-    }
+    hmp_handle_error(mon, &err);
 }
 
 void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/3 Warn against the use of the string as uri parameter to migrate-incoming

In reply to Dr. David Alan Gilbert (git)

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

---
 qapi-schema.json | 3 +++
 1 file changed, 3 insertions(+)
qapi-schema.json +3 -0
index 7a80081..cfd59d0 100644
@@ -1750,6 +1750,9 @@
 # Returns: nothing on success
 #
 # Since: 2.3
+# Note: It's a bad idea to use a string for the uri, but it needs to stay
+# compatible with -incoming and the format of the uri is already exposed
+# above libvirt
 ##
 { 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
 
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/3 migrate_incoming: Cleanup/clarify error messages

In reply to Dr. David Alan Gilbert (git)

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

Create a separate error for the case where migrate_incoming is used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing to omit the command name so it's right for both hmp and qmp.

---
 migration/migration.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
migration/migration.c +6 -2
index 2c805f1..e6ac3de 100644
@@ -435,11 +435,15 @@ void migrate_del_blocker(Error *reason)
 void qmp_migrate_incoming(const char *uri, Error **errp)
 {
     Error *local_err = NULL;
+    static bool once = true;
 
     if (!deferred_incoming) {
-        error_setg(errp, "'-incoming defer' is required for migrate_incoming");
+        error_setg(errp, "For use with '-incoming defer'");
         return;
     }
+    if (!once) {
+        error_setg(errp, "The incoming migration has already been started");
+    }
 
     qemu_start_incoming_migration(uri, &local_err);
 
@@ -448,7 +452,7 @@ void qmp_migrate_incoming(const char *uri, Error **errp)
         return;
     }
 
-    deferred_incoming = false;
+    once = false;
 }
 
 void qmp_migrate(const char *uri, bool has_blk, bool blk,
Signature · 1 line
2.1.0
#4 lore raw

Re: [Qemu-devel] [PATCH 3/3] migrate_incoming: Cleanup/clarify error messages

Quoted 20 lines · Dr. David Alan Gilbert (git)

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

Create a separate error for the case where migrate_incoming is used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing to omit the command name so it's right for both hmp and qmp.

---
 migration/migration.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
migration/migration.c +0 -0
index 2c805f1..e6ac3de 100644
@@ -435,11 +435,15 @@ void migrate_del_blocker(Error *reason)
 void qmp_migrate_incoming(const char *uri, Error **errp)
 {

migration/migration.c void migrate_del_blocker(Error *reason) · line 445

Quoted 10 lines
migration/migration.c +4 -1
     Error *local_err = NULL;
+    static bool once = true;
 
     if (!deferred_incoming) {
-        error_setg(errp, "'-incoming defer' is required for migrate_incoming");
+        error_setg(errp, "For use with '-incoming defer'");
         return;
     }
+    if (!once) {
+        error_setg(errp, "The incoming migration has already been started");

Let me apologise in advance for picking on another error message...

This reads like we already have an incoming migration, when we mean we just have a URI for one.

Amit

#5 lore raw

Re: [Qemu-devel] [PATCH 3/3] migrate_incoming: Cleanup/clarify error messages

Quoted 34 lines · * Amit Shah ([email protected]) wrote:
Quoted 20 lines · Dr. David Alan Gilbert (git)

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

Create a separate error for the case where migrate_incoming is used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing to omit the command name so it's right for both hmp and qmp.

---
 migration/migration.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
migration/migration.c +0 -0
index 2c805f1..e6ac3de 100644
@@ -435,11 +435,15 @@ void migrate_del_blocker(Error *reason)
 void qmp_migrate_incoming(const char *uri, Error **errp)
 {

migration/migration.c void migrate_del_blocker(Error *reason) · line 445

Quoted 10 lines
migration/migration.c +4 -1
     Error *local_err = NULL;
+    static bool once = true;
 
     if (!deferred_incoming) {
-        error_setg(errp, "'-incoming defer' is required for migrate_incoming");
+        error_setg(errp, "For use with '-incoming defer'");
         return;
     }
+    if (!once) {
+        error_setg(errp, "The incoming migration has already been started");

Let me apologise in advance for picking on another error message...

Quoted 2 lines

This reads like we already have an incoming migration, when we mean we just have a URI for one.

No, if you hit this error you have at least started listening on the connection.

Dave

Quoted 2 lines

Amit

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

Reviewed-by on the v1 series
#6 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 7 lines · Dr. David Alan Gilbert (git)

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

This is a series of minor fixes from Markus's review:
http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg04079.html

To be applied after the exisitng set of -incoming defer patches.

You haven't addressed my review of "[PATCH v3 3/3] Document -incoming options", yet.

Reviewed-by on the v1 series
#7 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 7 lines · Dr. David Alan Gilbert (git)

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

This is a series of minor fixes from Markus's review:
http://lists.gnu.org/archive/html/qemu-devel/2015-02/msg04079.html

To be applied after the exisitng set of -incoming defer patches.

Quoted 12 lines

Dr. David Alan Gilbert (3):
migrate_incoming: use hmp_handle_error
Warn against the use of the string as uri parameter to
migrate-incoming
migrate_incoming: Cleanup/clarify error messages

 hmp.c                 | 6 +-----
 migration/migration.c | 8 ++++++--
 qapi-schema.json      | 3 +++
 3 files changed, 10 insertions(+), 7 deletions(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org