diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml index 88fea3467a..c1511c0771 100644 --- a/tools/ocaml/xenstored/process.ml +++ b/tools/ocaml/xenstored/process.ml @@ -378,6 +378,7 @@ let do_transaction_end con t domains cons data = | x :: _ -> raise (Invalid_argument x) | _ -> raise Invalid_Cmd_Args in + let commit = commit && not (Transaction.is_read_only t) in let success = let commit = if commit then Some (fun con trans -> transaction_replay con trans domains cons) else None in History.end_transaction t con (Transaction.get_id t) commit in diff --git a/tools/ocaml/xenstored/transaction.ml b/tools/ocaml/xenstored/transaction.ml index edd1178d80..8f95301953 100644 --- a/tools/ocaml/xenstored/transaction.ml +++ b/tools/ocaml/xenstored/transaction.ml @@ -128,6 +128,7 @@ let make ?(internal=false) id store = let get_store t = t.store let get_paths t = t.paths +let is_read_only t = t.paths = [] let add_wop t ty path = t.paths <- (ty, path) :: t.paths let add_operation ~perm t request response = if !Define.maxrequests >= 0