2008-09-04 10:44:23 +00:00
|
|
|
(* /etc/libvirt/libvirtd.conf *)
|
|
|
|
|
|
|
|
module Libvirtd =
|
|
|
|
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/
|
2016-04-15 15:01:02 +00:00
|
|
|
let int_val = store /-?[0-9]+/
|
2008-09-04 10:44:23 +00:00
|
|
|
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 ]
|
2008-12-04 22:18:44 +00:00
|
|
|
let int_entry (kw:string) = [ key kw . value_sep . int_val ]
|
2008-09-04 10:44:23 +00:00
|
|
|
let str_array_entry (kw:string) = [ key kw . value_sep . str_array_val ]
|
|
|
|
|
|
|
|
|
|
|
|
(* Config entry grouped by function - same order as example config *)
|
|
|
|
let network_entry = bool_entry "listen_tls"
|
|
|
|
| bool_entry "listen_tcp"
|
|
|
|
| str_entry "tls_port"
|
|
|
|
| str_entry "tcp_port"
|
|
|
|
| str_entry "listen_addr"
|
|
|
|
| bool_entry "mdns_adv"
|
|
|
|
| str_entry "mdns_name"
|
|
|
|
|
|
|
|
let sock_acl_entry = str_entry "unix_sock_group"
|
|
|
|
| str_entry "unix_sock_ro_perms"
|
|
|
|
| str_entry "unix_sock_rw_perms"
|
2015-04-13 14:05:46 +00:00
|
|
|
| str_entry "unix_sock_admin_perms"
|
2009-02-09 17:52:38 +00:00
|
|
|
| str_entry "unix_sock_dir"
|
2008-09-04 10:44:23 +00:00
|
|
|
|
|
|
|
let authentication_entry = str_entry "auth_unix_ro"
|
|
|
|
| str_entry "auth_unix_rw"
|
|
|
|
| str_entry "auth_tcp"
|
|
|
|
| str_entry "auth_tls"
|
|
|
|
|
|
|
|
let certificate_entry = str_entry "key_file"
|
|
|
|
| str_entry "cert_file"
|
|
|
|
| str_entry "ca_file"
|
|
|
|
| str_entry "crl_file"
|
|
|
|
|
|
|
|
let authorization_entry = bool_entry "tls_no_verify_certificate"
|
2011-07-21 10:13:11 +00:00
|
|
|
| bool_entry "tls_no_sanity_certificate"
|
2008-09-04 10:44:23 +00:00
|
|
|
| str_array_entry "tls_allowed_dn_list"
|
|
|
|
| str_array_entry "sasl_allowed_username_list"
|
2013-04-17 11:01:24 +00:00
|
|
|
| str_array_entry "access_drivers"
|
2016-06-03 16:53:18 +00:00
|
|
|
| str_entry "tls_priority"
|
2008-09-04 10:44:23 +00:00
|
|
|
|
2008-12-04 22:18:44 +00:00
|
|
|
let processing_entry = int_entry "min_workers"
|
|
|
|
| int_entry "max_workers"
|
|
|
|
| int_entry "max_clients"
|
2013-07-25 12:45:38 +00:00
|
|
|
| int_entry "max_queued_clients"
|
2014-03-04 17:55:24 +00:00
|
|
|
| int_entry "max_anonymous_clients"
|
2009-01-20 19:25:15 +00:00
|
|
|
| int_entry "max_requests"
|
|
|
|
| int_entry "max_client_requests"
|
2011-08-12 12:04:31 +00:00
|
|
|
| int_entry "prio_workers"
|
2008-09-04 10:44:23 +00:00
|
|
|
|
2015-04-13 14:05:46 +00:00
|
|
|
let admin_processing_entry = int_entry "admin_min_workers"
|
|
|
|
| int_entry "admin_max_workers"
|
|
|
|
| int_entry "admin_max_clients"
|
|
|
|
| int_entry "admin_max_queued_clients"
|
|
|
|
| int_entry "admin_max_client_requests"
|
|
|
|
|
2008-12-22 12:57:35 +00:00
|
|
|
let logging_entry = int_entry "log_level"
|
|
|
|
| str_entry "log_filters"
|
|
|
|
| str_entry "log_outputs"
|
2012-05-25 10:18:24 +00:00
|
|
|
| int_entry "log_buffer_size"
|
2008-12-22 12:57:35 +00:00
|
|
|
|
2010-09-15 13:44:11 +00:00
|
|
|
let auditing_entry = int_entry "audit_level"
|
|
|
|
| bool_entry "audit_logging"
|
|
|
|
|
2011-08-24 13:33:34 +00:00
|
|
|
let keepalive_entry = int_entry "keepalive_interval"
|
|
|
|
| int_entry "keepalive_count"
|
|
|
|
| bool_entry "keepalive_required"
|
|
|
|
|
2015-04-13 14:05:46 +00:00
|
|
|
let admin_keepalive_entry = int_entry "admin_keepalive_interval"
|
|
|
|
| int_entry "admin_keepalive_count"
|
|
|
|
| bool_entry "admin_keepalive_required"
|
|
|
|
|
2012-05-25 10:18:24 +00:00
|
|
|
let misc_entry = str_entry "host_uuid"
|
2016-05-03 09:12:41 +00:00
|
|
|
| str_entry "host_uuid_source"
|
2017-02-07 15:16:42 +00:00
|
|
|
| int_entry "ovs_timeout"
|
2012-05-25 10:18:24 +00:00
|
|
|
|
2008-09-04 10:44:23 +00:00
|
|
|
(* Each enty in the config is one of the following three ... *)
|
|
|
|
let entry = network_entry
|
|
|
|
| sock_acl_entry
|
|
|
|
| authentication_entry
|
|
|
|
| certificate_entry
|
|
|
|
| authorization_entry
|
2008-12-04 22:18:44 +00:00
|
|
|
| processing_entry
|
2015-04-13 14:05:46 +00:00
|
|
|
| admin_processing_entry
|
2008-12-22 12:57:35 +00:00
|
|
|
| logging_entry
|
2010-09-15 13:44:11 +00:00
|
|
|
| auditing_entry
|
2011-08-24 13:33:34 +00:00
|
|
|
| keepalive_entry
|
2015-04-13 14:05:46 +00:00
|
|
|
| admin_keepalive_entry
|
2012-05-25 10:18:24 +00:00
|
|
|
| misc_entry
|
2008-09-04 10:44:23 +00:00
|
|
|
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/libvirtd.conf"
|
|
|
|
. Util.stdexcl
|
|
|
|
|
|
|
|
let xfm = transform lns filter
|