search for: xpath_int

Displaying 20 results from an estimated 22 matches for "xpath_int".

2017 Mar 16
2
[PATCH v2] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml index 6032c31..2dee274 100644 --- a/v2v/parse_libvirt_xml.ml +++ b/v2v/parse_libvirt_xml.ml @@ -50,7 +50,7 @@ let parse_libvirt_xml ?conn xml = let xpathctx = Xml.xpath_new_context doc in let xpath_string = xpath_string xpathctx and xpath_int = xpath_int xpathctx - and xpath_int_default = xpath_int_default xpathctx + (*and xpath_int_default = xpath_int_default xpathctx*) and xpath_int64_default = xpath_int64_default xpathctx in let hypervisor = @@ -65,7 +65,6 @@ let parse_libvirt_xml ?conn xml = | Some s -> s in let...
2017 Mar 16
2
[PATCH] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml index 6032c31..fb895e4 100644 --- a/v2v/parse_libvirt_xml.ml +++ b/v2v/parse_libvirt_xml.ml @@ -50,7 +50,7 @@ let parse_libvirt_xml ?conn xml = let xpathctx = Xml.xpath_new_context doc in let xpath_string = xpath_string xpathctx and xpath_int = xpath_int xpathctx - and xpath_int_default = xpath_int_default xpathctx + (*and xpath_int_default = xpath_int_default xpathctx*) and xpath_int64_default = xpath_int64_default xpathctx in let hypervisor = @@ -65,7 +65,6 @@ let parse_libvirt_xml ?conn xml = | Some s -> s in let...
2017 Oct 08
0
[PATCH v2 4/4] common/mltools: xpath_helpers: Get rid of xpath_*_default functions.
Instead of using ‘xpath_(string|int|int64)_default’ we can write the equivalent code using ‘Option.default’. This is not quite so concise, but may be easier to understand. eg: xpath_int_default xctx "xpath_expr" 10 -> Option.default 10 (xpath_int xctx "xpath_expr") --- common/mltools/xpath_helpers.ml | 12 ------------ common/mltools/xpath_helpers.mli | 6 ------ v2v/copy_to_local.ml | 6 +++--- v2v/parse_libvirt_xml.ml | 9 ++++---...
2015 Oct 08
0
[PATCH] v2v: Add xpath_int64 functions, and use them to read memory values.
...f --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml index 976848f..d8c6215 100644 --- a/v2v/input_libvirtxml.ml +++ b/v2v/input_libvirtxml.ml @@ -54,7 +54,8 @@ let parse_libvirt_xml ?conn xml = let xpathctx = Xml.xpath_new_context doc in let xpath_string = xpath_string xpathctx and xpath_int = xpath_int 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 let hypervisor = match xpath_string "/domain/@type" with @@ -66,8 +67,8 @@ let parse_l...
2017 Mar 13
0
[PATCH 2/2] v2v: -i ova: Factor out the OVF parsing into a separate module.
..._register_ns xpathctx - "vmw" "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 = +...
2017 Mar 17
0
Re: [PATCH v2] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...v/parse_libvirt_xml.ml > index 6032c31..2dee274 100644 > --- a/v2v/parse_libvirt_xml.ml > +++ b/v2v/parse_libvirt_xml.ml > @@ -50,7 +50,7 @@ let parse_libvirt_xml ?conn xml = > let xpathctx = Xml.xpath_new_context doc in > let xpath_string = xpath_string xpathctx > and xpath_int = xpath_int xpathctx > - and xpath_int_default = xpath_int_default xpathctx > + (*and xpath_int_default = xpath_int_default xpathctx*) > and xpath_int64_default = xpath_int64_default xpathctx in > > let hypervisor = > @@ -65,7 +65,6 @@ let parse_libvirt_xml ?conn xml = &...
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.
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
2018 Apr 25
9
[PATCH v2 0/9] v2v: -i ova: Handle OVAs containing snapshots.
https://bugzilla.redhat.com/show_bug.cgi?id=1570407 This turned into quite an in-depth refactoring of how we handle OVAs. It also fixes a potential security issue. Rich.
2017 Jun 29
0
[PATCH] v2v: Allow -i libvirtxml to open network disks over http or https.
..._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 "network" -> - (* We only handl...
2017 Mar 16
0
[PATCH 4/4] v2v: Pass CPU vendor, model and topology from source to target.
...= function | BusSlotEmpty -> () diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml index edffd20..6032c31 100644 --- a/v2v/parse_libvirt_xml.ml +++ b/v2v/parse_libvirt_xml.ml @@ -67,6 +67,12 @@ let parse_libvirt_xml ?conn xml = let memory = memory *^ 1024L in let vcpu = xpath_int_default "/domain/vcpu/text()" 1 in + let cpu_vendor = xpath_string "/domain/cpu/vendor/text()" in + let cpu_model = xpath_string "/domain/cpu/model/text()" in + let cpu_sockets = xpath_int "/domain/cpu/topology/@sockets" in + let cpu_cores = xpath_int &...
2017 Mar 17
7
[PATCH v2 0/6] v2v: Pass CPU vendor, model and topology from source to target.
v1 -> v2: - Support for passing topology through -o glance. - Support for passing topology through -o rhv. - Use bool for acpi/apic/pae struct fields in virt-p2v. - Write the xpath expression in error messages instead of file/line. - Fix more memory leaks in virt-p2v cpuid.c. - Passes make check & check-valgrind. There may be some other minor changes. I believe that everything
2017 Oct 27
0
[PATCH v11 7/8] mllib: add XPath helper xpath_get_nodes
...ons(-) diff --git a/common/mltools/xpath_helpers.ml b/common/mltools/xpath_helpers.ml index 3afee8b21..d2bfd3fb9 100644 --- a/common/mltools/xpath_helpers.ml +++ b/common/mltools/xpath_helpers.ml @@ -40,3 +40,12 @@ let xpath_eval parsefn xpathctx expr = let xpath_string = xpath_eval identity let xpath_int = xpath_eval int_of_string let xpath_int64 = xpath_eval 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_nr_nodes obj - 1 do + let node = Xml.xpathobj_node obj i in + push_fron...
2017 Mar 16
0
Re: [PATCH] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...r 16, 2017 at 07:13:12PM +0000, Richard W.M. Jones wrote: > + (* Get the <vcpu> field from the input XML. If not set then > + * try calculating it from the <cpu> <topology> node. If that's > + * not set either, then assume 1 vCPU. > + *) > + let vcpu = xpath_int "/domain/vcpu/text()" in > + let vcpu = > + match vcpu, cpu_sockets, cpu_cores, cpu_threads with > + | Some vcpu, _, _, _ -> vcpu > + | None, None, None, None -> 1 > + | None, _, _, _ -> > + let sockets = match cpu_socket...
2017 Apr 12
1
[PATCH] mllib: Bind %identity C primitive to Common_utils.identity.
...elpers.ml index 8648596a4..d651fab23 100644 --- a/mllib/xpath_helpers.ml +++ b/mllib/xpath_helpers.ml @@ -36,8 +36,6 @@ let xpath_eval parsefn xpathctx expr = expr str ) -external identity : 'a -> 'a = "%identity" - let xpath_string = xpath_eval identity let xpath_int = xpath_eval int_of_string let xpath_int64 = xpath_eval Int64.of_string diff --git a/v2v/input_vmx.ml b/v2v/input_vmx.ml index b72161a82..c48a0155a 100644 --- a/v2v/input_vmx.ml +++ b/v2v/input_vmx.ml @@ -26,8 +26,6 @@ open Types open Utils open Name_from_disk -external identity : 'a ->...
2017 Nov 02
3
[PATCH 0/2] v2v: Handle SATA controller (RHBZ#1508874).
https://bugzilla.redhat.com/show_bug.cgi?id=1508874 Also avoids a warning. 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 16
7
[PATCH 0/4] Pass CPU vendor, model and topology from source to target.
This is tangentially related to: https://bugzilla.redhat.com/show_bug.cgi?id=1372668 The problem in that bug is that we didn't pass the source CPU model (Sandybridge in that case) through to the target RHV hypervisor. So when the Windows guest booted on the target it gives an error about CPU hardware being disconnected (although it otherwise boots and works fine). This patch series
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 27
15
[PATCH v11 0/8] virt-builder-repository
Hi all, Here is the latest version of the series. Diffs to v10: * Make Index.arch a (string, string option) maybe and use it to guess arch at parse time * Compute the image size at parse time when the template flag is set and the value is missing. * Add virt-repository_main slow test * Other fixes from Richard's comments Cédric Bosdonnat (7): Ignore builder/*.out and *.img