Richard W.M. Jones
2016-Aug-11 08:02 UTC
[Libguestfs] [PATCH v2] v2v: linux: accept 'sr' devices in fstab
From: Tomáš Golembiovský <tgolembi@redhat.com> Do not print warning for 'sr' devices when converting fstab. Not all systems create the /dev/cdrom symlink for SCSI CD-ROM devices. Moreover, on systems with multiple CD-ROMs, having entries for /dev/sr* devices may be inevitable. RWMJ: Use String.is_prefix instead of String.find, to more accurately match on the device name. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: Richard W.M. Jones <rjones@redhat.com> --- v2v/convert_linux.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 4b1ce99..f9aa334 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -1329,8 +1329,10 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps let replace device try List.assoc device map with Not_found -> - if String.find device "md" = -1 && String.find device "fd" = -1 && - device <> "cdrom" then + if not (String.is_prefix device "md") && + not (String.is_prefix device "fd") && + not (String.is_prefix device "sr") && + device <> "cdrom" then warning (f_"%s references unknown device \"%s\". You may have to fix this entry manually after conversion.") path device; device -- 2.7.4
Tomáš Golembiovský
2016-Aug-11 10:44 UTC
Re: [Libguestfs] [PATCH v2] v2v: linux: accept 'sr' devices in fstab
On Thu, 11 Aug 2016 09:02:29 +0100 "Richard W.M. Jones" <rjones@redhat.com> wrote:> From: Tomáš Golembiovský <tgolembi@redhat.com> > > Do not print warning for 'sr' devices when converting fstab. Not all > systems create the /dev/cdrom symlink for SCSI CD-ROM devices. Moreover, > on systems with multiple CD-ROMs, having entries for /dev/sr* devices > may be inevitable. > > RWMJ: Use String.is_prefix instead of String.find, to more accurately > match on the device name. > > Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> > Signed-off-by: Richard W.M. Jones <rjones@redhat.com> > --- > v2v/convert_linux.ml | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml > index 4b1ce99..f9aa334 100644 > --- a/v2v/convert_linux.ml > +++ b/v2v/convert_linux.ml > @@ -1329,8 +1329,10 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps > let replace device > try List.assoc device map > with Not_found -> > - if String.find device "md" = -1 && String.find device "fd" = -1 && > - device <> "cdrom" then > + if not (String.is_prefix device "md") && > + not (String.is_prefix device "fd") && > + not (String.is_prefix device "sr") && > + device <> "cdrom" then > warning (f_"%s references unknown device \"%s\". You may have to fix this entry manually after conversion.") > path device; > device > -- > 2.7.4 >Yes, that's much better. LGTM -- Tomáš Golembiovský <tgolembi@redhat.com>
Pino Toscano
2016-Aug-11 10:48 UTC
Re: [Libguestfs] [PATCH v2] v2v: linux: accept 'sr' devices in fstab
On Thursday, 11 August 2016 09:02:29 CEST Richard W.M. Jones wrote:> From: Tomáš Golembiovský <tgolembi@redhat.com> > > Do not print warning for 'sr' devices when converting fstab. Not all > systems create the /dev/cdrom symlink for SCSI CD-ROM devices. Moreover, > on systems with multiple CD-ROMs, having entries for /dev/sr* devices > may be inevitable. > > RWMJ: Use String.is_prefix instead of String.find, to more accurately > match on the device name. > > Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> > Signed-off-by: Richard W.M. Jones <rjones@redhat.com> > ---LGTM. -- Pino Toscano
Seemingly Similar Threads
- [PATCH] v2v: linux: accept 'sr' devices is fstab
- [PATCH 2/2] v2v: ilnux: detect name of grub2-mkconfig
- [PATCH] v2v: remove MAC address related information
- Re: [PATCH v3 3/3] v2v: linux: install QEMU-GA (RHBZ#1619665)
- [PATCH 0/8] v2v: first bits of Debian/Ubuntu guests supports