Transaction_end | Introduce | Release |
Getdomainpath | Write | Mkdir | Rm |
Setperms | Watchevent | Error | Isintroduced |
- Resume | Set_target | Restrict | Invalid
+ Resume | Set_target | Restrict | Reset_watches |
+ Invalid
let operation_c_mapping =
[| Debug; Directory; Read; Getperms;
Transaction_end; Introduce; Release;
Getdomainpath; Write; Mkdir; Rm;
Setperms; Watchevent; Error; Isintroduced;
- Resume; Set_target; Restrict |]
+ Resume; Set_target; Restrict; Reset_watches |]
let size = Array.length operation_c_mapping
let array_search el a =
| Resume -> "RESUME"
| Set_target -> "SET_TARGET"
| Restrict -> "RESTRICT"
+ | Reset_watches -> "RESET_WATCHES"
| Invalid -> "INVALID"
| Resume
| Set_target
| Restrict
+ | Reset_watches
| Invalid
val operation_c_mapping : operation array
val size : int
con.nb_watches <- con.nb_watches - 1;
apath, w
+let del_watches con =
+ Hashtbl.clear con.watches
+
+let del_transactions con =
+ Hashtbl.clear con.transactions;
+ con.nb_watches <- 0
+
let list_watches con =
let ll = Hashtbl.fold
(fun _ watches acc -> List.map (fun watch -> watch.path, watch.token) watches :: acc)
| Xenbus.Xb.Op.Rm -> "rm "
| Xenbus.Xb.Op.Setperms -> "setperms "
| Xenbus.Xb.Op.Restrict -> "restrict "
+ | Xenbus.Xb.Op.Reset_watches -> "reset watches"
| Xenbus.Xb.Op.Set_target -> "settarget"
| Xenbus.Xb.Op.Error -> "error "
in
Connection.restrict con domid
+(* only in xen >= 4.2 *)
+let do_reset_watches con t domains cons data =
+ Connection.del_watches con;
+ Connection.del_transactions con
+
(* only in >= xen3.3 *)
(* we ensure backward compatibility with restrict by counting the number of argument of set_target ... *)
(* This is not very elegant, but it is safe as 'restrict' only restricts permission of dom0 connections *)
| Xenbus.Xb.Op.Resume -> reply_ack do_resume
| Xenbus.Xb.Op.Set_target -> reply_ack do_set_target
| Xenbus.Xb.Op.Restrict -> reply_ack do_restrict
+ | Xenbus.Xb.Op.Reset_watches -> reply_ack do_reset_watches
| Xenbus.Xb.Op.Invalid -> reply_ack do_error
| _ -> reply_ack do_error