[libvirt] [PATCH] Adapt augeas profile to handle negative int values.

Introducing keepalive_interval = -1 breaks to augeas lens. Fix the lens by allowing signed ints in the regular expression. --- daemon/libvirtd.aug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/libvirtd.aug b/daemon/libvirtd.aug index a70aa1d..4d40ee2 100644 --- a/daemon/libvirtd.aug +++ b/daemon/libvirtd.aug @@ -13,7 +13,7 @@ module Libvirtd = let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\"" let bool_val = store /0|1/ - let int_val = store /[0-9]+/ + let int_val = store /-?[0-9]+/ 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 -- 2.6.6

On 15.04.2016 17:03, Cédric Bosdonnat wrote:
Introducing keepalive_interval = -1 breaks to augeas lens. Fix the lens by allowing signed ints in the regular expression. --- daemon/libvirtd.aug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/libvirtd.aug b/daemon/libvirtd.aug index a70aa1d..4d40ee2 100644 --- a/daemon/libvirtd.aug +++ b/daemon/libvirtd.aug @@ -13,7 +13,7 @@ module Libvirtd =
let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\"" let bool_val = store /0|1/ - let int_val = store /[0-9]+/ + let int_val = store /-?[0-9]+/ 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
ACK Michal

On Mon, May 02, 2016 at 09:42:58AM +0200, Michal Privoznik wrote:
On 15.04.2016 17:03, Cédric Bosdonnat wrote:
Introducing keepalive_interval = -1 breaks to augeas lens. Fix the lens by allowing signed ints in the regular expression. --- daemon/libvirtd.aug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/libvirtd.aug b/daemon/libvirtd.aug index a70aa1d..4d40ee2 100644 --- a/daemon/libvirtd.aug +++ b/daemon/libvirtd.aug @@ -13,7 +13,7 @@ module Libvirtd =
let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\"" let bool_val = store /0|1/ - let int_val = store /[0-9]+/ + let int_val = store /-?[0-9]+/ 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
ACK
Should we also create a uint_cal and uint_entry? Because this way you allow other things to be set to negative values as well, e.g. max_anonymous_clients, log_level.
Michal
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Mon, 2016-05-02 at 10:19 +0200, Martin Kletzander wrote:
On Mon, May 02, 2016 at 09:42:58AM +0200, Michal Privoznik wrote:
On 15.04.2016 17:03, Cédric Bosdonnat wrote:
Introducing keepalive_interval = -1 breaks to augeas lens. Fix the lens by allowing signed ints in the regular expression. --- daemon/libvirtd.aug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/libvirtd.aug b/daemon/libvirtd.aug index a70aa1d..4d40ee2 100644 --- a/daemon/libvirtd.aug +++ b/daemon/libvirtd.aug @@ -13,7 +13,7 @@ module Libvirtd =
let str_val = del /\"/ "\"" . store /[^\"]*/ . del /\"/ "\"" let bool_val = store /0|1/ - let int_val = store /[0-9]+/ + let int_val = store /-?[0-9]+/ 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
ACK
Should we also create a uint_cal and uint_entry? Because this way you allow other things to be set to negative values as well, e.g. max_anonymous_clients, log_level.
That would be OK, though we need to pay attention if those finally accept negative values in the future. I already pushed the previous patch, but we surely can have another one refining it. -- Cedric
participants (4)
-
Cedric Bosdonnat
-
Cédric Bosdonnat
-
Martin Kletzander
-
Michal Privoznik