@@ -273,9 +273,11 @@ let pool_migrate ~__context ~vm ~host ~options =
273273 Xapi_network. with_networks_attached_for_vm ~__context ~vm ~host (fun () ->
274274 (* XXX: PR-1255: the live flag *)
275275 info " xenops: VM.migrate %s to %s" vm_uuid xenops_url;
276- migrate_with_retry ~__context queue_name dbg vm_uuid [] [] xenops_vgpu_map xenops_url;
277- (* Delete all record of this VM locally (including caches) *)
278- Xapi_xenops.Xenopsd_metadata. delete ~__context vm_uuid;
276+ Xapi_xenops. transform_xenops_exn ~__context ~vm queue_name (fun () ->
277+ migrate_with_retry ~__context queue_name dbg vm_uuid [] [] xenops_vgpu_map xenops_url;
278+ (* Delete all record of this VM locally (including caches) *)
279+ Xapi_xenops.Xenopsd_metadata. delete ~__context vm_uuid
280+ )
279281 );
280282 Rrdd_proxy. migrate_rrd ~__context ~vm_uuid ~host_uuid: (Ref. string_of host) () ;
281283 detach_local_network_for_vm ~__context ~vm ~destination: host;
@@ -294,16 +296,7 @@ let pool_migrate ~__context ~vm ~host ~options =
294296 end ;
295297 with _ -> ()
296298 end ;
297- match exn with
298- | Xenops_interface. Xenopsd_error Failed_to_acknowledge_shutdown_request ->
299- raise Api_errors. (Server_error (vm_failed_shutdown_ack, [Ref. string_of vm]))
300- | Xenops_interface. Xenopsd_error Cancelled _ ->
301- TaskHelper. raise_cancelled ~__context
302- | Xenops_interface. Xenopsd_error Storage_backend_error (code , _ ) ->
303- raise Api_errors. (Server_error (sr_backend_failure, [code]))
304- | Xenops_interface. Xenopsd_error Ballooning_timeout_before_migration ->
305- raise Api_errors. (Server_error (ballooning_timeout_before_migration, [Ref. string_of vm]))
306- | _ -> raise exn
299+ raise exn
307300 )
308301
309302let pool_migrate_complete ~__context ~vm ~host =
0 commit comments