File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -193,20 +193,18 @@ let put_rrd_forwarder (req : Http.Request.t) (s : Unix.file_descr) _ =
193193 ignore (Xapi_services. hand_over_connection req s ! (Rrd_interface. forwarded_path))
194194 )
195195
196- let is_vm_on_localhost ~__context ~(vm_uuid : string ) : bool =
197- let localhost = Helpers. get_localhost ~__context in
196+ let host_for_vm ~__context ~vm_uuid =
198197 let vm = Db.VM. get_by_uuid ~__context ~uuid: vm_uuid in
199- let vm_host = Db.VM. get_resident_on ~__context ~self: vm in
200- localhost = vm_host
198+ Db.VM. get_resident_on ~__context ~self: vm
201199
202200let push_rrd ~__context ~(vm_uuid : string ) : unit =
203- let is_on_localhost = is_vm_on_localhost ~__context ~vm_uuid in
204- let domid = vm_uuid_to_domid ~__context ~uuid: vm_uuid in
205- if is_on_localhost then
201+ let vm_host = host_for_vm ~__context ~vm_uuid in
202+ if vm_host = ( Helpers. get_localhost ~__context) then
203+ let domid = vm_uuid_to_domid ~__context ~uuid: vm_uuid in
206204 log_and_ignore_exn (fun () -> Rrdd. push_rrd_local ~vm_uuid ~domid )
207205 else
208- let master = Pool_role. get_master_address () in
209- log_and_ignore_exn (fun () -> Rrdd. push_rrd_remote ~vm_uuid ~remote_address: master )
206+ let remote_address = Db.Host. get_address ~__context ~self: vm_host in
207+ log_and_ignore_exn (fun () -> Rrdd. push_rrd_remote ~vm_uuid ~remote_address )
210208
211209let migrate_rrd ~__context ?remote_address ?session_id ~vm_uuid ~host_uuid () =
212210 let remote_address = match remote_address with
You can’t perform that action at this time.
0 commit comments