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] fix domain leak on VM.resume

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] fix domain leak on VM.resume
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 22 Apr 2010 11:27:39 +0100
Delivery-date: Thu, 22 Apr 2010 03:25:05 -0700
Envelope-to: www-data@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>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1271932039 -3600
# Node ID 172736b1710a836c01fe4511567942d5caebcfff
# Parent  66b40631f2b28df6cd73a74733249c7af0212214
CA-40390: even if VDI.destroy fails after a VM.resume, log the error and 
continue. Leaking a VDI is unfortunate but leaking a whole domain is worse.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 66b40631f2b2 -r 172736b1710a ocaml/xapi/vmops.ml
--- a/ocaml/xapi/vmops.ml       Tue Apr 20 19:18:53 2010 +0100
+++ b/ocaml/xapi/vmops.ml       Thu Apr 22 11:27:19 2010 +0100
@@ -808,9 +808,15 @@
              (fun () -> Helpers.log_exn_continue "restore" (fun () -> 
Unix.close fd) ()));
        
        (* No exception must have happened: safe to destroy the VDI *)
-       Helpers.call_api_functions ~__context
-          (fun rpc session_id ->
-             Client.VDI.destroy rpc session_id suspend_vdi);
+          begin 
+                try
+                  Helpers.call_api_functions ~__context
+                          (fun rpc session_id ->
+                                       Client.VDI.destroy rpc session_id 
suspend_vdi)
+                with _ ->
+                        (* This should never happen but just in case, we log 
prominently and continue *)
+                        error "Failed to delete suspend image VDI: %s" 
(Db.VDI.get_uuid ~__context ~self:suspend_vdi);
+          end;
        Db.VM.set_suspend_VDI ~__context ~self ~value:Ref.null;
 
           Db.VM.set_domid ~__context ~self ~value:(Int64.of_int domid);
1 file changed, 9 insertions(+), 3 deletions(-)
ocaml/xapi/vmops.ml |   12 +++++++++---


Attachment: xen-api.hg.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] fix domain leak on VM.resume, David Scott <=