Displaying 20 results from an estimated 88 matches for "xpath_string".
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 Oct 08
0
[PATCH v2 4/4] common/mltools: xpath_helpers: Get rid of xpath_*_default functions.
...les changed, 15 insertions(+), 34 deletions(-)
diff --git a/common/mltools/xpath_helpers.ml b/common/mltools/xpath_helpers.ml
index 05fad89a4..3afee8b21 100644
--- a/common/mltools/xpath_helpers.ml
+++ b/common/mltools/xpath_helpers.ml
@@ -40,15 +40,3 @@ 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
-
-(* 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 xpat...
2017 Mar 16
2
[PATCH v2] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...d, 17 insertions(+), 3 deletions(-)
diff --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 ?c...
2020 Jan 17
1
[v2v PATCH] -o libvirt: read pool name from object
...ool in
- Libvirt.Pool.get_xml_desc (Libvirt.Pool.const pool) in
+ let pool = Libvirt_utils.get_pool self#conn output_pool in
+ let xml = Libvirt.Pool.get_xml_desc (Libvirt.Pool.const pool) in
let doc = Xml.parse_memory xml in
let xpathctx = Xml.xpath_new_context doc in
let xpath_string = xpath_string xpathctx in
@@ -125,12 +124,7 @@ object (self)
(* Get the name of the pool, since we have to use that
* (and not the UUID) in the XML of the guest.
*)
- let name =
- match xpath_string "/pool/name/text()" with
- | None ->
- error (f_...
2016 Sep 21
1
[PATCH] v2v: Support <listen type='socket'> and <listen type='none'> (RHBZ#1378022).
.../v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index 33e878e..d94591f 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -96,24 +96,31 @@ let parse_libvirt_xml ?conn xml =
let nr_nodes = Xml.xpathobj_nr_nodes obj in
if nr_nodes < 1 then (
match xpath_string "@listen" with
- | None -> LNone | Some a -> LAddress a
+ | None -> LNoListen | Some a -> LAddress a
) else (
(* Use only the first <listen> configuration. *)
match xpath_string "listen[1]/@type" with
-...
2015 Oct 08
0
[PATCH] v2v: Add xpath_int64 functions, and use them to read memory values.
...anged, 23 insertions(+), 6 deletions(-)
diff --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...
2017 Jun 29
0
[PATCH] v2v: Allow -i libvirtxml to open network disks over http or https.
...Turn the JSON parameters into a 'json:' 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 =...
2016 Sep 21
1
[PATCH] v2v: -i libvirtxml: ignore <listen type='none'> (RHBZ#1378022)
...rtion(+)
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index 33e878e..1540798 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -101,6 +101,7 @@ let parse_libvirt_xml ?conn xml =
(* Use only the first <listen> configuration. *)
match xpath_string "listen[1]/@type" with
| None -> LNone
+ | Some "none" -> LNone
| Some "address" ->
(match xpath_string "listen[1]/@address" with
| None -> LNone
--
2.7.4
2017 Mar 17
0
Re: [PATCH v2] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...> diff --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,...
2017 Nov 02
1
[PATCH] v2v: -i ova: parse MAC address from <rasd:Address> (RHBZ#1506572)
...rse_ovf_from_ova.ml b/v2v/parse_ovf_from_ova.ml
index fe8228dcc..4ee6bc901 100644
--- a/v2v/parse_ovf_from_ova.ml
+++ b/v2v/parse_ovf_from_ova.ml
@@ -232,8 +232,9 @@ let parse_ovf_from_ova ovf_filename =
let vnet =
Option.default (sprintf"eth%d" i)
(xpath_string "rasd:ElementName/text()") in
+ let mac = xpath_string "rasd:Address/text()" in
let nic = {
- s_mac = None;
+ s_mac = mac;
s_nic_model = None;
s_vnet = vnet;
s_vnet_orig = vnet;
--
2.13.6
2017 Mar 13
0
[PATCH 2/2] v2v: -i ova: Factor out the OVF parsing into a separate module.
...rceAllocationSettingData";
- Xml.xpath_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,...
2018 Mar 22
1
[PATCH] v2v: Fix parsing of OVA files and documentation for --network and --bridge (RHBZ#1559027).
...e_ovf_from_ova.ml
@@ -230,16 +230,17 @@ let parse_ovf_from_ova ovf_filename =
for i = 0 to nr_nodes-1 do
let n = Xml.xpathobj_node obj i in
Xml.xpathctx_set_current_context xpathctx n;
- let vnet =
- Option.default (sprintf"eth%d" i)
- (xpath_string "rasd:ElementName/text()") in
+ let vnet, vnet_type =
+ match xpath_string "rasd:Connection/text()" with
+ | Some connection -> connection, Bridge
+ | None -> sprintf"eth%d" i, Network in
let mac = xpath_string "rasd:Address/...
2016 Sep 08
1
[PATCH] virt-v2v: Support for ova exported from AWS [v2]
...Havivi <shaharh@redhat.com>
---
v2v/input_ova.ml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml
index d86c637..974caeb 100644
--- a/v2v/input_ova.ml
+++ b/v2v/input_ova.ml
@@ -185,7 +185,8 @@ object
let name =
match xpath_string "/ovf:Envelope/ovf:VirtualSystem/ovf:Name/text()" with
| None | Some "" ->
- error (f_"could not parse ovf:Name from OVF document")
+ warning (f_"could not parse ovf:Name from OVF document");
+ "default"
| Some...
2017 Mar 16
2
[PATCH] v2v: -i libvirt: If <vcpu> is missing, calculate it from CPU topology.
...d, 16 insertions(+), 2 deletions(-)
diff --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 ?c...
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 Oct 13
0
[PATCH 1/5] v2v: Remove --dcpath parameter and related functionality.
...2v/copy_to_local.ml b/v2v/copy_to_local.ml
index 8a64f3a58..63e1ea310 100644
--- a/v2v/copy_to_local.ml
+++ b/v2v/copy_to_local.ml
@@ -245,8 +245,10 @@ and parse_libvirt_xml guest_name xml =
"vmware" "http://libvirt.org/schemas/domain/vmware/1.0";
let xpath_string = xpath_string xpathctx in
- (* Get the dcpath, only present for libvirt >= 1.2.20 so use a
- * sensible default for older versions.
+ (* Get the dcpath, present in libvirt >= 1.2.20.
+ * XXX Unfortunately when testing virt-v2v-copy-to-local against a
+ * local libvirt test XML file...
2016 Dec 09
2
Re: [PATCH v3 2/6] v2v: ova: don't detect compressed disks, read the OVF instead
...t; error (f_"no href in ovf:File (id=%s)") file_ref
> | Some s -> s in
>
> + let expr = sprintf "/ovf:Envelope/ovf:References/ovf:File[@ovf:id='%s']/@ovf:compression" file_ref in
> + let compressed =
> + match xpath_string expr with
> + | None | Some "identity" -> false
> + | Some "gzip" -> true
> + | Some s -> error (f_"unsupported compression in OVF: %s") s in
I'd still do the detection when no ovf:compression attribute is found
(...
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 Oct 13
7
[PATCH 0/5] v2v: Handle disks with snapshots (RHBZ#1172425).
The first commit removes the --dcpath parameter, which just makes the
following stuff simpler. Since libvirt has supported getting
datacenterpath from VMware since Oct 2015, it's time to drop this
hairy parameter.
The rest is quite a complicated series of refactorings, followed by a
very simple change to add handling of snapshots taken from old
virt-v2v.
Rich.
2018 Mar 23
2
[PATCH] v2v: ova: convert E1000 network interfaces as such
...from_ova.ml
index 24cd29d42..631d7d7f6 100644
--- a/v2v/parse_ovf_from_ova.ml
+++ b/v2v/parse_ovf_from_ova.ml
@@ -235,9 +235,14 @@ let parse_ovf_from_ova ovf_filename =
| Some connection -> connection, Bridge
| None -> sprintf "eth%d" i, Network in
let mac = xpath_string "rasd:Address/text()" in
+ let nic_model =
+ match xpath_string "rasd:ResourceSubType/text()" with
+ | Some "E1000" -> Some Source_e1000
+ | Some _ -> None (* Warn? *)
+ | None -> None in
let nic = {
s_mac = mac...