Richard W.M. Jones
2019-Jul-04 14:52 UTC
[Libguestfs] [PATCH] v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
Thanks: Steven Rosenberg --- 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 59b0bf493..56c7a6757 100644 --- a/v2v/windows_virtio.ml +++ b/v2v/windows_virtio.ml @@ -338,7 +338,7 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing ) paths ) ) - else if is_regular_file virtio_win then ( + else if is_regular_file virtio_win || is_block_device virtio_win then ( debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win; try -- 2.22.0
Richard W.M. Jones
2019-Jul-04 15:04 UTC
Re: [Libguestfs] [PATCH] v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
On Thu, Jul 04, 2019 at 03:52:20PM +0100, Richard W.M. Jones wrote:> Thanks: Steven Rosenberg > --- > 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 59b0bf493..56c7a6757 100644 > --- a/v2v/windows_virtio.ml > +++ b/v2v/windows_virtio.ml > @@ -338,7 +338,7 @@ and copy_from_virtio_win g inspect srcdir destdir filter missing > ) paths > ) > ) > - else if is_regular_file virtio_win then ( > + else if is_regular_file virtio_win || is_block_device virtio_win then ( > debug "windows: copy_from_virtio_win: guest tools source ISO %s" virtio_win;I've now tested this patch. Here's how. (Note step (2) is the test). Steven: You will need to include this information in your bug report so that the QE team have a way to reproduce the problem. (1) VIRTIO_WIN=~/d/libguestfs/test-data/fake-virtio-win/fake-virtio-win.iso \ ./run virt-v2v -vx -i disk test-data/phony-guests/windows.img -o null |& tee /tmp/log Observe in /tmp/log that there is the following line: windows: copy_from_virtio_win: guest tools source ISO /home/rjones/d/libguestfs/test-data/fake-virtio-win/fake-virtio-win.iso This is expected because we're using a regular file. (2) Loopback mount the ISO: $ sudo losetup /dev/loop0 `pwd`/fake-virtio-win.iso $ ll /dev/loop0 brw-rw----. 1 root disk 7, 0 Jul 4 16:01 /dev/loop0 $ sudo blockdev --getsize64 /dev/loop0 2738176 Now run the same command as above but pointing to /dev/loop0, and of course virt-v2v will now need to be run as root: sudo VIRTIO_WIN=/dev/loop0 \ ../run virt-v2v -vx -i disk test-data/phony-guests/windows.img -o null |& tee /tmp/log To show that it used the block device: $ grep copy_from_virtio_win /tmp/log windows: copy_from_virtio_win: guest tools source ISO /dev/loop0 To clean up: $ sudo losetup -d /dev/loop0 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
Tomáš Golembiovský
2019-Jul-04 19:27 UTC
Re: [Libguestfs] [PATCH] v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
On Thu, 4 Jul 2019 15:52:20 +0100 "Richard W.M. Jones" <rjones@redhat.com> wrote:> Thanks: Steven Rosenberg > --- > v2v/windows_virtio.ml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >LGTM -- Tomáš Golembiovský <tgolembi@redhat.com>
Steven Rosenberg
2019-Jul-05 09:27 UTC
Re: [Libguestfs] [PATCH] v2v: Allow Windows virtio ISO to be a block device as well as a regular file.
OK Thank you both. I will review on Sunday in more detail. With Best Regards. Steven. On Thu, Jul 4, 2019 at 10:28 PM Tomáš Golembiovský <tgolembi@redhat.com> wrote:> On Thu, 4 Jul 2019 15:52:20 +0100 > "Richard W.M. Jones" <rjones@redhat.com> wrote: > > > Thanks: Steven Rosenberg > > --- > > v2v/windows_virtio.ml | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > LGTM > > > -- > Tomáš Golembiovský <tgolembi@redhat.com> >
Maybe Matching Threads
- Re: [PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio
- Re: [PATCH 1/2] v2v: fix path to source when copying files from guest tools directory
- [PATCH v3] v2v: don't fail when virtio-win does not have qemu-ga
- [PATCH] v2v: fix directory check for virtio-win as directory
- [PATCH v5 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux