Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 00/11] Getting it work with SLES / openSUSE
Hi all, v2 includes all comments from Pino and Richard. I also removed the mkdir /run/lvm in the init since it only failed in one case and couldn't reproduce it anymore. Cédric Bosdonnat (11): v2v: also search for windows virtio drivers in symlinks Update packagelist for SLES and openSUSE customize: fix windows firstboot script customize: change windows firstboot path customize: add support for pvvxsvc v2v: document SUSE's Xen as a working input hypervisor v2v: add support for SUSE VMDP drivers v2v: don't set spice display if QXL isn't supported appliance: skip /etc/mtab creation is already existing v2v: rename RHEL 5 Xen input section into Xen in man v2v: improve initrd search appliance/init | 4 +- appliance/packagelist.in | 4 ++ builder/virt-builder.pod | 13 +++++-- customize/firstboot.ml | 51 ++++++++++++++----------- customize/virt-customize.pod | 6 +++ sysprep/virt-sysprep.pod | 6 +++ v2v/convert_linux.ml | 10 ++--- v2v/convert_windows.ml | 78 ++++++++++++++++++++++++++++---------- v2v/output_libvirt.ml | 4 +- v2v/test-v2v-in-place.sh | 2 +- v2v/test-v2v-virtio-win-iso.sh | 2 +- v2v/test-v2v-windows-conversion.sh | 2 +- v2v/virt-v2v.pod | 15 ++++++-- v2v/windows_virtio.ml | 37 ++++++++++++------ 14 files changed, 163 insertions(+), 71 deletions(-) -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 01/11] v2v: also search for windows virtio drivers in symlinks
To allow saving space in the package shipping the windows virtio drivers, we can use symlinks between the drivers folders. For example SUSE VMDP drivers are the same for Win8.1 and Win2012r2, one folder is a symlink to the other. To take advantages of this, find must use the -L flag. --- v2v/windows_virtio.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index be50107..7e9f735 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -222,7 +222,7 @@ and ddb_regedits current_cs drv_name drv_pciid and copy_drivers g inspect driverdir let ret = ref false in if is_directory virtio_win then ( - let cmd = sprintf "cd %s && find -type f" (quote virtio_win) in + let cmd = sprintf "cd %s && find -L -type f" (quote virtio_win) in let paths = external_command cmd in List.iter ( fun path -> -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 02/11] Update packagelist for SLES and openSUSE
SUSE Linux Entreprise Server doesn't have dhcpcd and the hivex package is not in the default repositories. Better use dhcp-client and libhivex0. openSUSE needs ntfs-3g and ntfsprogs packages. --- appliance/packagelist.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appliance/packagelist.in b/appliance/packagelist.in index daf589e..a1f14e5 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -133,6 +133,7 @@ ifelse(SUSE,1, btrfsprogs cryptsetup dhcpcd + dhcp-client genisoimage glibc-locale gptfdisk @@ -140,9 +141,12 @@ ifelse(SUSE,1, iproute2 iputils libcap2 + libhivex0 libselinux1 libyajl2 mkisofs + ntfsprogs + ntfs-3g reiserfs systemd vim -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 03/11] 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 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/customize/firstboot.ml b/customize/firstboot.ml index aa5b694..83bd808 100644 --- a/customize/firstboot.ml +++ b/customize/firstboot.ml @@ -232,7 +232,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 @@ -244,15 +244,14 @@ if not exist \"%%scripts_done%%\" ( for %%%%f in (\"%%scripts%%\"\\*.bat) do ( echo running \"%%%%f\" - call \"%%%%f\" - set elvl=!errorlevel! - echo .... exit code !elvl! - if !elvl! equ 0 ( - move \"%%%%f\" \"%%scripts_done%%\" - ) + move \"%%%%f\" \"%%scripts_done%%\" + pushd \"%%scripts_done%%\" + call \"%%%%~nf\" + popd ) echo uninstalling firstboot service +rmdir /S /Q \"%%scripts_done%%\" rhsrvany.exe -s firstboot uninstall " firstboot_dir_win in -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 04/11] customize: change windows firstboot path
Rename the C:\Program Files\Red Hat\Firstboot folder into the more vendor independent C:\Program Files\Guestfs\Firstboot. --- builder/virt-builder.pod | 2 +- customize/firstboot.ml | 2 +- v2v/test-v2v-in-place.sh | 2 +- v2v/test-v2v-virtio-win-iso.sh | 2 +- v2v/test-v2v-windows-conversion.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod index 9a49138..dc36c13 100644 --- a/builder/virt-builder.pod +++ b/builder/virt-builder.pod @@ -849,7 +849,7 @@ C<VIRT_TOOLS_DATA_DIR> environment variable; if not set, a compiled-in default will be used (something like F</usr/share/virt-tools>). The output of the first boot scripts is available in the guest as -F<C:\Program Files\Red Hat\Firstboot\log.txt>. +F<C:\Program Files\Guestfs\Firstboot\log.txt>. =back diff --git a/customize/firstboot.ml b/customize/firstboot.ml index 83bd808..4167098 100644 --- a/customize/firstboot.ml +++ b/customize/firstboot.ml @@ -211,7 +211,7 @@ module Windows = struct g#mkdir_p firstboot_dir; loop firstboot_dir firstboot_dir_win path in - loop "" "C:" ["Program Files"; "Red Hat"; "Firstboot"] in + loop "" "C:" ["Program Files"; "Guestfs"; "Firstboot"] in g#mkdir_p (firstboot_dir // "scripts"); diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh index e55daa0..444790c 100755 --- a/v2v/test-v2v-in-place.sh +++ b/v2v/test-v2v-in-place.sh @@ -99,7 +99,7 @@ mktest () :> "$script" :> "$expected" -firstboot_dir="/Program Files/Red Hat/Firstboot" +firstboot_dir="/Program Files/Guestfs/Firstboot" mktest "is-dir \"$firstboot_dir\"" true mktest "is-file \"$firstboot_dir/firstboot.bat\"" true mktest "is-dir \"$firstboot_dir/scripts\"" true diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh index a9f937c..49cda02 100755 --- a/v2v/test-v2v-virtio-win-iso.sh +++ b/v2v/test-v2v-virtio-win-iso.sh @@ -93,7 +93,7 @@ mktest () :> "$script" :> "$expected" -firstboot_dir="/Program Files/Red Hat/Firstboot" +firstboot_dir="/Program Files/Guestfs/Firstboot" mktest "is-dir \"$firstboot_dir\"" true mktest "is-file \"$firstboot_dir/firstboot.bat\"" true mktest "is-dir \"$firstboot_dir/scripts\"" true diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh index 8406743..5e745c7 100755 --- a/v2v/test-v2v-windows-conversion.sh +++ b/v2v/test-v2v-windows-conversion.sh @@ -86,7 +86,7 @@ mktest () :> "$script" :> "$expected" -firstboot_dir="/Program Files/Red Hat/Firstboot" +firstboot_dir="/Program Files/Guestfs/Firstboot" mktest "is-dir \"$firstboot_dir\"" true mktest "is-file \"$firstboot_dir/firstboot.bat\"" true mktest "is-dir \"$firstboot_dir/scripts\"" true -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 05/11] customize: add support for pvvxsvc
SUSE VMDP comes with a replacement for rhsrvany.exe named pvvxsvc.exe. Check for either one of them instead of only rhsrvany. --- builder/virt-builder.pod | 11 +++++++++-- customize/firstboot.ml | 36 +++++++++++++++++++++--------------- customize/virt-customize.pod | 6 ++++++ sysprep/virt-sysprep.pod | 6 ++++++ v2v/virt-v2v.pod | 6 ++++++ 5 files changed, 48 insertions(+), 17 deletions(-) diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod index dc36c13..be5b568 100644 --- a/builder/virt-builder.pod +++ b/builder/virt-builder.pod @@ -840,11 +840,12 @@ F<~root/virt-sysprep-firstboot.log>. =item Windows F<rhsrvany.exe>, available from sources at -L<https://github.com/rwmjones/rhsrvany>, is installed to run the +L<https://github.com/rwmjones/rhsrvany>, or F<pvvxsvc.exe>, available +with SUSE VMDP is installed to run the first boot scripts. It is required, and the setup of first boot scripts will fail if it is not present. -F<rhsrvany.exe> is copied from the location pointed to by the +F<rhsrvany.exe> or F<pvvxsvc.exe> is copied from the location pointed to by the C<VIRT_TOOLS_DATA_DIR> environment variable; if not set, a compiled-in default will be used (something like F</usr/share/virt-tools>). @@ -1820,6 +1821,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. See also: C<https://github.com/rwmjones/rhsrvany> +=item F<pvvxsvc.exe> + +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" +script in Windows guests. It is required if you intend to use the +I<--firstboot> or I<--firstboot-command> options with Windows guests. + =back =item C<XDG_CACHE_HOME> diff --git a/customize/firstboot.ml b/customize/firstboot.ml index 4167098..5825a4a 100644 --- a/customize/firstboot.ml +++ b/customize/firstboot.ml @@ -185,19 +185,25 @@ module Windows = struct try Sys.getenv "VIRT_TOOLS_DATA_DIR" with Not_found -> Guestfs_config.datadir // "virt-tools" in - (* rhsrvany.exe must exist. + (* Either rhsrvany.exe or pvvxsvc.exe must exist. * * (Check also that it's not a dangling symlink but a real file). *) - let rhsrvany_exe = virt_tools_data_dir // "rhsrvany.exe" in - (try - let chan = open_in rhsrvany_exe in - close_in chan - with - Sys_error msg -> - error (f_"'%s' is missing. This file is required in order to install Windows firstboot scripts. You can get it by building rhsrvany (https://github.com/rwmjones/rhsrvany). Original error: %s") - rhsrvany_exe msg - ); + let services = ["rhsrvany.exe"; "pvvxsvc.exe"] in + let srvany + try + List.find ( + fun service -> + try + let chan = open_in (virt_tools_data_dir // service) in + close_in chan; + true + with _ -> + false + ) services + with Not_found -> + error (f_"One of rhsrvany.exe or pvvxsvc.exe is missing in %s. One of them is required in order to install Windows firstboot scripts. You can get one by building rhsrvany (https://github.com/rwmjones/rhsrvany)") + virt_tools_data_dir in (* Create a directory for firstboot files in the guest. *) let firstboot_dir, firstboot_dir_win @@ -215,8 +221,8 @@ module Windows = struct g#mkdir_p (firstboot_dir // "scripts"); - (* Copy rhsrvany to the guest. *) - g#upload rhsrvany_exe (firstboot_dir // "rhsrvany.exe"); + (* Copy pvvxsvc or rhsrvany to the guest. *) + g#upload (virt_tools_data_dir // srvany) (firstboot_dir // srvany); (* Write a firstboot.bat control script which just runs the other * scripts in the directory. Note we need to use CRLF line endings @@ -252,8 +258,8 @@ for %%%%f in (\"%%scripts%%\"\\*.bat) do ( echo uninstalling firstboot service rmdir /S /Q \"%%scripts_done%%\" -rhsrvany.exe -s firstboot uninstall -" firstboot_dir_win in +%s -s firstboot uninstall +" firstboot_dir_win srvany in g#write (firstboot_dir // "firstboot.bat") (unix2dos firstboot_script); @@ -282,7 +288,7 @@ rhsrvany.exe -s firstboot uninstall "Start", REG_DWORD 0x2_l; "ErrorControl", REG_DWORD 0x1_l; "ImagePath", - REG_SZ (firstboot_dir_win ^ "\\rhsrvany.exe -s firstboot"); + REG_SZ (sprintf "%s\\%s -s firstboot" firstboot_dir_win srvany); "DisplayName", REG_SZ "Virt tools firstboot service"; "ObjectName", REG_SZ "LocalSystem" ]; diff --git a/customize/virt-customize.pod b/customize/virt-customize.pod index 8fb9931..7654fee 100644 --- a/customize/virt-customize.pod +++ b/customize/virt-customize.pod @@ -250,6 +250,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. See also: C<https://github.com/rwmjones/rhsrvany> +=item F<pvvxsvc.exe> + +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" +script in Windows guests. It is required if you intend to use the +I<--firstboot> or I<--firstboot-command> options with Windows guests. + =back =back diff --git a/sysprep/virt-sysprep.pod b/sysprep/virt-sysprep.pod index 4bbba9a..d86b1e4 100644 --- a/sysprep/virt-sysprep.pod +++ b/sysprep/virt-sysprep.pod @@ -550,6 +550,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. See also: C<https://github.com/rwmjones/rhsrvany> +=item F<pvvxsvc.exe> + +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" +script in Windows guests. It is required if you intend to use the +I<--firstboot> or I<--firstboot-command> options with Windows guests. + =back =back diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod index f8d05ee..c2a2ed2 100644 --- a/v2v/virt-v2v.pod +++ b/v2v/virt-v2v.pod @@ -1847,6 +1847,12 @@ script in the guest during conversion of Windows guests. See also: C<https://github.com/rwmjones/rhsrvany> +=item F<pvvxsvc.exe> + +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" +script in Windows guests. It is required if you intend to use the +I<--firstboot> or I<--firstboot-command> options with Windows guests. + =item F<rhev-apt.exe> (Optional) -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 06/11] v2v: document SUSE's Xen as a working input hypervisor
--- v2v/virt-v2v.pod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod index c2a2ed2..293efeb 100644 --- a/v2v/virt-v2v.pod +++ b/v2v/virt-v2v.pod @@ -167,6 +167,8 @@ OVAs from other hypervisors will not work. =item RHEL 5 Xen +=item SUSE Xen + =item Citrix Xen Citrix Xen has not been recently tested. -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 07/11] 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 | 78 +++++++++++++++++++++++++++++++++++++------------- v2v/windows_virtio.ml | 35 +++++++++++++++------- 2 files changed, 82 insertions(+), 31 deletions(-) diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml index 5daae6c..f88d163 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,21 @@ 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 + | Some (_, installer_path) -> info (f_"No setup function for installer '%s'") installer_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 +241,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 7e9f735..74a1ab6 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-18 12:00 UTC
[Libguestfs] [PATCH v2 08/11] v2v: don't set spice display if QXL isn't supported
Setting spice display if we know the libvirt guest doesn't have QXL capabilities will only make the guest slower for the user. Fallback to VNC in such a case. A typical use case is when v2v-ing a windows guest without having the windows QXL driver at hand. --- v2v/output_libvirt.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml index bedd6b4..1999600 100644 --- a/v2v/output_libvirt.ml +++ b/v2v/output_libvirt.ml @@ -239,7 +239,9 @@ let create_libvirt_xml ?pool source target_buses guestcaps | Some { s_display_type = VNC } -> e "graphics" [ "type", "vnc" ] [] | Some { s_display_type = Spice } -> - e "graphics" [ "type", "spice" ] [] in + match guestcaps.gcaps_video with + | QXL -> e "graphics" [ "type", "spice" ] [] + | Cirrus -> e "graphics" [ "type", "vnc" ] [] in (match source.s_display with | Some { s_keymap = Some km } -> append_attr ("keymap", km) graphics -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 09/11] appliance: skip /etc/mtab creation is already existing
At least on openSUSE and SLES, the /etc/mtab file is already existing. Skipping the symlink creation in init removes one error message during the appliance boot. --- appliance/init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appliance/init b/appliance/init index eb60d06..3fdf4d0 100755 --- a/appliance/init +++ b/appliance/init @@ -66,7 +66,9 @@ ln -s ../run/lock /var/lock # On Fedora 23, util-linux creates /etc/mtab in %post .. stupid # and e2fsprogs fails if the link doesn't exist .. stupid stupid -ln -s /proc/mounts /etc/mtab +if ! test -e /etc/mtab; then + ln -s /proc/mounts /etc/mtab +fi # devtmpfs is required since udev 176 mount -t devtmpfs /dev /dev -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 10/11] v2v: rename RHEL 5 Xen input section into Xen in man
In virt-v2v man page the documentation on how to use RHEL 5 Xen as input is generic enough to fit other Xen versions. --- v2v/virt-v2v.pod | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod index 293efeb..292c5a3 100644 --- a/v2v/virt-v2v.pod +++ b/v2v/virt-v2v.pod @@ -338,7 +338,7 @@ Xen remote connections can be used. Other remote libvirt connections will not work in general. See also L</INPUT FROM VMWARE VCENTER SERVER>, -L</INPUT FROM RHEL 5 XEN> below. +L</INPUT FROM XEN> below. =item B<-if> format @@ -1228,9 +1228,10 @@ Perform the conversion of the guest using virt-v2v: Remove the F<guest.xml> and F<guest-disk*> files. -=head1 INPUT FROM RHEL 5 XEN +=head1 INPUT FROM XEN -Virt-v2v is able to import Xen guests from RHEL 5 Xen hosts. +Virt-v2v is able to import Xen guests from RHEL 5 Xen or SLES and +openSUSE Xen hosts. Virt-v2v uses libvirt for access to the remote Xen host, and therefore the input mode should be I<-i libvirt>. As this is the default, you -- 2.6.6
Cédric Bosdonnat
2016-May-18 12:00 UTC
[Libguestfs] [PATCH v2 11/11] v2v: improve initrd search
To make sure we can also find the initrd on openSUSE and SLES, we need two improvements: * the initrd filename may not end with '.img' * don't use the version + release from the RPM data, rather from the /lib/modules/<version>/ path as we need to find it out anyway. --- v2v/convert_linux.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index e23cd64..08b27d6 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -125,7 +125,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps let installed_kernels : kernel_info list let rex_ko = Str.regexp ".*\\.k?o\\(\\.xz\\)?$" in let rex_ko_extract = Str.regexp ".*/\\([^/]+\\)\\.k?o\\(\\.xz\\)?$" in - let rex_initrd = Str.regexp "^initr\\(d\\|amfs\\)-.*\\.img$" in + let rex_initrd = Str.regexp "^initr\\(d\\|amfs\\)-.*\\(\\.img\\)?$" in filter_map ( function | { G.app2_name = name } as app @@ -158,7 +158,8 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps (* Get/construct the version. XXX Read this from kernel file. *) let version - sprintf "%s-%s" app.G.app2_version app.G.app2_release in + let prefix_len = String.length "/lib/modules/" in + String.sub modpath prefix_len (String.length modpath - prefix_len) in (* Find the initramfs which corresponds to the kernel. * Since the initramfs is built at runtime, and doesn't have @@ -173,12 +174,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps let files List.filter ( fun n -> - String.find n app.G.app2_version >= 0 && - String.find n app.G.app2_release >= 0 + String.find n version >= 0 ) files in (* Don't consider kdump initramfs images (RHBZ#1138184). *) let files - List.filter (fun n -> String.find n "kdump.img" == -1) files in + List.filter (fun n -> String.find n "kdump" == -1) files in (* If several files match, take the shortest match. This * handles the case where we have a mix of same-version non-Xen * and Xen kernels: -- 2.6.6
Pino Toscano
2016-May-19 17:37 UTC
Re: [Libguestfs] [PATCH v2 00/11] Getting it work with SLES / openSUSE
On Wednesday 18 May 2016 14:00:48 Cédric Bosdonnat wrote:> Cédric Bosdonnat (11): > v2v: also search for windows virtio drivers in symlinks > Update packagelist for SLES and openSUSE > appliance: skip /etc/mtab creation is already existingThese LGTM, so I just pushed them. Thanks, -- Pino Toscano
Richard W.M. Jones
2016-May-20 09:21 UTC
Re: [Libguestfs] [PATCH v2 04/11] customize: change windows firstboot path
On Wed, May 18, 2016 at 02:00:52PM +0200, Cédric Bosdonnat wrote:> Rename the C:\Program Files\Red Hat\Firstboot folder into the more vendor > independent C:\Program Files\Guestfs\Firstboot. > --- > builder/virt-builder.pod | 2 +- > customize/firstboot.ml | 2 +- > v2v/test-v2v-in-place.sh | 2 +- > v2v/test-v2v-virtio-win-iso.sh | 2 +- > v2v/test-v2v-windows-conversion.sh | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod > index 9a49138..dc36c13 100644 > --- a/builder/virt-builder.pod > +++ b/builder/virt-builder.pod > @@ -849,7 +849,7 @@ C<VIRT_TOOLS_DATA_DIR> environment variable; if not set, a compiled-in > default will be used (something like F</usr/share/virt-tools>). > > The output of the first boot scripts is available in the guest as > -F<C:\Program Files\Red Hat\Firstboot\log.txt>. > +F<C:\Program Files\Guestfs\Firstboot\log.txt>. > > =back > > diff --git a/customize/firstboot.ml b/customize/firstboot.ml > index 83bd808..4167098 100644 > --- a/customize/firstboot.ml > +++ b/customize/firstboot.ml > @@ -211,7 +211,7 @@ module Windows = struct > g#mkdir_p firstboot_dir; > loop firstboot_dir firstboot_dir_win path > in > - loop "" "C:" ["Program Files"; "Red Hat"; "Firstboot"] in > + loop "" "C:" ["Program Files"; "Guestfs"; "Firstboot"] in > > g#mkdir_p (firstboot_dir // "scripts"); > > diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh > index e55daa0..444790c 100755 > --- a/v2v/test-v2v-in-place.sh > +++ b/v2v/test-v2v-in-place.sh > @@ -99,7 +99,7 @@ mktest () > :> "$script" > :> "$expected" > > -firstboot_dir="/Program Files/Red Hat/Firstboot" > +firstboot_dir="/Program Files/Guestfs/Firstboot" > mktest "is-dir \"$firstboot_dir\"" true > mktest "is-file \"$firstboot_dir/firstboot.bat\"" true > mktest "is-dir \"$firstboot_dir/scripts\"" true > diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh > index a9f937c..49cda02 100755 > --- a/v2v/test-v2v-virtio-win-iso.sh > +++ b/v2v/test-v2v-virtio-win-iso.sh > @@ -93,7 +93,7 @@ mktest () > :> "$script" > :> "$expected" > > -firstboot_dir="/Program Files/Red Hat/Firstboot" > +firstboot_dir="/Program Files/Guestfs/Firstboot" > mktest "is-dir \"$firstboot_dir\"" true > mktest "is-file \"$firstboot_dir/firstboot.bat\"" true > mktest "is-dir \"$firstboot_dir/scripts\"" true > diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh > index 8406743..5e745c7 100755 > --- a/v2v/test-v2v-windows-conversion.sh > +++ b/v2v/test-v2v-windows-conversion.sh > @@ -86,7 +86,7 @@ mktest () > :> "$script" > :> "$expected" > > -firstboot_dir="/Program Files/Red Hat/Firstboot" > +firstboot_dir="/Program Files/Guestfs/Firstboot" > mktest "is-dir \"$firstboot_dir\"" true > mktest "is-file \"$firstboot_dir/firstboot.bat\"" true > mktest "is-dir \"$firstboot_dir/scripts\"" trueI think we should do this unless Roman has any objection (eg. if you've got any software which depends on the specific path). So, ACK from me. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Richard W.M. Jones
2016-May-20 09:23 UTC
Re: [Libguestfs] [PATCH v2 05/11] customize: add support for pvvxsvc
On Wed, May 18, 2016 at 02:00:53PM +0200, Cédric Bosdonnat wrote:> SUSE VMDP comes with a replacement for rhsrvany.exe named pvvxsvc.exe. > Check for either one of them instead of only rhsrvany. > --- > builder/virt-builder.pod | 11 +++++++++-- > customize/firstboot.ml | 36 +++++++++++++++++++++--------------- > customize/virt-customize.pod | 6 ++++++ > sysprep/virt-sysprep.pod | 6 ++++++ > v2v/virt-v2v.pod | 6 ++++++ > 5 files changed, 48 insertions(+), 17 deletions(-) > > diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod > index dc36c13..be5b568 100644 > --- a/builder/virt-builder.pod > +++ b/builder/virt-builder.pod > @@ -840,11 +840,12 @@ F<~root/virt-sysprep-firstboot.log>. > =item Windows > > F<rhsrvany.exe>, available from sources at > -L<https://github.com/rwmjones/rhsrvany>, is installed to run the > +L<https://github.com/rwmjones/rhsrvany>, or F<pvvxsvc.exe>, available > +with SUSE VMDP is installed to run the > first boot scripts. It is required, and the setup of first boot > scripts will fail if it is not present. > > -F<rhsrvany.exe> is copied from the location pointed to by the > +F<rhsrvany.exe> or F<pvvxsvc.exe> is copied from the location pointed to by the > C<VIRT_TOOLS_DATA_DIR> environment variable; if not set, a compiled-in > default will be used (something like F</usr/share/virt-tools>). > > @@ -1820,6 +1821,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. > > See also: C<https://github.com/rwmjones/rhsrvany> > > +=item F<pvvxsvc.exe> > + > +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" > +script in Windows guests. It is required if you intend to use the > +I<--firstboot> or I<--firstboot-command> options with Windows guests. > + > =back > > =item C<XDG_CACHE_HOME> > diff --git a/customize/firstboot.ml b/customize/firstboot.ml > index 4167098..5825a4a 100644 > --- a/customize/firstboot.ml > +++ b/customize/firstboot.ml > @@ -185,19 +185,25 @@ module Windows = struct > try Sys.getenv "VIRT_TOOLS_DATA_DIR" > with Not_found -> Guestfs_config.datadir // "virt-tools" in > > - (* rhsrvany.exe must exist. > + (* Either rhsrvany.exe or pvvxsvc.exe must exist. > * > * (Check also that it's not a dangling symlink but a real file). > *) > - let rhsrvany_exe = virt_tools_data_dir // "rhsrvany.exe" in > - (try > - let chan = open_in rhsrvany_exe in > - close_in chan > - with > - Sys_error msg -> > - error (f_"'%s' is missing. This file is required in order to install Windows firstboot scripts. You can get it by building rhsrvany (https://github.com/rwmjones/rhsrvany). Original error: %s") > - rhsrvany_exe msg > - ); > + let services = ["rhsrvany.exe"; "pvvxsvc.exe"] in > + let srvany > + try > + List.find ( > + fun service -> > + try > + let chan = open_in (virt_tools_data_dir // service) in > + close_in chan; > + true > + with _ -> > + false > + ) services > + with Not_found -> > + error (f_"One of rhsrvany.exe or pvvxsvc.exe is missing in %s. One of them is required in order to install Windows firstboot scripts. You can get one by building rhsrvany (https://github.com/rwmjones/rhsrvany)") > + virt_tools_data_dir in > > (* Create a directory for firstboot files in the guest. *) > let firstboot_dir, firstboot_dir_win > @@ -215,8 +221,8 @@ module Windows = struct > > g#mkdir_p (firstboot_dir // "scripts"); > > - (* Copy rhsrvany to the guest. *) > - g#upload rhsrvany_exe (firstboot_dir // "rhsrvany.exe"); > + (* Copy pvvxsvc or rhsrvany to the guest. *) > + g#upload (virt_tools_data_dir // srvany) (firstboot_dir // srvany); > > (* Write a firstboot.bat control script which just runs the other > * scripts in the directory. Note we need to use CRLF line endings > @@ -252,8 +258,8 @@ for %%%%f in (\"%%scripts%%\"\\*.bat) do ( > > echo uninstalling firstboot service > rmdir /S /Q \"%%scripts_done%%\" > -rhsrvany.exe -s firstboot uninstall > -" firstboot_dir_win in > +%s -s firstboot uninstall > +" firstboot_dir_win srvany in > > g#write (firstboot_dir // "firstboot.bat") (unix2dos firstboot_script); > > @@ -282,7 +288,7 @@ rhsrvany.exe -s firstboot uninstall > "Start", REG_DWORD 0x2_l; > "ErrorControl", REG_DWORD 0x1_l; > "ImagePath", > - REG_SZ (firstboot_dir_win ^ "\\rhsrvany.exe -s firstboot"); > + REG_SZ (sprintf "%s\\%s -s firstboot" firstboot_dir_win srvany); > "DisplayName", REG_SZ "Virt tools firstboot service"; > "ObjectName", REG_SZ "LocalSystem" ]; > > diff --git a/customize/virt-customize.pod b/customize/virt-customize.pod > index 8fb9931..7654fee 100644 > --- a/customize/virt-customize.pod > +++ b/customize/virt-customize.pod > @@ -250,6 +250,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. > > See also: C<https://github.com/rwmjones/rhsrvany> > > +=item F<pvvxsvc.exe> > + > +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" > +script in Windows guests. It is required if you intend to use the > +I<--firstboot> or I<--firstboot-command> options with Windows guests. > + > =back > > =back > diff --git a/sysprep/virt-sysprep.pod b/sysprep/virt-sysprep.pod > index 4bbba9a..d86b1e4 100644 > --- a/sysprep/virt-sysprep.pod > +++ b/sysprep/virt-sysprep.pod > @@ -550,6 +550,12 @@ I<--firstboot> or I<--firstboot-command> options with Windows guests. > > See also: C<https://github.com/rwmjones/rhsrvany> > > +=item F<pvvxsvc.exe> > + > +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" > +script in Windows guests. It is required if you intend to use the > +I<--firstboot> or I<--firstboot-command> options with Windows guests. > + > =back > > =back > diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod > index f8d05ee..c2a2ed2 100644 > --- a/v2v/virt-v2v.pod > +++ b/v2v/virt-v2v.pod > @@ -1847,6 +1847,12 @@ script in the guest during conversion of Windows guests. > > See also: C<https://github.com/rwmjones/rhsrvany> > > +=item F<pvvxsvc.exe> > + > +This is a Windows binary shipped with SUSE VMDP, used to install a "firstboot" > +script in Windows guests. It is required if you intend to use the > +I<--firstboot> or I<--firstboot-command> options with Windows guests. > + > =item F<rhev-apt.exe> > > (Optional) > -- > 2.6.6Looks good, ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Richard W.M. Jones
2016-May-20 09:23 UTC
Re: [Libguestfs] [PATCH v2 06/11] v2v: document SUSE's Xen as a working input hypervisor
On Wed, May 18, 2016 at 02:00:54PM +0200, Cédric Bosdonnat wrote:> --- > v2v/virt-v2v.pod | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod > index c2a2ed2..293efeb 100644 > --- a/v2v/virt-v2v.pod > +++ b/v2v/virt-v2v.pod > @@ -167,6 +167,8 @@ OVAs from other hypervisors will not work. > > =item RHEL 5 Xen > > +=item SUSE Xen > + > =item Citrix Xen > > Citrix Xen has not been recently tested.ACK. 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
Richard W.M. Jones
2016-May-20 09:26 UTC
Re: [Libguestfs] [PATCH v2 07/11] v2v: add support for SUSE VMDP drivers
On Wed, May 18, 2016 at 02:00:55PM +0200, Cédric Bosdonnat wrote:> 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 > + | Some (_, installer_path) -> info (f_"No setup function for installer '%s'") installer_path;This final case (Some (_, ...)) shouldn't be needed. Does the compiler complain if you remove this line? The rest of this patch looks OK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2016-May-20 09:32 UTC
Re: [Libguestfs] [PATCH v2 08/11] v2v: don't set spice display if QXL isn't supported
On Wed, May 18, 2016 at 02:00:56PM +0200, Cédric Bosdonnat wrote:> Setting spice display if we know the libvirt guest doesn't have QXL > capabilities will only make the guest slower for the user. Fallback > to VNC in such a case. > > A typical use case is when v2v-ing a windows guest without having the > windows QXL driver at hand. > --- > v2v/output_libvirt.ml | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml > index bedd6b4..1999600 100644 > --- a/v2v/output_libvirt.ml > +++ b/v2v/output_libvirt.ml > @@ -239,7 +239,9 @@ let create_libvirt_xml ?pool source target_buses guestcaps > | Some { s_display_type = VNC } -> > e "graphics" [ "type", "vnc" ] [] > | Some { s_display_type = Spice } -> > - e "graphics" [ "type", "spice" ] [] in > + match guestcaps.gcaps_video with > + | QXL -> e "graphics" [ "type", "spice" ] [] > + | Cirrus -> e "graphics" [ "type", "vnc" ] [] in > > (match source.s_display with > | Some { s_keymap = Some km } -> append_attr ("keymap", km) graphicsI didn't have a comment on this patch before, but it doesn't look correct to me now. What it says is if we have a guest which originally was using SPICE [quite unusual -- does Xen support SPICE? if not, what kind of source hypervisor supports SPICE?], but during conversion we didn't manage to install a QXL driver, then we should switch the guest to use VNC. But that's a problem for two reasons: (a) You can use SPICE without any special drivers. It falls back to emulating a high resolution SVGA device. (b) We're changing the access method from SPICE to VNC, unnecessarily. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard W.M. Jones
2016-May-20 09:33 UTC
Re: [Libguestfs] [PATCH v2 10/11] v2v: rename RHEL 5 Xen input section into Xen in man
On Wed, May 18, 2016 at 02:00:58PM +0200, Cédric Bosdonnat wrote:> In virt-v2v man page the documentation on how to use RHEL 5 Xen as > input is generic enough to fit other Xen versions. > --- > v2v/virt-v2v.pod | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod > index 293efeb..292c5a3 100644 > --- a/v2v/virt-v2v.pod > +++ b/v2v/virt-v2v.pod > @@ -338,7 +338,7 @@ Xen remote connections can be used. Other remote libvirt connections > will not work in general. > > See also L</INPUT FROM VMWARE VCENTER SERVER>, > -L</INPUT FROM RHEL 5 XEN> below. > +L</INPUT FROM XEN> below. > > =item B<-if> format > > @@ -1228,9 +1228,10 @@ Perform the conversion of the guest using virt-v2v: > > Remove the F<guest.xml> and F<guest-disk*> files. > > -=head1 INPUT FROM RHEL 5 XEN > +=head1 INPUT FROM XEN > > -Virt-v2v is able to import Xen guests from RHEL 5 Xen hosts. > +Virt-v2v is able to import Xen guests from RHEL 5 Xen or SLES and > +openSUSE Xen hosts. > > Virt-v2v uses libvirt for access to the remote Xen host, and therefore > the input mode should be I<-i libvirt>. As this is the default, youThis is fine, ACK. 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
Richard W.M. Jones
2016-May-20 09:33 UTC
Re: [Libguestfs] [PATCH v2 11/11] v2v: improve initrd search
On Wed, May 18, 2016 at 02:00:59PM +0200, Cédric Bosdonnat wrote:> To make sure we can also find the initrd on openSUSE and SLES, we need two improvements: > * the initrd filename may not end with '.img' > * don't use the version + release from the RPM data, rather from the > /lib/modules/<version>/ path as we need to find it out anyway. > --- > v2v/convert_linux.ml | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml > index e23cd64..08b27d6 100644 > --- a/v2v/convert_linux.ml > +++ b/v2v/convert_linux.ml > @@ -125,7 +125,7 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > let installed_kernels : kernel_info list > let rex_ko = Str.regexp ".*\\.k?o\\(\\.xz\\)?$" in > let rex_ko_extract = Str.regexp ".*/\\([^/]+\\)\\.k?o\\(\\.xz\\)?$" in > - let rex_initrd = Str.regexp "^initr\\(d\\|amfs\\)-.*\\.img$" in > + let rex_initrd = Str.regexp "^initr\\(d\\|amfs\\)-.*\\(\\.img\\)?$" in > filter_map ( > function > | { G.app2_name = name } as app > @@ -158,7 +158,8 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > > (* Get/construct the version. XXX Read this from kernel file. *) > let version > - sprintf "%s-%s" app.G.app2_version app.G.app2_release in > + let prefix_len = String.length "/lib/modules/" in > + String.sub modpath prefix_len (String.length modpath - prefix_len) in > > (* Find the initramfs which corresponds to the kernel. > * Since the initramfs is built at runtime, and doesn't have > @@ -173,12 +174,11 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > let files > List.filter ( > fun n -> > - String.find n app.G.app2_version >= 0 && > - String.find n app.G.app2_release >= 0 > + String.find n version >= 0 > ) files in > (* Don't consider kdump initramfs images (RHBZ#1138184). *) > let files > - List.filter (fun n -> String.find n "kdump.img" == -1) files in > + List.filter (fun n -> String.find n "kdump" == -1) files in > (* If several files match, take the shortest match. This > * handles the case where we have a mix of same-version non-Xen > * and Xen kernels:This is fixed now, ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Richard W.M. Jones
2016-May-20 09:50 UTC
Re: [Libguestfs] [PATCH v2 04/11] customize: change windows firstboot path
On Fri, May 20, 2016 at 12:27:21PM +0300, Roman Kagan wrote:> On Fri, May 20, 2016 at 10:21:45AM +0100, Richard W.M. Jones wrote: > > On Wed, May 18, 2016 at 02:00:52PM +0200, Cédric Bosdonnat wrote: > > > Rename the C:\Program Files\Red Hat\Firstboot folder into the more vendor > > > independent C:\Program Files\Guestfs\Firstboot. > > > > I think we should do this unless Roman has any objection > > (eg. if you've got any software which depends on the > > specific path). > > No objections, the change is fine by me too.Thanks for confirming - patch pushed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Cedric Bosdonnat
2016-May-23 07:08 UTC
Re: [Libguestfs] [PATCH v2 05/11] customize: add support for pvvxsvc
On Fri, 2016-05-20 at 12:42 +0300, Roman Kagan wrote:> On Wed, May 18, 2016 at 02:00:53PM +0200, Cédric Bosdonnat wrote: > > SUSE VMDP comes with a replacement for rhsrvany.exe named > > pvvxsvc.exe. > > Check for either one of them instead of only rhsrvany. > > Does pvvxsvc do anything that rhsrvany doesn't?I don't know if rhsrvany does it too, but that tool is also used as a service to monitor the memory stats in the guest.> Wouldn't it make sense to just use the latter instead? AFAICS this > shouldn't be a problem for you license-wise.The thing is that we have it for a long time, it's already built with our VMDP tools while we don't build rhsrvany at all.> I don't have a problem with this patch, but I find it profitable to > avoid proliferation of identical tools and consolidate the effort on > maintaining a common toolset as far as the licensing and other > non-technical limitations allow.Not my decision... I'm using what we are providing to our customers ;) -- Cedric