search for: xpath_string_default

Displaying 20 results from an estimated 43 matches for "xpath_string_default".

2017 Oct 08
0
[PATCH v2 4/4] common/mltools: xpath_helpers: Get rid of xpath_*_default functions.
...= xpath_eval Int64.of_string - -(* Parse an xpath expression and return a string/int; if the expression - * doesn't match, return the default. - *) -let xpath_eval_default parsefn xpath expr default = - match xpath_eval parsefn xpath expr with - | None -> default - | Some s -> s - -let xpath_string_default = xpath_eval_default identity -let xpath_int_default = xpath_eval_default int_of_string -let xpath_int64_default = xpath_eval_default Int64.of_string diff --git a/common/mltools/xpath_helpers.mli b/common/mltools/xpath_helpers.mli index 7434ba645..3a8190b05 100644 --- a/common/mltools/xpath_helpers...
2017 Mar 13
0
[PATCH 2/2] v2v: -i ova: Factor out the OVF parsing into a separate module.
...uot; "http://www.vmware.com/schema/ovf"; - Xml.xpath_register_ns xpathctx - "vssd" "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData"; - let xpath_string = xpath_string xpathctx - and xpath_int = xpath_int xpathctx - and xpath_string_default = xpath_string_default xpathctx - and xpath_int_default = xpath_int_default xpathctx - and xpath_int64_default = xpath_int64_default xpathctx in + (* Parse the ovf file. *) + let name, memory, vcpu, firmware, disks, removables, nics = + parse_ovf_from_ova ovf in - (* Search fo...
2017 Mar 13
4
[PATCH 0/2] v2v: -i ova: A couple of cleanup patches.
A couple of patches cleaning up the -i ova code. These are both just refactoring (or should be at any rate). The second patch is best viewed with 'git show -w' to exclude whitespace changes. Rich.
2017 Jun 29
0
[PATCH] v2v: Allow -i libvirtxml to open network disks over http or https.
...#39; protocol string. *) + "json: " ^ JSON.string_of_doc json_params + let parse_libvirt_xml ?conn xml = debug "libvirt xml is:\n%s" xml; let doc = Xml.parse_memory xml in let xpathctx = Xml.xpath_new_context doc in let xpath_string = xpath_string xpathctx + and xpath_string_default = xpath_string_default xpathctx and xpath_int = xpath_int xpathctx (*and xpath_int_default = xpath_int_default xpathctx*) and xpath_int64_default = xpath_int64_default xpathctx in @@ -273,21 +300,27 @@ let parse_libvirt_xml ?conn xml = | None -> () ); | Some &q...
2016 Sep 08
1
[PATCH] virt-v2v: Support for ova exported from AWS [v2]
...OVF document") + warning (f_"could not parse ovf:Name from OVF document"); + "default" | Some name -> name in (* Search for memory. *) @@ -245,10 +246,10 @@ object Xml.xpathctx_set_current_context xpathctx n; let file_id = xpath_string_default "rasd:HostResource/text()" "" in - let rex = Str.regexp "^ovf:/disk/\\(.*\\)" in + let rex = Str.regexp "^\\(ovf:\\)?/disk/\\(.*\\)" in if Str.string_match rex file_id 0 then ( (* Chase the references through to the actual fi...
2015 Oct 08
0
[PATCH] v2v: Add xpath_int64 functions, and use them to read memory values.
...t;/domain/vcpu/text()" 1 in let features = diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index a758e94..cd26160 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -183,7 +183,8 @@ object let xpath_string = xpath_string xpathctx and xpath_int = xpath_int xpathctx and xpath_string_default = xpath_string_default xpathctx - and xpath_int_default = xpath_int_default xpathctx in + and xpath_int_default = xpath_int_default xpathctx + and xpath_int64_default = xpath_int64_default xpathctx in (* Search for vm name. *) let name = @@ -193,8 +194,8 @@ object | Some...
2015 Aug 28
7
v2v: -i libvirtxml: Map empty network or bridge name to a default (RHBZ#1257895).
When importing from VMware via the libvirt driver, the libvirt driver can add an empty source bridge name: <interface type='bridge'> <mac address='00:01:02:03:04:05:06'/> <source bridge=''/> </interface> Replicate what we do on the -i ova path, and map these to "eth0", "eth1" etc. This also includes a bunch
2017 Apr 04
1
Re: [PATCH v5 09/10] mllib: add XPath helper xpath_get_nodes()
...2 files changed, 13 insertions(+) > > diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml > index 8648596a4..f12156f45 100644 > --- a/mllib/xpath_helpers.ml > +++ b/mllib/xpath_helpers.ml > @@ -53,3 +53,12 @@ let xpath_eval_default parsefn xpath expr default = > let xpath_string_default = xpath_eval_default identity > let xpath_int_default = xpath_eval_default int_of_string > let xpath_int64_default = xpath_eval_default Int64.of_string > + > +let xpath_get_nodes xpathctx expr = > + let obj = Xml.xpath_eval_expression xpathctx expr in > + let nodes = ref [] in...
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it a little further by extending List and adding a new Option submodule. All basically simple refactoring. Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2017 Mar 23
0
[PATCH v5 09/10] mllib: add XPath helper xpath_get_nodes()
...mllib/xpath_helpers.mli | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index 8648596a4..f12156f45 100644 --- a/mllib/xpath_helpers.ml +++ b/mllib/xpath_helpers.ml @@ -53,3 +53,12 @@ let xpath_eval_default parsefn xpath expr default = let xpath_string_default = xpath_eval_default identity let xpath_int_default = xpath_eval_default int_of_string let xpath_int64_default = xpath_eval_default Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_...
2017 Sep 12
0
[PATCH v8 6/7] mllib: add XPath helper xpath_get_nodes()
...mllib/xpath_helpers.mli | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644 --- a/mllib/xpath_helpers.ml +++ b/mllib/xpath_helpers.ml @@ -52,3 +52,12 @@ let xpath_eval_default parsefn xpath expr default = let xpath_string_default = xpath_eval_default identity let xpath_int_default = xpath_eval_default int_of_string let xpath_int64_default = xpath_eval_default Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_...
2017 Sep 18
0
[PATCH v9 5/7] mllib: add XPath helper xpath_get_nodes()
...mllib/xpath_helpers.mli | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644 --- a/mllib/xpath_helpers.ml +++ b/mllib/xpath_helpers.ml @@ -52,3 +52,12 @@ let xpath_eval_default parsefn xpath expr default = let xpath_string_default = xpath_eval_default identity let xpath_int_default = xpath_eval_default int_of_string let xpath_int64_default = xpath_eval_default Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_...
2017 Sep 20
0
[PATCH v10 5/6] mllib: add XPath helper xpath_get_nodes()
...mllib/xpath_helpers.mli | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/mllib/xpath_helpers.ml b/mllib/xpath_helpers.ml index e6185bf3d..eb655e1fe 100644 --- a/mllib/xpath_helpers.ml +++ b/mllib/xpath_helpers.ml @@ -52,3 +52,12 @@ let xpath_eval_default parsefn xpath expr default = let xpath_string_default = xpath_eval_default identity let xpath_int_default = xpath_eval_default int_of_string let xpath_int64_default = xpath_eval_default Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_...
2017 Oct 05
0
[PATCH v11 5/6] mllib: add XPath helper xpath_get_nodes()
...2 files changed, 13 insertions(+) diff --git a/common/mltools/xpath_helpers.ml b/common/mltools/xpath_helpers.ml index 05fad89a4..a79733486 100644 --- a/common/mltools/xpath_helpers.ml +++ b/common/mltools/xpath_helpers.ml @@ -52,3 +52,12 @@ let xpath_eval_default parsefn xpath expr default = let xpath_string_default = xpath_eval_default identity let xpath_int_default = xpath_eval_default int_of_string let xpath_int64_default = xpath_eval_default Int64.of_string + +let xpath_get_nodes xpathctx expr = + let obj = Xml.xpath_eval_expression xpathctx expr in + let nodes = ref [] in + for i = 0 to Xml.xpathobj_...
2015 Nov 19
4
[PATCH 0/4] v2v: Add a new tool virt-v2v-copy-to-local to handle Xen and ESXi
It turns out that RHEL 5 Xen conversions don't work if the source disk is located on a block device. See patch 1/4 for the gory details. This patch series proposes a new tool called virt-v2v-copy-to-local which essentially is a way to make new virt-v2v work like the old virt-v2v, ie. copy first, convert after. Of course this is very slow and would only be used as a last resort, but I
2016 Feb 09
0
[PATCH 1/4] v2v: collect source network and video adapter types
...17444 is fixed *) s_display = display; + s_video = video; s_sound = sound; s_disks = []; s_removables = removables; diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index c8c6b94..db0588d 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -350,6 +350,7 @@ object xpath_string_default "rasd:ElementName/text()" (sprintf"eth%d" i) in let nic = { s_mac = None; + s_nic_model = None; s_vnet = vnet; s_vnet_orig = vnet; s_vnet_type = Network; @@ -366,6 +367,7 @@ object s_features = []; (* XXX *) s_firmw...
2016 Mar 18
0
[PATCH v4 1/5] v2v: collect source network and video adapter types
...17444 is fixed *) s_display = display; + s_video = video; s_sound = sound; s_disks = []; s_removables = removables; diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index c8c6b94..db0588d 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -350,6 +350,7 @@ object xpath_string_default "rasd:ElementName/text()" (sprintf"eth%d" i) in let nic = { s_mac = None; + s_nic_model = None; s_vnet = vnet; s_vnet_orig = vnet; s_vnet_type = Network; @@ -366,6 +367,7 @@ object s_features = []; (* XXX *) s_firmw...
2016 Feb 20
0
[PATCH v2 1/4] v2v: collect source network and video adapter types
...17444 is fixed *) s_display = display; + s_video = video; s_sound = sound; s_disks = []; s_removables = removables; diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index c8c6b94..db0588d 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -350,6 +350,7 @@ object xpath_string_default "rasd:ElementName/text()" (sprintf"eth%d" i) in let nic = { s_mac = None; + s_nic_model = None; s_vnet = vnet; s_vnet_orig = vnet; s_vnet_type = Network; @@ -366,6 +367,7 @@ object s_features = []; (* XXX *) s_firmw...
2017 Mar 16
0
[PATCH 4/4] v2v: Pass CPU vendor, model and topology from source to target.
.../ cores_per_socket in + if sockets <= 0 then ( + warning (f_"invalid vmw:CoresPerSocket < number of cores"); + None, None + ) + else + Some sockets, Some cores_per_socket in + (* BIOS or EFI firmware? *) let firmware = xpath_string_default "/ovf:Envelope/ovf:VirtualSystem/ovf:VirtualHardwareSection/vmw:Config[@vmw:key=\"firmware\"]/@vmw:value" "bios" in let firmware = @@ -78,7 +98,7 @@ let parse_ovf_from_ova ovf_filename = | s -> error (f_"unknown Config:firmware value %s (e...