Roman Kagan
2016-Feb-09 14:42 UTC
[Libguestfs] [PATCH] v2v: move virtio_win to windows_virtio
Now that all the stuff related to Windows virtio drivers has been moved into a dedicated module, it makes sense to move the definition of virtio_win there, too, and stop passing it around as a parameter. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> --- v2v/convert_windows.ml | 9 +-------- v2v/windows_virtio.ml | 13 ++++++++++--- v2v/windows_virtio.mli | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml index 38fa300..f6f0911 100644 --- a/v2v/convert_windows.ml +++ b/v2v/convert_windows.ml @@ -43,13 +43,6 @@ let convert ~keep_serial_console (g : G.guestfs) inspect source try Sys.getenv "VIRT_TOOLS_DATA_DIR" with Not_found -> Guestfs_config.datadir // "virt-tools" in - let virtio_win - try Sys.getenv "VIRTIO_WIN" - with Not_found -> - try Sys.getenv "VIRTIO_WIN_DIR" (* old name for VIRTIO_WIN *) - with Not_found -> - Guestfs_config.datadir // "virtio-win" 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 @@ -289,7 +282,7 @@ if errorlevel 3010 exit /b 0 disable_services root current_cs; disable_autoreboot root current_cs; - Windows_virtio.install_drivers g inspect systemroot virtio_win + Windows_virtio.install_drivers g inspect systemroot root current_cs and disable_services root current_cs diff --git a/v2v/windows_virtio.ml b/v2v/windows_virtio.ml index 7441169..bdce038 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -26,12 +26,19 @@ open Regedit open Types open Utils -let rec install_drivers g inspect systemroot virtio_win root current_cs +let virtio_win + try Sys.getenv "VIRTIO_WIN" + with Not_found -> + try Sys.getenv "VIRTIO_WIN_DIR" (* old name for VIRTIO_WIN *) + with Not_found -> + Guestfs_config.datadir // "virtio-win" + +let rec install_drivers g inspect systemroot root current_cs (* Copy the virtio drivers to the guest. *) let driverdir = sprintf "%s/Drivers/VirtIO" systemroot in g#mkdir_p driverdir; - if not (copy_drivers g inspect virtio_win driverdir) then ( + if not (copy_drivers g inspect driverdir) then ( warning (f_"there are no virtio drivers available for this version of Windows (%d.%d %s %s). virt-v2v looks for drivers in %s\n\nThe guest will be configured to use slower emulated devices.") inspect.i_major_version inspect.i_minor_version inspect.i_arch inspect.i_product_variant virtio_win; @@ -349,7 +356,7 @@ and add_viostor_to_driver_database g root arch current_cs (* Copy the matching drivers to the driverdir; return true if any have * been copied. *) -and copy_drivers g inspect virtio_win driverdir +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 diff --git a/v2v/windows_virtio.mli b/v2v/windows_virtio.mli index 9edf4ec..eb7a57a 100644 --- a/v2v/windows_virtio.mli +++ b/v2v/windows_virtio.mli @@ -19,7 +19,7 @@ (** Functions for installing Windows virtio drivers. *) val install_drivers - : Guestfs.guestfs -> Types.inspect -> string -> string -> int64 -> string -> + : Guestfs.guestfs -> Types.inspect -> string -> int64 -> string -> Types.guestcaps_block_type * Types.guestcaps_net_type * Types.guestcaps_video_type (** [install_drivers g inspect systemroot virtio_win root current_cs] installs virtio drivers from the driver directory or driver -- 2.5.0
Richard W.M. Jones
2016-Feb-09 16:37 UTC
Re: [Libguestfs] [PATCH] v2v: move virtio_win to windows_virtio
On Tue, Feb 09, 2016 at 05:42:00PM +0300, Roman Kagan wrote:> Now that all the stuff related to Windows virtio drivers has been moved > into a dedicated module, it makes sense to move the definition of > virtio_win there, too, and stop passing it around as a parameter.Yup, obviously simplification.> --- a/v2v/windows_virtio.mli > +++ b/v2v/windows_virtio.mli > @@ -19,7 +19,7 @@ > (** Functions for installing Windows virtio drivers. *) > > val install_drivers > - : Guestfs.guestfs -> Types.inspect -> string -> string -> int64 -> string -> > + : Guestfs.guestfs -> Types.inspect -> string -> int64 -> string -> > Types.guestcaps_block_type * Types.guestcaps_net_type * Types.guestcaps_video_type > (** [install_drivers g inspect systemroot virtio_win root current_cs] > installs virtio drivers from the driver directory or driverI made a minor additional change - fixing the documentation here. ACKed and pushed. Thanks, 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
Roman Kagan
2016-Feb-10 07:52 UTC
Re: [Libguestfs] [PATCH] v2v: move virtio_win to windows_virtio
On Tue, Feb 09, 2016 at 04:37:03PM +0000, Richard W.M. Jones wrote:> On Tue, Feb 09, 2016 at 05:42:00PM +0300, Roman Kagan wrote: > > Now that all the stuff related to Windows virtio drivers has been moved > > into a dedicated module, it makes sense to move the definition of > > virtio_win there, too, and stop passing it around as a parameter. > > Yup, obviously simplification. > > > --- a/v2v/windows_virtio.mli > > +++ b/v2v/windows_virtio.mli > > @@ -19,7 +19,7 @@ > > (** Functions for installing Windows virtio drivers. *) > > > > val install_drivers > > - : Guestfs.guestfs -> Types.inspect -> string -> string -> int64 -> string -> > > + : Guestfs.guestfs -> Types.inspect -> string -> int64 -> string -> > > Types.guestcaps_block_type * Types.guestcaps_net_type * Types.guestcaps_video_type > > (** [install_drivers g inspect systemroot virtio_win root current_cs] > > installs virtio drivers from the driver directory or driver > > I made a minor additional change - fixing the documentation here.OOPS, missed that, thanks for spotting and fixing. Roman.
Apparently Analagous Threads
- [PATCH 3/4] v2v: take requested caps into account when converting
- [PATCH v2 3/4] v2v: take requested caps into account when converting
- Re: [PATCH 3/4] v2v: take requested caps into account when converting
- [PATCH 07/11] v2v: add support for SUSE VMDP drivers
- Re: [PATCH 3/4] v2v: take requested caps into account when converting