|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH 5 of 8] [CA-39589] Refactoring: extracts out the "suspe
# HG changeset patch
# User Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
# Date 1269859682 -3600
# Node ID e6d4f3a5b318bf0503270b4b7252344468af4bf3
# Parent af259cf5d310d9f44cc7380de6ed5117ab7c38fa
[CA-39589] Refactoring: extracts out the "suspend_domain" function from a
deeply nested block.
Signed-off-by: Jonathan Knowles <jonathan.knowles@xxxxxxxxxxxxx>
Acked-by: Marcus Granado <Marcus.Granado@xxxxxxxxxxxxx>
diff -r af259cf5d310 -r e6d4f3a5b318 ocaml/xapi/vmops.ml
--- a/ocaml/xapi/vmops.ml Mon Mar 29 11:48:02 2010 +0100
+++ b/ocaml/xapi/vmops.ml Mon Mar 29 11:48:02 2010 +0100
@@ -912,6 +912,13 @@
| Xal.Shutdown x ->
failwith (Printf.sprintf "Expected domain shutdown
reason: %d" x)
in
+ let suspend_domain ~fd ~hvm () = with_xal (fun xal ->
+ Domain.suspend ~xc ~xs ~hvm domid fd []
~progress_callback:progress_cb
+ (fun () ->
+ handle_death
+ (clean_shutdown_with_reason
+ ~xal ~__context ~self:vm domid
Domain.Suspend)))
+ in
Xapi_xenops_errors.handle_xenops_error
(fun () ->
with_xc_and_xs
@@ -940,14 +947,7 @@
finally
(fun ()
->
debug "suspend: phase 3/4: suspending to disk";
-
with_xal
-
(fun xal ->
-
Domain.suspend ~xc ~xs ~hvm domid fd []
-
~progress_callback:progress_cb
-
(fun () ->
-
handle_death (clean_shutdown_with_reason ~xal
-
~__context ~self:vm domid
-
Domain.Suspend)));
+
suspend_domain ~fd ~hvm ();
(* If the suspend succeeds, set the suspend_VDI *)
Db.VM.set_suspend_VDI ~__context ~self:vm ~value:vdi_ref;)
(fun ()
-> Unix.close fd);
1 file changed, 8 insertions(+), 8 deletions(-)
ocaml/xapi/vmops.ml | 16 ++++++++--------
xen-api.hg-8.patch
Description: Text Data
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-API] [PATCH 0 of 8] [CA-39589] After a VM suspend operation, Xapi now reverses any destructive update it makes to XenStore's copy of dynamic-max., Jonathan Knowles
- [Xen-API] [PATCH 2 of 8] [CA-39589] After a VM suspend operation, Xapi now reverses any destructive update it makes to XenStore's copy of dynamic-max, Jonathan Knowles
- [Xen-API] [PATCH 5 of 8] [CA-39589] Refactoring: extracts out the "suspend_domain" function from a deeply nested block,
Jonathan Knowles <=
- [Xen-API] [PATCH 1 of 8] [CA-39589] Fixes confusing code structure, which made it hard to discern the true execution path through a relatively long and deeply nested function, Jonathan Knowles
- [Xen-API] [PATCH 4 of 8] [CA-39589] Refactoring: extracts out the "handle_death" function from a deeply nested block, Jonathan Knowles
- [Xen-API] [PATCH 3 of 8] [CA-39589] Refactoring: lifts a number of definitions out of a deeply nested block, Jonathan Knowles
- [Xen-API] [PATCH 7 of 8] [CA-39589] Refactoring: extracts out the "do_final_actions_after_suspend" function from a deeply-nested block, Jonathan Knowles
- [Xen-API] [PATCH 6 of 8] [CA-39589] Refactoring: extracts out the "do_suspend" function from a deeply-nested block, Jonathan Knowles
- [Xen-API] [PATCH 8 of 8] [CA-39589] Refactoring: flattens a number of nested function applications, Jonathan Knowles
|
|
|
|
|