Hi there, Here is v3 of the remaining patches. Diff to v2: * Removed the patch related to QXL * Fixed the firstboot script with Roman's comments * Fixed ova with subfolders test * Handle MF-relative path in ova files * Fixed now unneeded match case as per Richard's comment Cédric Bosdonnat (3): customize: fix windows firstboot script v2v: add support for SUSE VMDP drivers v2v: handle subfolders in ova files customize/firstboot.ml | 10 +-- v2v/Makefile.am | 1 + v2v/convert_windows.ml | 77 +++++++++++++----- v2v/input_ova.ml | 6 +- v2v/test-v2v-i-ova-subfolders.expected | 18 +++++ v2v/test-v2v-i-ova-subfolders.ovf | 138 +++++++++++++++++++++++++++++++++ v2v/test-v2v-i-ova-subfolders.sh | 65 ++++++++++++++++ v2v/windows_virtio.ml | 35 ++++++--- 8 files changed, 312 insertions(+), 38 deletions(-) create mode 100644 v2v/test-v2v-i-ova-subfolders.expected create mode 100644 v2v/test-v2v-i-ova-subfolders.ovf create mode 100755 v2v/test-v2v-i-ova-subfolders.sh -- 2.6.6
Cédric Bosdonnat
2016-May-23 13:31 UTC
[Libguestfs] [PATCH v3 1/3] customize: fix windows firstboot script
Sync the windows firstboot script with its linux brother. Also change the main redirection to append to the log rather than overwriting it. With this change, the firstboot script will resist reboots in the executed scripts. --- customize/firstboot.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/customize/firstboot.ml b/customize/firstboot.ml index d9c012f..1f4a940 100644 --- a/customize/firstboot.ml +++ b/customize/firstboot.ml @@ -238,7 +238,7 @@ set log=%%firstboot%%\\log.txt set scripts=%%firstboot%%\\scripts set scripts_done=%%firstboot%%\\scripts-done -call :main > \"%%log%%\" 2>&1 +call :main >> \"%%log%%\" 2>&1 exit /b :main @@ -250,12 +250,12 @@ if not exist \"%%scripts_done%%\" ( for %%%%f in (\"%%scripts%%\"\\*.bat) do ( echo running \"%%%%f\" - call \"%%%%f\" + move \"%%%%f\" \"%%scripts_done%%\" + pushd \"%%scripts_done%%\" + call \"%%%%~nf\" set elvl=!errorlevel! echo .... exit code !elvl! - if !elvl! equ 0 ( - move \"%%%%f\" \"%%scripts_done%%\" - ) + popd ) echo uninstalling firstboot service -- 2.6.6
Cédric Bosdonnat
2016-May-23 13:31 UTC
[Libguestfs] [PATCH v3 2/3] v2v: add support for SUSE VMDP drivers
To add this support, two things are needed: * make the existing code searches for either the viostor or the SUSE VMDP (Virtual Machine Driver Pack) files. * add a firstboot script setting up VMDP. Note that 2 firstboot scripts are intentionally added for the VMDP setup. This is due to windows potentially rebooting after loading the virtio block driver. It may happen that this reboot interrupts the VMDP setup in the firstboot script, we thus make sure the setup is run a second time in case it needs to finish the previous run. --- v2v/convert_windows.ml | 77 +++++++++++++++++++++++++++++++++++++------------- v2v/windows_virtio.ml | 35 +++++++++++++++-------- 2 files changed, 81 insertions(+), 31 deletions(-) diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml index aa5cb3b..62bb536 100644 --- a/v2v/convert_windows.ml +++ b/v2v/convert_windows.ml @@ -43,18 +43,25 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source rcaps try Sys.getenv "VIRT_TOOLS_DATA_DIR" with Not_found -> Guestfs_config.datadir // "virt-tools" in - (* Check if RHEV-APT exists. This is optional. *) - let rhev_apt_exe = virt_tools_data_dir // "rhev-apt.exe" in - let rhev_apt_exe + (* Check if either RHEV-APT or VMDP exists. This is optional. *) + let tools = [`RhevApt, "rhev-apt.exe"; `VmdpExe, "vmdp.exe"] in + let installer try - let chan = open_in rhev_apt_exe in - close_in chan; - Some rhev_apt_exe - with - Sys_error msg -> - warning (f_"'%s' is missing. Unable to install RHEV-APT (RHEV guest agent). Original error: %s") - rhev_apt_exe msg; - None in + let t, tool = List.find ( + fun (_, tool) -> + try ( + let exe_path = virt_tools_data_dir // tool in + let chan = open_in exe_path in + close_in chan; + true + ) with _ -> + false + ) tools in + Some (t, virt_tools_data_dir // tool) + with Not_found -> ( + warning (f_"Neither rhev-apt.exe nor vmdp.exe can be found. Unable to install one of them."); + None + ) in (* Get the Windows %systemroot%. *) let systemroot = g#inspect_get_windows_systemroot inspect.i_root in @@ -211,20 +218,20 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source rcaps (* Perform the conversion of the Windows guest. *) let rec configure_firstboot () - configure_rhev_apt (); + match installer with + | None -> () + | Some (`RhevApt, tool_path) -> configure_rhev_apt tool_path + | Some (`VmdpExe, tool_path) -> configure_vmdp tool_path; unconfigure_xenpv (); unconfigure_prltools () - and configure_rhev_apt () + and configure_rhev_apt tool_path (* Configure RHEV-APT (the RHEV guest agent). However if it doesn't * exist just warn about it and continue. *) - match rhev_apt_exe with - | None -> () - | Some rhev_apt_exe -> - g#upload rhev_apt_exe "/rhev-apt.exe"; (* XXX *) + g#upload tool_path "/rhev-apt.exe"; (* XXX *) - let fb_script = "\ + let fb_script = "\ @echo off echo installing rhev-apt @@ -233,8 +240,38 @@ echo installing rhev-apt echo starting rhev-apt net start rhev-apt " in - Firstboot.add_firstboot_script g inspect.i_root - "configure rhev-apt" fb_script + Firstboot.add_firstboot_script g inspect.i_root + "configure rhev-apt" fb_script + + and configure_vmdp tool_path + (* Configure VMDP if possible *) + g#upload tool_path "/vmdp.exe"; + + let fb_script = "\ +echo V2V first boot script started +echo Decompressing VMDP installer +\"\\vmdp.exe\" +pushd \"VMDP-*\" +echo Installing VMDP +setup.exe /eula_accepted /no_reboot +popd +" in + + let fb_recover_script = "\ +echo Finishing VMDP installation +if not exist VMDP-* ( + \"\\vmdp.exe\" +) +pushd \"VMDP-*\" +setup.exe /eula_accepted /no_reboot +popd +" in + + Firstboot.add_firstboot_script g inspect.i_root + "configure vmdp" fb_script; + + Firstboot.add_firstboot_script g inspect.i_root + "finish vmdp setup" fb_recover_script and unconfigure_xenpv () match xenpv_uninst with diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 07b4d4b..6c8396c 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -66,11 +66,20 @@ let rec install_drivers g inspect systemroot root current_cs rcaps else ( (* Can we install the block driver? *) let block : guestcaps_block_type - let has_viostor = g#exists (driverdir // "viostor.inf") in + let filenames = ["virtio_blk"; "vrtioblk"; "viostor"] in + let viostor_driver = try ( + Some ( + List.find ( + fun driver_file -> + let source = driverdir // driver_file ^ ".sys" in + g#exists source + ) filenames + ) + ) with Not_found -> None in let has_vioscsi = g#exists (driverdir // "vioscsi.inf") in - match rcaps.rcaps_block_bus, has_viostor, has_vioscsi with - | Some Virtio_blk, false, _ -> - error (f_"there is no viostor (virtio block device) driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s\n\nThe guest will be configured to use a slower emulated device.") + match rcaps.rcaps_block_bus, viostor_driver, has_vioscsi with + | Some Virtio_blk, None, _ -> + error (f_"there is no virtio block device driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s\n\nThe guest will be configured to use a slower emulated device.") inspect.i_major_version inspect.i_minor_version inspect.i_arch virtio_win @@ -79,20 +88,20 @@ let rec install_drivers g inspect systemroot root current_cs rcaps inspect.i_major_version inspect.i_minor_version inspect.i_arch virtio_win - | None, false, _ -> - warning (f_"there is no viostor (virtio block device) driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s\n\nThe guest will be configured to use a slower emulated device.") + | None, None, _ -> + warning (f_"there is no virtio block device driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s\n\nThe guest will be configured to use a slower emulated device.") inspect.i_major_version inspect.i_minor_version inspect.i_arch virtio_win; IDE - | (Some Virtio_blk | None), true, _ -> + | (Some Virtio_blk | None), Some driver_name, _ -> (* Block driver needs tweaks to allow booting; the rest is set up by PnP * manager *) - let source = driverdir // "viostor.sys" in - let target = sprintf "%s/system32/drivers/viostor.sys" systemroot in + let source = driverdir // (driver_name ^ ".sys") in + let target = sprintf "%s/system32/drivers/%s.sys" systemroot driver_name in let target = g#case_sensitive_path target in g#cp source target; - add_guestor_to_registry g root current_cs "viostor" + add_guestor_to_registry g root current_cs driver_name viostor_pciid; Virtio_blk @@ -112,7 +121,11 @@ let rec install_drivers g inspect systemroot root current_cs rcaps (* Can we install the virtio-net driver? *) let net : guestcaps_net_type - let has_netkvm = g#exists (driverdir // "netkvm.inf") in + let filenames = ["virtio_net.inf"; "netkvm.inf"] in + let has_netkvm + List.exists ( + fun driver_file -> g#exists (driverdir // driver_file) + ) filenames in match rcaps.rcaps_net_bus, has_netkvm with | Some Virtio_net, false -> error (f_"there is no virtio network driver for this version of Windows (%d.%d %s). virt-v2v looks for this driver in %s") -- 2.6.6
Cédric Bosdonnat
2016-May-23 13:31 UTC
[Libguestfs] [PATCH v3 3/3] v2v: handle subfolders in ova files
Some ova files hke those produced by SUSE Studio ave their ovf, mf and other files inside a folder rather than at the root of the tarball. Consider the paths relative to the ovf and mf files to cover this case too. --- v2v/Makefile.am | 1 + v2v/input_ova.ml | 6 +- v2v/test-v2v-i-ova-subfolders.expected | 18 +++++ v2v/test-v2v-i-ova-subfolders.ovf | 138 +++++++++++++++++++++++++++++++++ v2v/test-v2v-i-ova-subfolders.sh | 65 ++++++++++++++++ 5 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 v2v/test-v2v-i-ova-subfolders.expected create mode 100644 v2v/test-v2v-i-ova-subfolders.ovf create mode 100755 v2v/test-v2v-i-ova-subfolders.sh diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 0203317..1d219b6 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -294,6 +294,7 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test TESTS = \ test-v2v-i-ova-formats.sh \ test-v2v-i-ova-gz.sh \ + test-v2v-i-ova-subfolders.sh \ test-v2v-i-ova-two-disks.sh \ test-v2v-copy-to-local.sh \ test-v2v-bad-networks-and-bridges.sh diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 65a2028..08f10df 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -138,13 +138,14 @@ object let rex = Str.regexp "SHA1(\\(.*\\))=\\([0-9a-fA-F]+\\)\r?" in List.iter ( fun mf -> + let mf_folder = Filename.dirname mf in let chan = open_in mf in let rec loop () let line = input_line chan in if Str.string_match rex line 0 then ( let disk = Str.matched_group 1 line in let expected = Str.matched_group 2 line in - let cmd = sprintf "sha1sum %s" (quote (exploded // disk)) in + let cmd = sprintf "sha1sum %s" (quote (mf_folder // disk)) in let out = external_command cmd in match out with | [] -> @@ -163,6 +164,7 @@ object ) mf; (* Parse the ovf file. *) + let ovf_folder = Filename.dirname ovf in let xml = read_whole_file ovf in let doc = Xml.parse_memory xml in @@ -263,7 +265,7 @@ object | Some s -> s in (* Does the file exist and is it readable? *) - let filename = exploded // filename in + let filename = ovf_folder // filename in Unix.access filename [Unix.R_OK]; (* The spec allows the file to be gzip-compressed, in which case diff --git a/v2v/test-v2v-i-ova-subfolders.expected b/v2v/test-v2v-i-ova-subfolders.expected new file mode 100644 index 0000000..b6fdb07 --- /dev/null +++ b/v2v/test-v2v-i-ova-subfolders.expected @@ -0,0 +1,18 @@ +Source guest information (--print-source option): + + source name: 2K8R2EESP1_2_Medium +hypervisor type: vmware + memory: 1073741824 (bytes) + nr vCPUs: 1 + CPU features: + firmware: uefi + display: + video: + sound: +disks: + subfolder/disk1.vmdk (vmdk) [scsi] +removable media: + CD-ROM [ide] in slot 0 +NICs: + Network "Network adapter 1" + diff --git a/v2v/test-v2v-i-ova-subfolders.ovf b/v2v/test-v2v-i-ova-subfolders.ovf new file mode 100644 index 0000000..4827c7e --- /dev/null +++ b/v2v/test-v2v-i-ova-subfolders.ovf @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Envelope vmw:buildId="build-1750787" xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <References> + <File ovf:href="disk1.vmdk" ovf:id="file1" ovf:size="7804077568"/> + </References> + <DiskSection> + <Info>Virtual disk information</Info> + <Disk ovf:capacity="50" ovf:capacityAllocationUnits="byte * 2^30" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="18975752192"/> + </DiskSection> + <NetworkSection> + <Info>The list of logical networks</Info> + <Network ovf:name="PG-VLAN60"> + <Description>The PG-VLAN60 network</Description> + </Network> + </NetworkSection> + <VirtualSystem ovf:id="2K8R2EESP1_2_Medium"> + <Info>A virtual machine</Info> + <Name>2K8R2EESP1_2_Medium</Name> + <OperatingSystemSection ovf:id="103" vmw:osType="windows7Server64Guest"> + <Info>The kind of installed guest operating system</Info> + <Description>Microsoft Windows Server 2008 R2 (64-bit)</Description> + </OperatingSystemSection> + <VirtualHardwareSection> + <Info>Virtual hardware requirements</Info> + <System> + <vssd:ElementName>Virtual Hardware Family</vssd:ElementName> + <vssd:InstanceID>0</vssd:InstanceID> + <vssd:VirtualSystemIdentifier>2K8R2EESP1_2_Medium</vssd:VirtualSystemIdentifier> + <vssd:VirtualSystemType>vmx-10</vssd:VirtualSystemType> + </System> + <Item> + <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits> + <rasd:Description>Number of Virtual CPUs</rasd:Description> + <rasd:ElementName>1 virtual CPU(s)</rasd:ElementName> + <rasd:InstanceID>1</rasd:InstanceID> + <rasd:ResourceType>3</rasd:ResourceType> + <rasd:VirtualQuantity>1</rasd:VirtualQuantity> + </Item> + <Item> + <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits> + <rasd:Description>Memory Size</rasd:Description> + <rasd:ElementName>1024MB of memory</rasd:ElementName> + <rasd:InstanceID>2</rasd:InstanceID> + <rasd:ResourceType>4</rasd:ResourceType> + <rasd:VirtualQuantity>1024</rasd:VirtualQuantity> + </Item> + <Item> + <rasd:Address>0</rasd:Address> + <rasd:Description>SCSI Controller</rasd:Description> + <rasd:ElementName>SCSI controller 0</rasd:ElementName> + <rasd:InstanceID>3</rasd:InstanceID> + <rasd:ResourceSubType>lsilogicsas</rasd:ResourceSubType> + <rasd:ResourceType>6</rasd:ResourceType> + <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="160"/> + </Item> + <Item> + <rasd:Address>1</rasd:Address> + <rasd:Description>IDE Controller</rasd:Description> + <rasd:ElementName>IDE 1</rasd:ElementName> + <rasd:InstanceID>4</rasd:InstanceID> + <rasd:ResourceType>5</rasd:ResourceType> + </Item> + <Item> + <rasd:Address>0</rasd:Address> + <rasd:Description>IDE Controller</rasd:Description> + <rasd:ElementName>IDE 0</rasd:ElementName> + <rasd:InstanceID>5</rasd:InstanceID> + <rasd:ResourceType>5</rasd:ResourceType> + </Item> + <Item ovf:required="false"> + <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> + <rasd:ElementName>Video card</rasd:ElementName> + <rasd:InstanceID>6</rasd:InstanceID> + <rasd:ResourceType>24</rasd:ResourceType> + <vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="use3dRenderer" vmw:value="automatic"/> + <vmw:Config ovf:required="false" vmw:key="useAutoDetect" vmw:value="true"/> + <vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="4096"/> + </Item> + <Item ovf:required="false"> + <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> + <rasd:ElementName>VMCI device</rasd:ElementName> + <rasd:InstanceID>7</rasd:InstanceID> + <rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType> + <rasd:ResourceType>1</rasd:ResourceType> + <vmw:Config ovf:required="false" vmw:key="allowUnrestrictedCommunication" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="32"/> + </Item> + <Item ovf:required="false"> + <rasd:AddressOnParent>0</rasd:AddressOnParent> + <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation> + <rasd:ElementName>CD/DVD drive 1</rasd:ElementName> + <rasd:InstanceID>8</rasd:InstanceID> + <rasd:Parent>4</rasd:Parent> + <rasd:ResourceSubType>vmware.cdrom.atapi</rasd:ResourceSubType> + <rasd:ResourceType>15</rasd:ResourceType> + </Item> + <Item> + <rasd:AddressOnParent>0</rasd:AddressOnParent> + <rasd:ElementName>Hard disk 1</rasd:ElementName> + <rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource> + <rasd:InstanceID>9</rasd:InstanceID> + <rasd:Parent>3</rasd:Parent> + <rasd:ResourceType>17</rasd:ResourceType> + <vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/> + </Item> + <Item> + <rasd:AddressOnParent>7</rasd:AddressOnParent> + <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation> + <rasd:Connection>PG-VLAN60</rasd:Connection> + <rasd:Description>E1000 ethernet adapter on "PG-VLAN60"</rasd:Description> + <rasd:ElementName>Network adapter 1</rasd:ElementName> + <rasd:InstanceID>11</rasd:InstanceID> + <rasd:ResourceSubType>E1000</rasd:ResourceSubType> + <rasd:ResourceType>10</rasd:ResourceType> + <vmw:Config ovf:required="false" vmw:key="slotInfo.pciSlotNumber" vmw:value="33"/> + <vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/> + </Item> + <vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="cpuHotRemoveEnabled" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="efi"/> + <vmw:Config ovf:required="false" vmw:key="virtualICH7MPresent" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="virtualSMCPresent" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="nestedHVEnabled" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="soft"/> + <vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="soft"/> + <vmw:Config ovf:required="false" vmw:key="powerOpInfo.standbyAction" vmw:value="checkpoint"/> + <vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="hard"/> + <vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/> + <vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/> + <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/> + <vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/> + <vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/> + <vmw:Config ovf:required="false" vmw:key="tools.toolsUpgradePolicy" vmw:value="upgradeAtPowerCycle"/> + </VirtualHardwareSection> + </VirtualSystem> +</Envelope> diff --git a/v2v/test-v2v-i-ova-subfolders.sh b/v2v/test-v2v-i-ova-subfolders.sh new file mode 100755 index 0000000..a590fcc --- /dev/null +++ b/v2v/test-v2v-i-ova-subfolders.sh @@ -0,0 +1,65 @@ +#!/bin/bash - +# libguestfs virt-v2v test script +# Copyright (C) 2014 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. + +# Test -i ova option with files located in a subfolder. + +unset CDPATH +export LANG=C +set -e + +if [ -n "$SKIP_TEST_V2V_I_OVA_SUBFOLDERS_SH" ]; then + echo "$0: test skipped because environment variable is set" + exit 77 +fi + +if [ "$(guestfish get-backend)" = "uml" ]; then + echo "$0: test skipped because UML backend does not support network" + exit 77 +fi + +export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools" + +. $srcdir/../test-data/guestfs-hashsums.sh + +d=test-v2v-i-ova-subfolders.d +rm -rf $d +mkdir -p $d/subfolder + +cp test-v2v-i-ova-subfolders.ovf $d/subfolder/ + +pushd $d/subfolder + +truncate -s 10k disk1.vmdk +sha=`do_sha1 disk1.vmdk` +echo -e "SHA1(disk1.vmdk)=$sha\r" > disk1.mf + +cd .. +tar -cf test.ova subfolder +popd + +# Run virt-v2v but only as far as the --print-source stage, and +# normalize the output. +$VG virt-v2v --debug-gc --quiet \ + -i ova $d/test.ova \ + --print-source | +sed 's,[^ \t]*\(subfolder/disk.*\.vmdk\),\1,' > $d/source + +# Check the parsed source is what we expect. +diff -u test-v2v-i-ova-subfolders.expected $d/source + +rm -rf $d -- 2.6.6
Richard W.M. Jones
2016-May-24 08:18 UTC
Re: [Libguestfs] [PATCH v3 0/3] SUSE VMDP support
Thanks - I will push this series shortly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Maybe Matching Threads
- GIT: [PATCH 0/5] v2v: Multiple fixes for handling semi-standard OVA files (RHBZ#1152998).
- do we have support for xmlns in xml for v2v?
- [PATCH v7 0/1] Import directly from OVA tar archive if possible
- [PATCH v6 0/3] Import directly from OVA tar archive if possible
- [PATCH v5 0/3] Import directly from OVA tar archive if possible