p2v: Update 'make run-virt-p2v' rule.

Use KVM, fallback to TCG.

Add more network devices so we can test the layout of that
dialog box.

Move the documentation into guestfs-hacking(1).

Updates commit f8cfdf274f.
This commit is contained in:
Richard W.M. Jones
2016-05-27 13:05:32 +01:00
parent cb803ef37e
commit 4bbdb85822
2 changed files with 33 additions and 11 deletions

View File

@@ -755,6 +755,27 @@ is Gtk (GUI) code, or supporting code for talking to the remote
conversion server. There is no special support for physical machines
in virt-v2v. They are converted in the same way as foreign VMs.
=head2 Running virt-p2v
You can run the F<p2v/virt-p2v> binary directly, although it's not
really recommended, but it's OK for quick tests of the GUI (but don't
try doing a conversion that way).
A better way is to run virt-p2v inside a VM on the local machine. To
do that, do:
make -C p2v run-virt-p2v
This runs qemu with the "physical machine" disk (which you can set by
setting C<PHYSICAL_MACHINE>), a virtual CD, and a variety of network
cards for testing.
Unfortunately you have to hit C<F12> quickly after the boot and select
the second (USB) drive, since it's not possible to force qemu/seabios
to boot automatically from the USB drive containing virt-p2v.
=head2 Understanding the virt-p2v code
There are two paths through the code, GUI or non-GUI (parsing the
kernel command line):

View File

@@ -169,24 +169,25 @@ stamp-virt-p2v-make-kickstart.pod: virt-p2v-make-kickstart.pod
touch $@
# Run virt-p2v locally.
#
# You can run the virt-p2v binary directly, although it's not really
# recommended, but it's OK for quick tests of the GUI (don't try doing
# a conversion). A better way is to run virt-p2v inside a VM on the
# local machine, which the following rule automates.
PHYSICAL_MACHINE = $(top_builddir)/test-data/phony-guests/windows.img
run-virt-p2v: virt-p2v.img
# Unfortunately you have to hit F12 quickly after the boot and select
# the second (USB) drive. I cannot work out how to get qemu/seabios
# to boot directly from the USB drive. XXX
$(QEMU) -m 1024 \
$(QEMU) \
-M pc,accel=kvm:tcg \
-cpu host \
-m 1024 \
-drive id=hd0,file=$(PHYSICAL_MACHINE),format=raw,if=ide \
-device piix3-usb-uhci \
-drive id=usb0,file=$<,format=raw,snapshot=on,if=none \
-device usb-storage,drive=usb0 \
-boot menu=on &
-boot menu=on \
-netdev user,id=net0,net=169.254.0.0/16 \
-device virtio-net-pci,netdev=net0 \
-netdev user,id=net1 \
-device rtl8139,netdev=net1 \
-netdev user,id=net2 \
-device e1000,netdev=net2 \
&
$(top_builddir)/test-data/phony-guests/windows.img:
$(MAKE) -C $(top_builddir)/test-data/phony-guests windows.img