WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 1 of 1] CA-38567: Catch I/O errors during VM.suspend

To: Xen API <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH 1 of 1] CA-38567: Catch I/O errors during VM.suspend
From: Daniel Stodden <dns@xxxxxxxxxxxx>
Date: Mon, 15 Mar 2010 09:40:16 -0000
Delivery-date: Mon, 29 Mar 2010 12:44:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1268646015@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1268646015@xxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.3.1
# HG changeset patch
# User Daniel Stodden <daniel.stodden@xxxxxxxxxx>
# Date 1268644943 0
# Node ID 7c2e5719936e6e4af4a3a0061518ebd622f4bb22
# Parent  d455f3c74966447903add709174b57c8c50cc511
CA-38567: Catch I/O errors during VM.suspend

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>

diff -r d455f3c74966 -r 7c2e5719936e ocaml/xapi/vmops.ml
--- a/ocaml/xapi/vmops.ml       Fri Mar 12 15:19:41 2010 +0000
+++ b/ocaml/xapi/vmops.ml       Mon Mar 15 09:22:23 2010 +0000
@@ -925,7 +925,13 @@
                                                        Db.VM.set_suspend_VDI 
~__context ~self:vm
                                                                ~value:vdi_ref;
                                                )
-                                               (fun () -> Unix.close fd);
+                                               (fun () ->
+                                                  try
+                                                    Unixext.fsync fd;
+                                                    Unix.close fd
+                                                  with 
Unix.Unix_error(Unix.EIO, _, _) ->
+                                                    raise 
(Api_errors.Server_error (Api_errors.vdi_io_error, ["I/O error saving VM 
suspend image"]))
+                                               );
                        debug "suspend: complete")
                )
 
diff -r d455f3c74966 -r 7c2e5719936e ocaml/xapi/xapi_vm_snapshot.ml
--- a/ocaml/xapi/xapi_vm_snapshot.ml    Fri Mar 12 15:19:41 2010 +0000
+++ b/ocaml/xapi/xapi_vm_snapshot.ml    Mon Mar 15 09:22:23 2010 +0000
@@ -186,9 +186,7 @@
                                (* flush the devices *)
                                List.iter (Xapi_vbd.flush ~__context) vbds;
                        with
-                               | 
Api_errors.Server_error("SR_BACKEND_FAILURE_44", _) as e ->
-                                       error "Not enough space to create the 
suspend image";
-                                       raise e
+                               | Api_errors.Server_error(_, _) as e -> raise e
                                | _ -> raise (Api_errors.Server_error 
(Api_errors.vm_checkpoint_suspend_failed, [Ref.string_of vm]))
                end;
 
# HG changeset patch
# User Daniel Stodden <daniel.stodden@xxxxxxxxxx>
# Date 1268644943 0
# Node ID 7c2e5719936e6e4af4a3a0061518ebd622f4bb22
# Parent  d455f3c74966447903add709174b57c8c50cc511
CA-38567: Catch I/O errors during VM.suspend

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>

diff -r d455f3c74966 -r 7c2e5719936e ocaml/xapi/vmops.ml
--- a/ocaml/xapi/vmops.ml       Fri Mar 12 15:19:41 2010 +0000
+++ b/ocaml/xapi/vmops.ml       Mon Mar 15 09:22:23 2010 +0000
@@ -925,7 +925,13 @@
                                                        Db.VM.set_suspend_VDI 
~__context ~self:vm
                                                                ~value:vdi_ref;
                                                )
-                                               (fun () -> Unix.close fd);
+                                               (fun () ->
+                                                  try
+                                                    Unixext.fsync fd;
+                                                    Unix.close fd
+                                                  with 
Unix.Unix_error(Unix.EIO, _, _) ->
+                                                    raise 
(Api_errors.Server_error (Api_errors.vdi_io_error, ["I/O error saving VM 
suspend image"]))
+                                               );
                        debug "suspend: complete")
                )
 
diff -r d455f3c74966 -r 7c2e5719936e ocaml/xapi/xapi_vm_snapshot.ml
--- a/ocaml/xapi/xapi_vm_snapshot.ml    Fri Mar 12 15:19:41 2010 +0000
+++ b/ocaml/xapi/xapi_vm_snapshot.ml    Mon Mar 15 09:22:23 2010 +0000
@@ -186,9 +186,7 @@
                                (* flush the devices *)
                                List.iter (Xapi_vbd.flush ~__context) vbds;
                        with
-                               | 
Api_errors.Server_error("SR_BACKEND_FAILURE_44", _) as e ->
-                                       error "Not enough space to create the 
suspend image";
-                                       raise e
+                               | Api_errors.Server_error(_, _) as e -> raise e
                                | _ -> raise (Api_errors.Server_error 
(Api_errors.vm_checkpoint_suspend_failed, [Ref.string_of vm]))
                end;
 
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>