vmmd_stat: use correct id to remove socket

This commit is contained in:
Hannes Mehnert 2019-01-06 03:00:16 +01:00
parent 21262dd891
commit cd01611efb
2 changed files with 4 additions and 4 deletions

View file

@ -120,7 +120,7 @@ let tick t =
| None -> Logs.err (fun m -> m "couldn't drop super %a from sub %a" Vmm_core.Name.pp id Vmm_core.Name.pp vmid) ; out | None -> Logs.err (fun m -> m "couldn't drop super %a from sub %a" Vmm_core.Name.pp id Vmm_core.Name.pp vmid) ; out
| Some real_id -> | Some real_id ->
let header = Vmm_commands.{ version = my_version ; sequence = 0L ; name = real_id } in let header = Vmm_commands.{ version = my_version ; sequence = 0L ; name = real_id } in
((socket, vmid, (header, `Data (`Stats_data stats))) :: out)) ((socket, id, (header, `Data (`Stats_data stats))) :: out))
out xs) out xs)
[] (Vmm_trie.all t'.vmid_pid) [] (Vmm_trie.all t'.vmid_pid)
in in

View file

@ -62,12 +62,12 @@ let handle s addr () =
let timer () = let timer () =
let t', outs = tick !t in let t', outs = tick !t in
t := t' ; t := t' ;
Lwt_list.iter_p (fun (s, name, stat) -> Lwt_list.iter_p (fun (s, id, stat) ->
Vmm_lwt.write_wire s stat >>= function Vmm_lwt.write_wire s stat >>= function
| Ok () -> Lwt.return_unit | Ok () -> Lwt.return_unit
| Error `Exception -> | Error `Exception ->
Logs.debug (fun m -> m "removing entry %a" Vmm_core.Name.pp name) ; Logs.debug (fun m -> m "removing entry %a" Vmm_core.Name.pp id) ;
t := remove_entry !t name ; t := remove_entry !t id ;
Vmm_lwt.safe_close s) Vmm_lwt.safe_close s)
outs outs