You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"encryption-mode", Arg.String (funx -> encryption_mode := encryption_mode_of_string x), (fun() -> string_of_encryption_mode !encryption_mode), "how to use encryption";
56
+
(* Want to ignore bad values for "nice" etc. so not using Arg.Int *)
57
+
str_option "nice" nice "If supplied, the scheduling priority will be set using this value as argument to the 'nice' command.";
58
+
str_option "ionice_class" ionice_class "If supplied, the io scheduling class will be set using this value as -c argument to the 'ionice' command.";
59
+
str_option "ionice_class_data" ionice_class_data "If supplied, the io scheduling class data will be set using this value as -n argument to the 'ionice' command.";
44
60
"experimental-reads-bypass-tapdisk", Arg.Set experimental_reads_bypass_tapdisk, (fun() -> string_of_bool !experimental_reads_bypass_tapdisk), "bypass tapdisk and read directly from the underlying vhd file";
45
61
"experimental-writes-bypass-tapdisk", Arg.Set experimental_writes_bypass_tapdisk, (fun() -> string_of_bool !experimental_writes_bypass_tapdisk), "bypass tapdisk and write directly to the underlying vhd file";
46
62
"base", Arg.String (funx -> base :=Some x), (fun() -> string_opt !base), "base disk to search for differences from";
@@ -218,6 +234,74 @@ let _ =
218
234
let size =!size in
219
235
let base =!base in
220
236
237
+
(* Helper function to bring an int into valid range *)
238
+
letclipvminmaxdescr=
239
+
if v < min then (
240
+
warn "Value %d is too low for %s. Using %d instead." v descr min;
241
+
min
242
+
) elseif v > max then (
243
+
warn "Value %d is too high for %s. Using %d instead." v descr max;
244
+
max
245
+
) else v
246
+
in
247
+
248
+
(
249
+
letparse_as_intstr_optint_opt_refopt_name=
250
+
match str_opt with
251
+
|None -> ()
252
+
|Somestr ->
253
+
try
254
+
int_opt_ref :=Some (int_of_string str)
255
+
with_ ->
256
+
error "Ignoring invalid value for %s: %s" opt_name str
257
+
in
258
+
259
+
(* renice this process if specified *)
260
+
let n_ref =refNonein
261
+
parse_as_int !nice n_ref "nice";
262
+
(match!n_ref with
263
+
|None -> ()
264
+
|Somen -> (
265
+
(* Run command like: renice -n priority -p pid *)
266
+
let n = clip n (-20) 19"nice"in
267
+
let pid = string_of_int (Unix.getpid ()) in
268
+
let (stdout, stderr) =Forkhelpers.execute_command_get_output renice_cmd ["-n"; string_of_int n; "-p"; pid]
269
+
in()
270
+
)
271
+
);
272
+
273
+
(* Possibly run command like: ionice -c class -n classdata -p pid *)
0 commit comments