libvirtd_qemu.aug 3.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(* /etc/libvirt/qemu.conf *)

module Libvirtd_qemu =
   autoload xfm

   let eol   = del /[ \t]*\n/ "\n"
   let value_sep   = del /[ \t]*=[ \t]*/  " = "
   let indent = del /[ \t]*/ ""

   let array_sep  = del /,[ \t\n]*/ ", "
   let array_start = del /\[[ \t\n]*/ "[ "
   let array_end = del /\]/ "]"

   let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\""
   let bool_val = store /0|1/
16
   let int_val = store /[0-9]+/
17 18 19 20 21
   let str_array_element = [ seq "el" . str_val ] . del /[ \t\n]*/ ""
   let str_array_val = counter "el" . array_start . ( str_array_element . ( array_sep . str_array_element ) * ) ? . array_end

   let str_entry       (kw:string) = [ key kw . value_sep . str_val ]
   let bool_entry      (kw:string) = [ key kw . value_sep . bool_val ]
22
   let int_entry       (kw:string) = [ key kw . value_sep . int_val ]
23 24 25 26 27
   let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]


   (* Config entry grouped by function - same order as example config *)
   let vnc_entry = str_entry "vnc_listen"
28
                 | bool_entry "vnc_auto_unix_socket"
29 30 31
                 | bool_entry "vnc_tls"
                 | str_entry "vnc_tls_x509_cert_dir"
                 | bool_entry "vnc_tls_x509_verify"
32
                 | str_entry "vnc_password"
33 34
                 | bool_entry "vnc_sasl"
                 | str_entry "vnc_sasl_dir"
35
                 | str_entry "security_driver"
36 37
                 | bool_entry "security_default_confined"
                 | bool_entry "security_require_confined"
38 39
                 | str_entry "user"
                 | str_entry "group"
40
                 | bool_entry "dynamic_ownership"
41 42
                 | str_array_entry "cgroup_controllers"
                 | str_array_entry "cgroup_device_acl"
43
                 | str_entry "save_image_format"
44
                 | str_entry "dump_image_format"
H
Hu Tao 已提交
45
                 | str_entry "auto_dump_path"
46 47
                 | bool_entry "auto_dump_bypass_cache"
                 | bool_entry "auto_start_bypass_cache"
48
                 | str_entry "hugetlbfs_mount"
49
                 | bool_entry "relaxed_acs_check"
50
                 | bool_entry "vnc_allow_host_audio"
51
                 | bool_entry "clear_emulator_capabilities"
52
                 | bool_entry "allow_disk_format_probing"
53
                 | bool_entry "set_process_name"
54
                 | int_entry "max_processes"
55
                 | int_entry "max_files"
56
                 | str_entry "lock_manager"
57
                 | int_entry "max_queued"
58 59
                 | int_entry "keepalive_interval"
                 | int_entry "keepalive_count"
60 61 62 63 64 65 66 67 68 69 70 71 72 73

   (* Each enty in the config is one of the following three ... *)
   let entry = vnc_entry
   let comment = [ label "#comment" . del /#[ \t]*/ "# " .  store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
   let empty = [ label "#empty" . eol ]

   let record = indent . entry . eol

   let lns = ( record | comment | empty ) *

   let filter = incl "/etc/libvirt/qemu.conf"
              . Util.stdexcl

   let xfm = transform lns filter