# HG changeset patch # User Daniel Stodden # Date 1268753645 0 # Node ID 9a2390fece52d39d860247756a0ce300615fb209 # Parent 86257cf86017409b3c7e268f6950a6323bcdece7 CA-38567: Catch I/O errors during VM.suspend Signed-off-by: Daniel Stodden diff -r 86257cf86017 -r 9a2390fece52 ocaml/xapi/vmops.ml --- a/ocaml/xapi/vmops.ml Tue Mar 16 15:11:05 2010 +0000 +++ b/ocaml/xapi/vmops.ml Tue Mar 16 15:34:05 2010 +0000 @@ -960,7 +960,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"); debug "suspend phase 4/4: recording memory usage"; diff -r 86257cf86017 -r 9a2390fece52 ocaml/xapi/xapi_vm_snapshot.ml --- a/ocaml/xapi/xapi_vm_snapshot.ml Tue Mar 16 15:11:05 2010 +0000 +++ b/ocaml/xapi/xapi_vm_snapshot.ml Tue Mar 16 15:34:05 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;