Displaying 6 results from an estimated 6 matches for "scan_variables".
2019 Feb 25
0
[PATCH 2/3] v2v: add Var_expander
...= PCRE.compile "%{([^}]+)}"
+
+let check_variable var =
+ String.iter (
+ function
+ | '0'..'9'
+ | 'a'..'z'
+ | 'A'..'Z'
+ | '_'
+ | '-' -> ()
+ | _ -> raise (Invalid_variable var)
+ ) var
+
+let scan_variables str =
+ let res = ref [] in
+ let offset = ref 0 in
+ while PCRE.matches ~offset:!offset var_re str; do
+ let var = PCRE.sub 1 in
+ check_variable var;
+ let _, end_ = PCRE.subi 0 in
+ List.push_back res var;
+ offset := end_
+ done;
+ List.remove_duplicates !res
+
+let replace_...
2019 Mar 29
5
[PATCH v2 0/3] v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json.
It produces local files, just like -o local, although the metadata
produced is a JSON file with data that v2v collected in the conversion
process. This can be useful for converting to unsupported destinations,
still based on QEMU/KVM.
In addition to a simple different metadata, it offers a way to relocate
the disks, with
2019 Feb 25
7
[PATCH 0/3] RFC: v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json.
It produces local files, just like -o local, although the metadata
produced is a JSON file with data that v2v collected in the conversion
process. This can be useful for converting to unsupported destinations,
still based on QEMU/KVM.
In addition to a simple different metadata, it offers a way to relocate
the disks, with
2019 Mar 25
1
Re: [PATCH 3/3] v2v: add -o json output mode
...n
> +
> + List.iter (
> + function
> + | "json-disks-pattern", v ->
> + if !json_disks_pattern <> None then
> + error (f_"-o json: -oo json-disks-pattern set more than once");
> + let vars =
> + try Var_expander.scan_variables v
> + with Var_expander.Invalid_variable var ->
> + error (f_"-o json: -oo json-disks-pattern: invalid variable %%{%s}")
> + var in
> + List.iter (
> + fun var ->
> + if not (List.mem var known_pattern_variables...
2019 Feb 25
0
[PATCH 3/3] v2v: add -o json output mode
...=
+ let json_disks_pattern = ref None in
+
+ List.iter (
+ function
+ | "json-disks-pattern", v ->
+ if !json_disks_pattern <> None then
+ error (f_"-o json: -oo json-disks-pattern set more than once");
+ let vars =
+ try Var_expander.scan_variables v
+ with Var_expander.Invalid_variable var ->
+ error (f_"-o json: -oo json-disks-pattern: invalid variable %%{%s}")
+ var in
+ List.iter (
+ fun var ->
+ if not (List.mem var known_pattern_variables) then
+ error (f_...
2019 Mar 29
0
[PATCH v2 3/3] v2v: add -o json output mode
...=
+ let json_disks_pattern = ref None in
+
+ List.iter (
+ function
+ | "json-disks-pattern", v ->
+ if !json_disks_pattern <> None then
+ error (f_"-o json: -oo json-disks-pattern set more than once");
+ let vars =
+ try Var_expander.scan_variables v
+ with Var_expander.Invalid_variable var ->
+ error (f_"-o json: -oo json-disks-pattern: invalid variable %%{%s}")
+ var in
+ List.iter (
+ fun var ->
+ if not (List.mem var known_pattern_variables) then
+ error (f_...