Skip to contentSkip to conversation

Update COLO related API

PATCH In review Zhang Chen 2 participants 7 messages Mar 17, 2017 – Mar 20, 2017

lore
Share & tools
lore

Zhang Chen

author
#0 lore raw

cover Update COLO related API

After related patch merged by Xen, qemu side patch got some comments to change the API in qemu community. So we update Xen side codes.

Qemu patchs:
https://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg07654.html

Zhang Chen (2):
libxl/libxl_qmp.c: Update COLO do checkpoint API libxl/libxl_qmp.c: Update COLO query replication status API

 tools/libxl/libxl_colo_restore.c | 4 ++--
 tools/libxl/libxl_colo_save.c    | 5 +++--
 tools/libxl/libxl_internal.h     | 4 ++--
 tools/libxl/libxl_qmp.c          | 9 +++++----
 4 files changed, 12 insertions(+), 10 deletions(-)
Signature · 9 lines
2.7.4




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

PATCH 1/2 libxl/libxl_qmp.c: Update COLO do checkpoint API

Because of qemu side patch changed the API that comment by community, So we fix it in Xen side.

---
 tools/libxl/libxl_colo_restore.c | 2 +-
 tools/libxl/libxl_colo_save.c    | 2 +-
 tools/libxl/libxl_internal.h     | 2 +-
 tools/libxl/libxl_qmp.c          | 5 +++--
 4 files changed, 6 insertions(+), 5 deletions(-)
tools/libxl/libxl_colo_restore.c +1 -1
index 065ea00..7178ae9 100644
@@ -607,7 +607,7 @@ static void colo_restore_preresume_cb(libxl__egc *egc,
     }
 
     if (crs->qdisk_setuped) {
-        if (libxl__qmp_do_checkpoint(gc, crs->domid)) {
+        if (libxl__qmp_colo_do_checkpoint(gc, crs->domid)) {
             LOGD(ERROR, crs->domid, "doing checkpoint fails");
             goto out;
         }
tools/libxl/libxl_colo_save.c +1 -1
index b4ca9f6..eabc04c 100644
@@ -460,7 +460,7 @@ static void colo_preresume_cb(libxl__egc *egc,
     }
 
     if (!css->paused) {
-        if (libxl__qmp_do_checkpoint(gc, dss->domid)) {
+        if (libxl__qmp_colo_do_checkpoint(gc, dss->domid)) {
             LOGD(ERROR, dss->domid, "doing checkpoint fails");
             goto out;
         }
tools/libxl/libxl_internal.h +1 -1
index 7722665..9fc05e7 100644
@@ -1831,7 +1831,7 @@ _hidden int libxl__qmp_start_replication(libxl__gc *gc, int domid,
 /* Get replication error that occurs when the vm is running */
 _hidden int libxl__qmp_get_replication_error(libxl__gc *gc, int domid);
 /* Do checkpoint */
-_hidden int libxl__qmp_do_checkpoint(libxl__gc *gc, int domid);
+_hidden int libxl__qmp_colo_do_checkpoint(libxl__gc *gc, int domid);
 /* Stop replication */
 _hidden int libxl__qmp_stop_replication(libxl__gc *gc, int domid,
                                         bool primary);
tools/libxl/libxl_qmp.c +3 -2
index a91643a..eef7722 100644
@@ -1085,9 +1085,10 @@ int libxl__qmp_get_replication_error(libxl__gc *gc, int domid)
                            NULL, NULL);
 }
 
-int libxl__qmp_do_checkpoint(libxl__gc *gc, int domid)
+int libxl__qmp_colo_do_checkpoint(libxl__gc *gc, int domid)
 {
-    return qmp_run_command(gc, domid, "xen-do-checkpoint", NULL, NULL, NULL);
+    return qmp_run_command(gc, domid, "xen-colo-do-checkpoint",
+                           NULL, NULL, NULL);
 }
 
 int libxl__qmp_stop_replication(libxl__gc *gc, int domid, bool primary)
Signature · 9 lines
2.7.4




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

Re: [PATCH 1/2] libxl/libxl_qmp.c: Update COLO do checkpoint API

Quoted 4 lines · Zhang Chen

Because of qemu side patch changed the API that comment by community, So we fix it in Xen side.

Code-wise this patch looks OK, but I can't parse the commit message.

May I suggest you change the commit message (per my understanding) to:

The QEMU community has asked us to change the QMP command from xen-do-checkpoint to xen-colo-do-checkpoint. Modify Xen side to use the new name.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#3 lore raw

PATCH 2/2 libxl/libxl_qmp.c: Update COLO query replication status API

In reply to Zhang Chen

Because of qemu side patch changed the API that comment by community, So we fix it in Xen side.

---
 tools/libxl/libxl_colo_restore.c | 2 +-
 tools/libxl/libxl_colo_save.c    | 3 ++-
 tools/libxl/libxl_internal.h     | 2 +-
 tools/libxl/libxl_qmp.c          | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)
tools/libxl/libxl_colo_restore.c +1 -1
index 7178ae9..0c535bd 100644
@@ -986,7 +986,7 @@ static void colo_suspend_vm_done(libxl__egc *egc,
 
     crcs->status = LIBXL_COLO_SUSPENDED;
 
-    if (libxl__qmp_get_replication_error(gc, crs->domid)) {
+    if (libxl__qmp_query_xen_replication_status(gc, crs->domid)) {
         LOGD(ERROR, crs->domid, "replication error occurs when secondary vm is running");
         goto out;
     }
tools/libxl/libxl_colo_save.c +2 -1
index eabc04c..f687d5a 100644
@@ -345,7 +345,8 @@ static void colo_read_svm_suspended_done(libxl__egc *egc,
         goto out;
     }
 
-    if (!css->paused && libxl__qmp_get_replication_error(gc, dss->domid)) {
+    if (!css->paused &&
+        libxl__qmp_query_xen_replication_status(gc, dss->domid)) {
         LOGD(ERROR, dss->domid,
              "replication error occurs when primary vm is running");
         goto out;
tools/libxl/libxl_internal.h +1 -1
index 9fc05e7..25cb08a 100644
@@ -1829,7 +1829,7 @@ _hidden int libxl__qmp_nbd_server_add(libxl__gc *gc, int domid,
 _hidden int libxl__qmp_start_replication(libxl__gc *gc, int domid,
                                          bool primary);
 /* Get replication error that occurs when the vm is running */
-_hidden int libxl__qmp_get_replication_error(libxl__gc *gc, int domid);
+_hidden int libxl__qmp_query_xen_replication_status(libxl__gc *gc, int domid);
 /* Do checkpoint */
 _hidden int libxl__qmp_colo_do_checkpoint(libxl__gc *gc, int domid);
 /* Stop replication */
tools/libxl/libxl_qmp.c +2 -2
index eef7722..eab993a 100644
@@ -1079,9 +1079,9 @@ int libxl__qmp_start_replication(libxl__gc *gc, int domid, bool primary)
     return qmp_run_command(gc, domid, "xen-set-replication", args, NULL, NULL);
 }
 
-int libxl__qmp_get_replication_error(libxl__gc *gc, int domid)
+int libxl__qmp_query_xen_replication_status(libxl__gc *gc, int domid)
 {
-    return qmp_run_command(gc, domid, "xen-get-replication-error", NULL,
+    return qmp_run_command(gc, domid, "query-xen-replication-status", NULL,
                            NULL, NULL);
 }
 
Signature · 9 lines
2.7.4




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#4 lore raw

Re: [PATCH 2/2] libxl/libxl_qmp.c: Update COLO query replication status API

Quoted 2 lines · Zhang Chen

Because of qemu side patch changed the API that comment by community, So we fix it in Xen side.

Maybe:

The QEMU community has asked us to change QMP command xen-get-replication-error to query-xen-replication-status. Modify Xen side to use the new name.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw
In reply to Zhang Chen
Quoted 4 lines · Zhang Chen

After related patch merged by Xen, qemu side patch got some comments to change the API in qemu community. So we update Xen side codes.

Quoted 8 lines

Qemu patchs:
https://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg07654.html

Zhang Chen (2):
libxl/libxl_qmp.c: Update COLO do checkpoint API libxl/libxl_qmp.c: Update COLO query replication status API

If you agree with my suggestions, I can change the commit messages while I commit these patches. No need to resend.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#6 lore raw
Quoted 9 lines · Wei Liu
Quoted 8 lines · Zhang Chen

After related patch merged by Xen, qemu side patch got some comments to change the API in qemu community. So we update Xen side codes.

Qemu patchs:
https://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg07654.html

Quoted 6 lines
Quoted 4 lines

Zhang Chen (2):
libxl/libxl_qmp.c: Update COLO do checkpoint API libxl/libxl_qmp.c: Update COLO query replication status API

If you agree with my suggestions, I can change the commit messages while I commit these patches. No need to resend.

I agree.

Thanks
Zhang Chen

Quoted 3 lines

.

Signature · 10 lines
Thanks
Zhang Chen




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel