From 43baf4f5da10e72666410628f38a1415e2146152 Mon Sep 17 00:00:00 2001 From: Rob Hoes Date: Fri, 12 Aug 2016 14:35:13 +0100 Subject: [PATCH] CA-217921: VBD.unplug must destroy the datapath if a VBD was already shut down The comment on top of the `VBD.unplug` function says: 1. if the device has already been shutdown and deactivated (as in suspend) we must call DP.destroy here to avoid leaks However, recent commit d723d4b0 had regressed this. Signed-off-by: Rob Hoes --- xc/xenops_server_xen.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xc/xenops_server_xen.ml b/xc/xenops_server_xen.ml index e36bc3f8f..df154e324 100644 --- a/xc/xenops_server_xen.ml +++ b/xc/xenops_server_xen.ml @@ -2085,7 +2085,9 @@ module VBD = struct ) (fun () -> match domid, backend with - | Some x, Some (VDI _) -> Storage.dp_destroy task (Storage.id_of (string_of_int x) vbd.Vbd.id) + | Some x, None + | Some x, Some (VDI _) + -> Storage.dp_destroy task (Storage.id_of (string_of_int x) vbd.Vbd.id) | _ -> () ) with