Skip to contentSkip to conversation

libxl/remus: fix the return value of the checkpoint callback

PATCH In review Yang Hongyang 4 participants 10 messages Jul 15, 2015 – Jul 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl/remus: fix the return value of the checkpoint callback

In checkpoint callback, we wait for the interval and then start another checkpoint, so the ERROR_TIMEDOUT should be intended and should not treat as error.

This patch is based on
[PATCH v8 --for 4.6 COLO 00/25] COarse-grain LOck-stepping Virtual Machines for Non-stop Service

CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Wei Liu <[email protected]>
---
 tools/libxl/libxl_remus.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
tools/libxl/libxl_remus.c +7 -4
index 46dcc3c..ffc92a7 100644
@@ -355,11 +355,14 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
      * (xc_domain_save.c). in order to continue executing the infinite loop
      * (suspend, checkpoint, resume) in xc_domain_save().
      */
-
-    if (rc)
+    if (rc == ERROR_TIMEDOUT) {
+        /* This is intended, we set the timeout and start another checkpoint */
+        libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, 1);
+    } else {
         dss->rc = rc;
-
-    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
+        libxl__xc_domain_saverestore_async_callback_done(egc,
+                                                         &dss->sws.shs, !rc);
+    }
 }
 
 /*---------------------- remus callbacks (restore) -----------------------*/
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Yang Hongyang

In checkpoint callback, we wait for the interval and then start another checkpoint, so the ERROR_TIMEDOUT should be intended and should not treat as error.

This patch is based on
[PATCH v8 --for 4.6 COLO 00/25] COarse-grain LOck-stepping Virtual Machines for Non-stop Service

Does that mean it won't apply to current staging?

I think we probably want this fix ASAP rather than waiting for that series?

Quoted 13 lines
CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Wei Liu <[email protected]>
---
 tools/libxl/libxl_remus.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
tools/libxl/libxl_remus.c +0 -0
index 46dcc3c..ffc92a7 100644

tools/libxl/libxl_remus.c static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev, · line 360

Quoted 8 lines
tools/libxl/libxl_remus.c +3 -2
@@ -355,11 +355,14 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
      * (xc_domain_save.c). in order to continue executing the infinite loop
      * (suspend, checkpoint, resume) in xc_domain_save().
      */
-
-    if (rc)
+    if (rc == ERROR_TIMEDOUT) {
+        /* This is intended, we set the timeout and start another checkpoint */
+        libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, 1);

Please wrap this (slightly) overlong line (and probably the comment too which is borderline AFAICT).

Quoted 10 lines
tools/libxl/libxl_remus.c +4 -2
+    } else {
         dss->rc = rc;
-
-    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
+        libxl__xc_domain_saverestore_async_callback_done(egc,
+                                                         &dss->sws.shs, !rc);
+    }
 }
 
 /*---------------------- remus callbacks (restore) -----------------------*/
#2 lore raw
Quoted 9 lines · Ian Campbell
Quoted 6 lines · Yang Hongyang

In checkpoint callback, we wait for the interval and then start another checkpoint, so the ERROR_TIMEDOUT should be intended and should not treat as error.

This patch is based on
[PATCH v8 --for 4.6 COLO 00/25] COarse-grain LOck-stepping Virtual Machines for Non-stop Service

Does that mean it won't apply to current staging?

No. This can apply on top of colo pre series.

Quoted 3 lines

I think we probably want this fix ASAP rather than waiting for that series?

I can resubmit the patch apply to staging, but the colo pre series will need to be rebased...

Quoted 40 lines
Quoted 14 lines
CC Ian Jackson <[email protected]>
CC Ian Campbell <[email protected]>
CC Wei Liu <[email protected]>
---
  tools/libxl/libxl_remus.c | 11 +++++++----
  1 file changed, 7 insertions(+), 4 deletions(-)
tools/libxl/libxl_remus.c +0 -0
index 46dcc3c..ffc92a7 100644

tools/libxl/libxl_remus.c static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev, · line 360

Quoted 8 lines
tools/libxl/libxl_remus.c +3 -2
@@ -355,11 +355,14 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
       * (xc_domain_save.c). in order to continue executing the infinite loop
       * (suspend, checkpoint, resume) in xc_domain_save().
       */
-
-    if (rc)
+    if (rc == ERROR_TIMEDOUT) {
+        /* This is intended, we set the timeout and start another checkpoint */
+        libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, 1);

Please wrap this (slightly) overlong line (and probably the comment too which is borderline AFAICT).

tools/libxl/libxl_remus.c static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev, · line 368

Quoted 10 lines
tools/libxl/libxl_remus.c +4 -2
+    } else {
          dss->rc = rc;
-
-    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->sws.shs, !rc);
+        libxl__xc_domain_saverestore_async_callback_done(egc,
+                                                         &dss->sws.shs, !rc);
+    }
  }
 
  /*---------------------- remus callbacks (restore) -----------------------*/

.

Signature · 2 lines
Thanks,
Yang.
#3 lore raw

PATCH 1/1 libxl: events: Do not abort remus with ERROR_TIMEOUT

In reply to Ian Campbell

When the timeout set for prompting the next remus iteration fires, we should not treat the ERROR_TIMEDOUT as an error.

Bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort".

---
 tools/libxl/libxl_dom.c |    3 +++
 1 file changed, 3 insertions(+)
tools/libxl/libxl_dom.c +3 -0
index 81adb3d..4cb247a 100644
@@ -2024,6 +2024,9 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
 
     STATE_AO_GC(dss->ao);
 
+    if (rc == ERROR_TIMEDOUT) /* As intended */
+        rc = 0;
+
     /*
      * Time to checkpoint the guest again. We return 1 to libxc
      * (xc_domain_save.c). in order to continue executing the infinite loop
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] libxl: events: Do not abort remus with ERROR_TIMEOUT

Quoted 9 lines · Ian Jackson

When the timeout set for prompting the next remus iteration fires, we should not treat the ERROR_TIMEDOUT as an error.

Bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort".

Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] libxl: events: Do not abort remus with ERROR_TIMEOUT

In reply to Ian Jackson
Quoted 10 lines · Ian Jackson

When the timeout set for prompting the next remus iteration fires, we should not treat the ERROR_TIMEDOUT as an error.

Bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort".

Quoted 20 lines
---
 tools/libxl/libxl_dom.c |    3 +++
 1 file changed, 3 insertions(+)
tools/libxl/libxl_dom.c +3 -0
index 81adb3d..4cb247a 100644
@@ -2024,6 +2024,9 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
 
     STATE_AO_GC(dss->ao);
 
+    if (rc == ERROR_TIMEDOUT) /* As intended */
+        rc = 0;
+
     /*
      * Time to checkpoint the guest again. We return 1 to libxc
      * (xc_domain_save.c). in order to continue executing the infinite loop
Signature · 1 line
1.7.10.4
author Acked-by on v1 1/1
#6 lore raw

Re: [PATCH] libxl: events: Do not abort remus with ERROR_TIMEOUT

In reply to Ian Jackson
Quoted 10 lines · Ian Jackson

When the timeout set for prompting the next remus iteration fires, we should not treat the ERROR_TIMEDOUT as an error.

Bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort".

Quoted 19 lines
---
  tools/libxl/libxl_dom.c |    3 +++
  1 file changed, 3 insertions(+)
tools/libxl/libxl_dom.c +3 -0
index 81adb3d..4cb247a 100644
@@ -2024,6 +2024,9 @@ static void remus_next_checkpoint(libxl__egc *egc, libxl__ev_time *ev,
 
      STATE_AO_GC(dss->ao);
 
+    if (rc == ERROR_TIMEDOUT) /* As intended */
+        rc = 0;
+
      /*
       * Time to checkpoint the guest again. We return 1 to libxc
       * (xc_domain_save.c). in order to continue executing the infinite loop
Signature · 2 lines
Thanks,
Yang.
Applied
#7 lore raw

Re: [PATCH] libxl: events: Do not abort remus with ERROR_TIMEOUT

Quoted 7 lines · Yang Hongyang
Quoted 5 lines · Ian Jackson

When the timeout set for prompting the next remus iteration fires, we should not treat the ERROR_TIMEDOUT as an error.

Bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort".

Quoted 7 lines
Quoted 5 lines

Applied, thanks.

#8 lore raw
In reply to Ian Campbell

Ian Campbell writes ("Re: [PATCH] libxl/remus: fix the return value of the checkpoint callback"):

Quoted 1 line

Does that mean it won't apply to current staging?

Indeed it doesn't.

Quoted 2 lines

I think we probably want this fix ASAP rather than waiting for that series?

Yes. Patch just sent. Untested but fairly obvious. Yang, do you want to test this, or do you want us to apply it as-is ? I don't have a remus test setup.

This is the second rc-handling bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort". I am going to re-read that patch to see if I can find any more.

Ian.

#9 lore raw
Quoted 11 lines · Ian Jackson

Ian Campbell writes ("Re: [PATCH] libxl/remus: fix the return value of the checkpoint callback"):

Quoted 1 line

Does that mean it won't apply to current staging?

Indeed it doesn't.

Quoted 2 lines

I think we probably want this fix ASAP rather than waiting for that series?

Yes. Patch just sent. Untested but fairly obvious. Yang, do you want to test this, or do you want us to apply it as-is ? I don't have a remus test setup.

Please apply, thanks!

Quoted 8 lines

This is the second rc-handling bug in 31c836f4 "libxl: events: Permit timeouts to signal ao abort". I am going to re-read that patch to see if I can find any more.

Ian.
.

Signature · 2 lines
Thanks,
Yang.