Roman Kagan
2015-Mar-31 13:26 UTC
[Libguestfs] [PATCH v2] v2v: allow configurable location for virtio drivers
Make the location of the Windows virtio drivers overridable with the
environment variable VIRTIO_WIN_DIR, in the same vein as is done for
virt-tools.
Signed-off-by: Roman Kagan <rkagan@parallels.com>
---
changes from v1:
- document the new environment variable
v2v/convert_windows.ml | 4 +++-
v2v/virt-v2v.pod | 10 ++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 0cd818a..e966341 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -47,7 +47,9 @@ let convert ~verbose ~keep_serial_console (g : G.guestfs)
inspect source try Sys.getenv "VIRT_TOOLS_DATA_DIR"
with Not_found -> Config.datadir // "virt-tools" in
- let virtio_win_dir = "/usr/share/virtio-win" in
+ let virtio_win_dir + try Sys.getenv "VIRTIO_WIN_DIR"
+ with Not_found -> 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
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index 7b6419e..4f7088c 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -720,8 +720,9 @@ below.
OpenSUSE 10 kernel >= 2.6.25.5-1.1
- Windows Drivers are installed from /usr/share/virtio-win
- if present
+ Windows Drivers are installed from the directory pointed to by
+ "VIRTIO_WIN_DIR" environment variable
+ (/usr/share/virtio-win by default) if present
=head1 RHEL 4
@@ -1500,6 +1501,11 @@ not distributed with virt-v2v.
=back
+=item C<VIRTIO_WIN_DIR>
+
+This is where VirtIO drivers for Windows are searched for
+(F</usr/share/virtio-win> if unset). See L<ENABLING VIRTIO>.
+
=back
For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>.
--
2.1.0
Richard W.M. Jones
2015-Mar-31 13:43 UTC
Re: [Libguestfs] [PATCH v2] v2v: allow configurable location for virtio drivers
On Tue, Mar 31, 2015 at 04:26:38PM +0300, Roman Kagan wrote:> Make the location of the Windows virtio drivers overridable with the > environment variable VIRTIO_WIN_DIR, in the same vein as is done for > virt-tools. > > Signed-off-by: Roman Kagan <rkagan@parallels.com> > --- > changes from v1: > - document the new environment variable > > v2v/convert_windows.ml | 4 +++- > v2v/virt-v2v.pod | 10 ++++++++-- > 2 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml > index 0cd818a..e966341 100644 > --- a/v2v/convert_windows.ml > +++ b/v2v/convert_windows.ml > @@ -47,7 +47,9 @@ let convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source > try Sys.getenv "VIRT_TOOLS_DATA_DIR" > with Not_found -> Config.datadir // "virt-tools" in > > - let virtio_win_dir = "/usr/share/virtio-win" in > + let virtio_win_dir > + try Sys.getenv "VIRTIO_WIN_DIR" > + with Not_found -> 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 > diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod > index 7b6419e..4f7088c 100644 > --- a/v2v/virt-v2v.pod > +++ b/v2v/virt-v2v.pod > @@ -720,8 +720,9 @@ below. > > OpenSUSE 10 kernel >= 2.6.25.5-1.1 > > - Windows Drivers are installed from /usr/share/virtio-win > - if present > + Windows Drivers are installed from the directory pointed to by > + "VIRTIO_WIN_DIR" environment variable > + (/usr/share/virtio-win by default) if present > > =head1 RHEL 4 > > @@ -1500,6 +1501,11 @@ not distributed with virt-v2v. > > =back > > +=item C<VIRTIO_WIN_DIR> > + > +This is where VirtIO drivers for Windows are searched for > +(F</usr/share/virtio-win> if unset). See L<ENABLING VIRTIO>. > + > =back > > For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>.I didn't know POD had a F<> formatter. Now I have to go and change everything else :-( Thanks - ACKed and pushed. 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
Roman Kagan
2015-Mar-31 13:49 UTC
Re: [Libguestfs] [PATCH v2] v2v: allow configurable location for virtio drivers
On Tue, Mar 31, 2015 at 02:43:10PM +0100, Richard W.M. Jones wrote:> On Tue, Mar 31, 2015 at 04:26:38PM +0300, Roman Kagan wrote: > > +This is where VirtIO drivers for Windows are searched for > > +(F</usr/share/virtio-win> if unset). See L<ENABLING VIRTIO>. > > + > > =back > > > > For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>. > > I didn't know POD had a F<> formatter. Now I have to go and > change everything else :-(Oops, sorry, I should have followed the style of the rest of the document... I didn't notice I diverged. Maybe be I should better synchronize this bit with the rest, to avoid unnecessary churn? Roman.
Maybe Matching Threads
- [PATCH v2] v2v: allow configurable location for virtio drivers
- Re: [PATCH v2] v2v: allow configurable location for virtio drivers
- [PATCH] v2v: allow configurable location for virtio drivers
- Re: [PATCH] v2v: allow configurable location for virtio drivers
- Re: packaging virtio-win (was: Re: [PATCH] v2v: virtio-win: include *.dll too)