[PATCH virt-v2v 0/3] in-place: Add new -O option to write inspector XML
https://issues.redhat.com/browse/RHEL-58032 This patch series adds the existing 'virt-v2v-inspector -O output.xml' option to virt-v2v-in-place. The main action is in patch #3. Rich.
Since this is typed literally make sure the whole string is emboldened, according to our usual style. --- docs/virt-v2v-inspector.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/virt-v2v-inspector.pod b/docs/virt-v2v-inspector.pod index 6b2ba2a9..8201fcf9 100644 --- a/docs/virt-v2v-inspector.pod +++ b/docs/virt-v2v-inspector.pod @@ -138,7 +138,7 @@ Display help. Write the output to a file called F<output.xml>. -=item B<-O> - +=item B<-O -> Write the output to stdout. This is also the default if the I<-O> option is omitted. -- 2.47.0
Simple code motion, so that we can reuse this code in virt-v2v-in-place. --- inspector/Makefile.am | 2 + inspector/create_inspector_xml.ml | 167 +++++++++++++++++++++++++++++ inspector/create_inspector_xml.mli | 22 ++++ inspector/inspector.ml | 144 +------------------------ 4 files changed, 193 insertions(+), 142 deletions(-) diff --git a/inspector/Makefile.am b/inspector/Makefile.am index 172b2dc0..15f8cc34 100644 --- a/inspector/Makefile.am +++ b/inspector/Makefile.am @@ -23,9 +23,11 @@ EXTRA_DIST = \ $(SOURCES_C) SOURCES_MLI = \ + create_inspector_xml.mli \ inspector.mli SOURCES_ML = \ + create_inspector_xml.ml \ inspector.ml SOURCES_C = \ diff --git a/inspector/create_inspector_xml.ml b/inspector/create_inspector_xml.ml new file mode 100644 index 00000000..a3281d46 --- /dev/null +++ b/inspector/create_inspector_xml.ml @@ -0,0 +1,167 @@ +(* virt-v2v-inspector + * Copyright (C) 2009-2022 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +open Printf + +open Std_utils +open Tools_utils + +open Types +open Utils +open DOM + +(* This is where we construct the final XML document based on + * these inputs: + * - Global configuration like the version of v2v etc. + * - The NBD input sockets: v2vdir // "in0", "in1", etc + * - The inspection data (Types.inspect) + *) +let rec create_inspector_xml v2vdir inspect target_meta = + let body = ref [] in + + (* Record the version of virt-v2v etc, mainly for debugging. *) + List.push_back_list body [ + Comment generated_by; + e "program" [] [PCData "virt-v2v-inspector"]; + e "package" [] [PCData Config.package_name]; + e "version" [] [PCData Config.package_version]; + ]; + + (* The disks. *) + let disks = ref [] in + + List.iter ( + fun (i, virtual_size) -> + let elems = ref [] in + List.push_back elems (e "virtual-size" [] + [PCData (Int64.to_string virtual_size)]); + (match get_input_disk_allocated v2vdir i with + | None -> () + | Some real_size -> + List.push_back elems (e "allocated" [ "estimated", "true" ] + [PCData (Int64.to_string real_size)]) + ); + + List.push_back disks (e "disk" [ "index", string_of_int i ] !elems) + ) (get_disks v2vdir); + List.push_back body (e "disks" [] !disks); + + (* The <firmware> field is outside the <operatingsystem> element, + * since firmware is not part of the OS, and also because this is + * consistent with virt-drivers output. + *) + List.push_back body + (e "firmware" + ["type", + string_of_target_firmware target_meta.target_firmware] + []); + + (* The inspection data. *) + (* NB: Keep these field names compatible with virt-inspector! *) + let os = ref [] in + List.push_back os (e "name" [] [PCData inspect.i_type]); + List.push_back os (e "distro" [] [PCData inspect.i_distro]); + List.push_back os (e "osinfo" [] [PCData inspect.i_osinfo]); + List.push_back os (e "arch" [] [PCData inspect.i_arch]); + List.push_back os (e "major_version" [] + [PCData (string_of_int inspect.i_major_version)]); + List.push_back os (e "minor_version" [] + [PCData (string_of_int inspect.i_minor_version)]); + if inspect.i_package_format <> "" then + List.push_back os (e "package_format" [] + [PCData inspect.i_package_format]); + if inspect.i_package_management <> "" then + List.push_back os (e "package_management" [] + [PCData inspect.i_package_management]); + if inspect.i_product_name <> "" then + List.push_back os (e "product_name" [] [PCData inspect.i_product_name]); + if inspect.i_product_variant <> "" then + List.push_back os (e "product_variant" [] + [PCData inspect.i_product_variant]); + + if inspect.i_windows_systemroot <> "" then + List.push_back os (e "windows_systemroot" [] + [PCData inspect.i_windows_systemroot]); + if inspect.i_windows_software_hive <> "" then + List.push_back os (e "windows_software_hive" [] + [PCData inspect.i_windows_software_hive]); + if inspect.i_windows_systemroot <> "" then + List.push_back os (e "windows_system_hive" [] + [PCData inspect.i_windows_system_hive]); + if inspect.i_windows_current_control_set <> "" then + List.push_back os (e "windows_current_control_set" [] + [PCData inspect.i_windows_current_control_set]); + + List.push_back os (e "root" [] [PCData inspect.i_root]); + let mps = ref [] in + List.iter ( + fun (fs, dev) -> + List.push_back mps (e "mountpoint" [ "dev", dev ] [PCData fs]) + ) inspect.i_mountpoints; + List.push_back os (e "mountpoints" [] !mps); + + List.push_back body (e "operatingsystem" [] !os); + + (* Construct the final document. *) + (doc "v2v-inspection" [] !body : DOM.doc) + + +(* This is a copy of {!Output.get_disks}. *) +and get_disks dir = + let rec loop acc i = + let socket = sprintf "%s/in%d" dir i in + if Sys.file_exists socket then ( + let size = Utils.with_nbd_connect_unix ~socket NBD.get_size in + loop ((i, size) :: acc) (i+1) + ) + else + List.rev acc + in + loop [] 0 + +(* This is like {!Utils.get_disk_allocated} but works on the input disks. *) +and get_input_disk_allocated dir i = + let socket = sprintf "%s/in%d" dir i + and alloc_ctx = "base:allocation" in + with_nbd_connect_unix ~socket ~meta_contexts:[alloc_ctx] + (fun nbd -> + if NBD.can_meta_context nbd alloc_ctx then ( + (* Get the list of extents, using a 2GiB chunk size as hint. *) + let size = NBD.get_size nbd + and allocated = ref 0_L + and fetch_offset = ref 0_L in + while !fetch_offset < size do + let remaining = size -^ !fetch_offset in + let fetch_size = min 0x8000_0000_L remaining in + NBD.block_status nbd fetch_size !fetch_offset + (fun ctx offset entries err -> + assert (ctx = alloc_ctx); + for i = 0 to Array.length entries / 2 - 1 do + let len = entries.(i * 2) + and typ = entries.(i * 2 + 1) in + assert (len > 0_L); + if typ &^ 1_L = 0_L then + allocated := !allocated +^ len; + fetch_offset := !fetch_offset +^ len + done; + 0 + ) + done; + Some !allocated + ) else None + ) diff --git a/inspector/create_inspector_xml.mli b/inspector/create_inspector_xml.mli new file mode 100644 index 00000000..4f09269c --- /dev/null +++ b/inspector/create_inspector_xml.mli @@ -0,0 +1,22 @@ +(* virt-v2v-in-place + * Copyright (C) 2009-2024 Red Hat Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) + +val create_inspector_xml : string -> Types.inspect -> Types.target_meta -> + DOM.doc +(** Create the XML output of virt-v2v-inspector which contains the + post-conversion metadata. *) diff --git a/inspector/inspector.ml b/inspector/inspector.ml index 1ad67bbc..2f1324d6 100644 --- a/inspector/inspector.ml +++ b/inspector/inspector.ml @@ -27,7 +27,7 @@ open Getopt.OptionName open Types open Utils -open DOM +open Create_inspector_xml (* Matches --mac command line parameters. *) let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$" @@ -368,7 +368,7 @@ read the man page virt-v2v-inspector(1). ); (* Dump out the information. *) - let doc = inspector_xml v2vdir inspect target_meta in + let doc = create_inspector_xml v2vdir inspect target_meta in let chan = match output_file with | None -> Stdlib.stdout @@ -404,144 +404,4 @@ and check_host_free_space () = \"Minimum free space check in the host\".") large_tmpdir (human_size free_space) -(* This is a copy of {!Output.get_disks}. *) -and get_disks dir = - let rec loop acc i = - let socket = sprintf "%s/in%d" dir i in - if Sys.file_exists socket then ( - let size = Utils.with_nbd_connect_unix ~socket NBD.get_size in - loop ((i, size) :: acc) (i+1) - ) - else - List.rev acc - in - loop [] 0 - -(* This is like {!Utils.get_disk_allocated} but works on the input disks. *) -and get_input_disk_allocated dir i = - let socket = sprintf "%s/in%d" dir i - and alloc_ctx = "base:allocation" in - with_nbd_connect_unix ~socket ~meta_contexts:[alloc_ctx] - (fun nbd -> - if NBD.can_meta_context nbd alloc_ctx then ( - (* Get the list of extents, using a 2GiB chunk size as hint. *) - let size = NBD.get_size nbd - and allocated = ref 0_L - and fetch_offset = ref 0_L in - while !fetch_offset < size do - let remaining = size -^ !fetch_offset in - let fetch_size = min 0x8000_0000_L remaining in - NBD.block_status nbd fetch_size !fetch_offset - (fun ctx offset entries err -> - assert (ctx = alloc_ctx); - for i = 0 to Array.length entries / 2 - 1 do - let len = entries.(i * 2) - and typ = entries.(i * 2 + 1) in - assert (len > 0_L); - if typ &^ 1_L = 0_L then - allocated := !allocated +^ len; - fetch_offset := !fetch_offset +^ len - done; - 0 - ) - done; - Some !allocated - ) else None - ) - -(* This is where we construct the final XML document based on - * these inputs: - * - Global configuration like the version of v2v etc. - * - The NBD input sockets: v2vdir // "in0", "in1", etc - * - The inspection data (Types.inspect) - *) -and inspector_xml v2vdir inspect target_meta = - let body = ref [] in - - (* Record the version of virt-v2v etc, mainly for debugging. *) - List.push_back_list body [ - Comment generated_by; - e "program" [] [PCData "virt-v2v-inspector"]; - e "package" [] [PCData Config.package_name]; - e "version" [] [PCData Config.package_version]; - ]; - - (* The disks. *) - let disks = ref [] in - - List.iter ( - fun (i, virtual_size) -> - let elems = ref [] in - List.push_back elems (e "virtual-size" [] - [PCData (Int64.to_string virtual_size)]); - (match get_input_disk_allocated v2vdir i with - | None -> () - | Some real_size -> - List.push_back elems (e "allocated" [ "estimated", "true" ] - [PCData (Int64.to_string real_size)]) - ); - - List.push_back disks (e "disk" [ "index", string_of_int i ] !elems) - ) (get_disks v2vdir); - List.push_back body (e "disks" [] !disks); - - (* The <firmware> field is outside the <operatingsystem> element, - * since firmware is not part of the OS, and also because this is - * consistent with virt-drivers output. - *) - List.push_back body - (e "firmware" - ["type", - string_of_target_firmware target_meta.target_firmware] - []); - - (* The inspection data. *) - (* NB: Keep these field names compatible with virt-inspector! *) - let os = ref [] in - List.push_back os (e "name" [] [PCData inspect.i_type]); - List.push_back os (e "distro" [] [PCData inspect.i_distro]); - List.push_back os (e "osinfo" [] [PCData inspect.i_osinfo]); - List.push_back os (e "arch" [] [PCData inspect.i_arch]); - List.push_back os (e "major_version" [] - [PCData (string_of_int inspect.i_major_version)]); - List.push_back os (e "minor_version" [] - [PCData (string_of_int inspect.i_minor_version)]); - if inspect.i_package_format <> "" then - List.push_back os (e "package_format" [] - [PCData inspect.i_package_format]); - if inspect.i_package_management <> "" then - List.push_back os (e "package_management" [] - [PCData inspect.i_package_management]); - if inspect.i_product_name <> "" then - List.push_back os (e "product_name" [] [PCData inspect.i_product_name]); - if inspect.i_product_variant <> "" then - List.push_back os (e "product_variant" [] - [PCData inspect.i_product_variant]); - - if inspect.i_windows_systemroot <> "" then - List.push_back os (e "windows_systemroot" [] - [PCData inspect.i_windows_systemroot]); - if inspect.i_windows_software_hive <> "" then - List.push_back os (e "windows_software_hive" [] - [PCData inspect.i_windows_software_hive]); - if inspect.i_windows_systemroot <> "" then - List.push_back os (e "windows_system_hive" [] - [PCData inspect.i_windows_system_hive]); - if inspect.i_windows_current_control_set <> "" then - List.push_back os (e "windows_current_control_set" [] - [PCData inspect.i_windows_current_control_set]); - - List.push_back os (e "root" [] [PCData inspect.i_root]); - let mps = ref [] in - List.iter ( - fun (fs, dev) -> - List.push_back mps (e "mountpoint" [ "dev", dev ] [PCData fs]) - ) inspect.i_mountpoints; - List.push_back os (e "mountpoints" [] !mps); - - List.push_back body (e "operatingsystem" [] !os); - - (* Construct the final document. *) - (doc "v2v-inspection" [] !body : DOM.doc) - let () = run_main_and_handle_errors main -- 2.47.0
When using virt-v2v-in-place previously, there was no easy way to get the post-conversion information, such as the operating system and firmware that virt-v2v detected inside the guest. This adds a new, optional -O output.xml file to write this information out to a file. The format is identical to virt-v2v-inspector (and roughly a superset of virt-inspector). Fixes: https://issues.redhat.com/browse/RHEL-58032 Thanks: Martin Necas --- docs/virt-v2v-in-place.pod | 18 ++++++++ in-place/Makefile.am | 2 + in-place/in_place.ml | 39 +++++++++++----- subdir-rules.mk | 2 + tests/Makefile.am | 2 + tests/test-v2v-in-place-xml.sh | 81 ++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 10 deletions(-) diff --git a/docs/virt-v2v-in-place.pod b/docs/virt-v2v-in-place.pod index c91dc1d3..62e4ef5b 100644 --- a/docs/virt-v2v-in-place.pod +++ b/docs/virt-v2v-in-place.pod @@ -7,10 +7,12 @@ virt-v2v-in-place - Convert a guest to use KVM in-place virt-v2v-in-place -i disk [other -i* options] [virt-customize options] filename + [-O output.xml] virt-v2v-in-place -i libvirt|libvirtxml [other -i* options] [virt-customize options] guest + [-O output.xml] =head1 DESCRIPTION @@ -35,6 +37,14 @@ If the guest has been copied to local libvirt then: virt-v2v-in-place -i libvirt guest +=head2 Output XML + +Optionally use the I<-O> option to write post-conversion metadata +about the guest to an XML file. This is in the same format as +L<virt-v2v-inspector(1)>. This can be used, for example, to find out +what operating system and firmware was found inside the guest during +conversion. + =head2 Exit code If virt-v2v-in-place fails it will return a non-zero (error) exit @@ -215,6 +225,14 @@ are mapped to C<out>. See L<virt-v2v(1)/Networks and bridges>. +=item B<-O> output.xml + +=item B<-O -> + +If this option is present, write post-conversion metadata about the +guest to the named XML file, or to stdout if I<-O -> is used. This is +in the same format as L<virt-v2v-inspector(1)>. + =item B<--print-source> Print information about the source guest and stop. This option is diff --git a/in-place/Makefile.am b/in-place/Makefile.am index 2fecb3a7..7db62ef0 100644 --- a/in-place/Makefile.am +++ b/in-place/Makefile.am @@ -57,6 +57,7 @@ OCAMLPACKAGES = \ -I $(top_builddir)/lib \ -I $(top_builddir)/input \ -I $(top_builddir)/convert \ + -I $(top_builddir)/inspector \ -I $(top_builddir)/common/mlstdutils \ -I $(top_builddir)/common/mlutils \ -I $(top_builddir)/common/mlgettext \ @@ -103,6 +104,7 @@ OCAMLLINKFLAGS = \ mlv2vlib.$(MLARCHIVE) \ mlconvert.$(MLARCHIVE) \ mlinput.$(MLARCHIVE) \ + $(top_builddir)/inspector/create_inspector_xml.$(MLOBJECT) \ $(LINK_CUSTOM_OCAMLC_ONLY) virt_v2v_in_place_DEPENDENCIES = \ diff --git a/in-place/in_place.ml b/in-place/in_place.ml index 8286dbc5..680853ee 100644 --- a/in-place/in_place.ml +++ b/in-place/in_place.ml @@ -28,6 +28,12 @@ open Getopt.OptionName open Types open Utils +open Create_inspector_xml + +type output_xml_option = + | No_output_xml | Output_xml_to_stdout + | Output_xml_to_file of string + (* Matches --mac command line parameters. *) let mac_re = PCRE.compile "^([[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}:[[:xdigit:]]{2}):(network|bridge|ip):(.*)$" let mac_ip_re = PCRE.compile "^([[:xdigit:]]|:|\\.)+$" @@ -62,6 +68,13 @@ let rec main () = in let network_map = Networks.create () in + + let output_file = ref No_output_xml in + let set_output_file_option filename = + if filename = "-" then output_file := Output_xml_to_stdout + else output_file := Output_xml_to_file filename + in + let static_ips = ref [] in let rec add_network str = match String.split ":" str with @@ -177,6 +190,8 @@ let rec main () = s_"Map network ‘in’ to ‘out’"; [ L"print-source" ], Getopt.Set print_source, s_"Print source and stop"; + [ S 'O' ], Getopt.String ("output.xml", set_output_file_option), + s_"Set the output filename"; [ L"root" ], Getopt.String ("ask|... ", set_root_choice), s_"How to choose root filesystem"; ] in @@ -235,6 +250,7 @@ read the man page virt-v2v-in-place(1). let input_conn = !input_conn in let input_mode = !input_mode in let print_source = !print_source in + let output_file = !output_file in let root_choice = !root_choice in let static_ips = !static_ips in @@ -252,6 +268,7 @@ read the man page virt-v2v-in-place(1). pr "mac-option\n"; pr "mac-ip-option\n"; pr "customize-ops\n"; + pr "output-xml-option\n"; pr "input:disk\n"; pr "input:libvirt\n"; pr "input:libvirtxml\n"; @@ -354,16 +371,18 @@ read the man page virt-v2v-in-place(1). ignore (Sys.command cmd) ); - (* XXX Should we create target metadata and if so where? - * - * If the input mode is libvirt, there is an argument for - * updating the libvirt XML of the guest. If the input - * mode is disk, maybe we should write <guestname>.xml. - * - * For the moment we just ignore the output from the - * conversion step. - *) - ignore (inspect, target_meta); + (* Write the post-conversion metadata, if asked. *) + let chan = + match output_file with + | No_output_xml -> None + | Output_xml_to_stdout -> Some Stdlib.stdout + | Output_xml_to_file filename -> Some (open_out filename) in + Option.iter ( + fun chan -> + let doc = create_inspector_xml v2vdir inspect target_meta in + DOM.doc_to_chan chan doc; + Stdlib.flush chan + ) chan; message (f_"Finishing off"); (* As the last thing, write a file indicating success before diff --git a/subdir-rules.mk b/subdir-rules.mk index e969f357..05221b95 100644 --- a/subdir-rules.mk +++ b/subdir-rules.mk @@ -47,10 +47,12 @@ $(top_builddir)/generator/generator: if !HAVE_OCAMLOPT MLARCHIVE = cma +MLOBJECT = cmo LINK_CUSTOM_OCAMLC_ONLY = -output-complete-exe BEST = c else MLARCHIVE = cmxa +MLOBJECT = cmx BEST = opt endif diff --git a/tests/Makefile.am b/tests/Makefile.am index edc8b910..7f30dcb9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,6 +79,7 @@ TESTS = \ test-v2v-i-disk-parallel.sh \ test-v2v-i-ova.sh \ test-v2v-in-place.sh \ + test-v2v-in-place-xml.sh \ test-v2v-checksum-good.sh \ test-v2v-checksum-good-qcow2.sh \ test-v2v-checksum-bad.sh \ @@ -253,6 +254,7 @@ EXTRA_DIST += \ test-v2v-i-vmx-6.vmx \ test-v2v-i-vmx-7.vmx \ test-v2v-in-place.sh \ + test-v2v-in-place-xml.sh \ test-v2v-block-driver.sh \ test-v2v-inspector.sh \ test-v2v-it-vddk-io-query.sh \ diff --git a/tests/test-v2v-in-place-xml.sh b/tests/test-v2v-in-place-xml.sh new file mode 100755 index 00000000..30969ec5 --- /dev/null +++ b/tests/test-v2v-in-place-xml.sh @@ -0,0 +1,81 @@ +#!/bin/bash - +# libguestfs virt-v2v test script +# Copyright (C) 2014 Red Hat Inc. +# Copyright (C) 2015 Parallels IP Holdings GmbH. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# Test virt-v2v-in-place. + +unset CDPATH +export LANG=C +set -e + +source ./functions.sh +set -e +set -x + +skip_if_skipped +requires test -f ../test-data/phony-guests/windows.img + +img_base="$abs_top_builddir/test-data/phony-guests/windows.img" + +export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools" +export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win" + +d=$PWD/test-v2v-in-place-xml.d +rm -rf $d +cleanup_fn rm -r $d +mkdir $d + +img="$d/test.qcow2" +qemu-img convert -f raw $img_base -O qcow2 $img + +out="$d/out.xml" + +libvirt_xml="$d/test.xml" +rm -f $libvirt_xml +n=windows +cat > $libvirt_xml <<EOF +<node> + <domain type='test'> + <name>$n</name> + <memory>1048576</memory> + <os> + <type>hvm</type> + <boot dev='hd'/> + </os> + <devices> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2'/> + <source file='$img'/> + <target dev='vda' bus='virtio'/> + </disk> + </devices> + </domain> +</node> +EOF + +$VG virt-v2v-in-place --debug-gc -i libvirt -ic "test://$libvirt_xml" \ + $n -O $out +cat $out + +# Expect certain elements to be present. +grep '^<v2v-inspection' $out +grep '<program>virt-v2v-inspector</program>' $out +grep '<disks>' $out +grep "<disk index='0'>" $out +grep '<distro>windows</distro>' $out +grep '<osinfo>win2k22</osinfo>' $out -- 2.47.0
participants (1)
-
Richard W.M. Jones