Advertisement
Guest User

Untitled

a guest
Aug 9th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. --- main.ml.orig 2013-08-09 10:08:23.184172328 +0400
  2. +++ main.ml 2013-08-09 10:10:47.336066768 +0400
  3. @@ -43,6 +43,7 @@
  4. let selinux_relabel = ref `Auto in
  5. let trace = ref false in
  6. let verbose = ref false in
  7. + let mount_opts = ref "" in
  8.  
  9. let display_version () =
  10. let g = new G.guestfs () in
  11. @@ -96,6 +97,7 @@
  12. let basic_args = [
  13. "-a", Arg.String add_file, s_"file" ^ " " ^ s_"Add disk image file";
  14. "--add", Arg.String add_file, s_"file" ^ " " ^ s_"Add disk image file";
  15. + "--mount-options", Arg.Set_string mount_opts, s_"opts" ^ " " ^ s_"Set mount options";
  16. "-c", Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
  17. "--connect", Arg.Set_string libvirturi, s_"uri" ^ " " ^ s_"Set libvirt URI";
  18. "--debug-gc", Arg.Set debug_gc, " " ^ s_"Debug GC and memory allocations (internal)";
  19. @@ -205,8 +207,14 @@
  20. let mps = List.sort cmp mps in
  21. List.iter (
  22. fun (mp, dev) ->
  23. - try g#mount dev mp
  24. - with Guestfs.Error msg -> eprintf (f_"%s (ignored)\n") msg
  25. + if mount_opts then (
  26. + try g#mount_options mount_opts dev mp
  27. + with Guestfs.Error msg -> eprintf (f_"%s (ignored)\n") msg
  28. + ) else (
  29. + try g#mount dev mp
  30. + with Guestfs.Error msg -> eprintf (f_"%s (ignored)\n") msg
  31. + );
  32. +
  33. ) mps;
  34.  
  35. (* Perform the filesystem operations. *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement