Not very much related to each other. Rich.
Richard W.M. Jones
2016-May-26 15:40 UTC
[Libguestfs] [PATCH 1/3] p2v: Consolidate EXTRA_DIST and CLEANFILES into single lists.
No functional change. --- p2v/Makefile.am | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/p2v/Makefile.am b/p2v/Makefile.am index 53c96a1..f00cae9 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -18,21 +18,32 @@ include $(top_srcdir)/subdir-rules.mk EXTRA_DIST = \ + $(TESTS) $(SLOW_TESTS) \ dependencies.m4 \ issue \ launch-virt-p2v.in \ p2v.ks.in \ p2v.service \ + test-virt-p2v-pxe.sshd_config.in \ + test-virt-p2v-ssh.sh \ virt-p2v.pod \ virt-p2v-make-disk.in \ virt-p2v-make-disk.pod \ virt-p2v-make-kickstart.in \ virt-p2v-make-kickstart.pod +# Don't clean ssh_host_rsa_key{,.pub} or id_rsa{,.pub} since those +# consume system entropy to regenerate. CLEANFILES = \ + $(dependencies_files) \ + stamp-test-virt-p2v-pxe-kernel \ stamp-virt-p2v.pod \ stamp-virt-p2v-make-disk.pod \ stamp-virt-p2v-make-kickstart.pod \ + test-virt-p2v-pxe.img \ + test-virt-p2v-pxe.vmlinuz \ + test-virt-p2v-pxe.initramfs \ + test-virt-p2v-pxe.sshd_config \ virt-p2v.1 \ virt-p2v-make-disk.1 \ virt-p2v-make-kickstart.1 @@ -89,7 +100,6 @@ dependencies_files = \ dependencies.debian \ dependencies.redhat \ dependencies.suse -CLEANFILES += $(dependencies_files) $(dependencies_files): dependencies.m4 define=`echo $@ | $(SED) 's/dependencies.//;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`; \ @@ -225,17 +235,3 @@ stamp-test-virt-p2v-pxe-userkey: rm -f test-virt-p2v-pxe.id_rsa.pub ssh-keygen -t rsa -f test-virt-p2v-pxe.id_rsa -N '' touch $@ - -# Don't clean ssh_host_rsa_key{,.pub} or id_rsa{,.pub} since those -# consume system entropy to regenerate. -CLEANFILES += \ - stamp-test-virt-p2v-pxe-kernel \ - test-virt-p2v-pxe.img \ - test-virt-p2v-pxe.vmlinuz \ - test-virt-p2v-pxe.initramfs \ - test-virt-p2v-pxe.sshd_config - -EXTRA_DIST += \ - $(TESTS) $(SLOW_TESTS) \ - test-virt-p2v-pxe.sshd_config.in \ - test-virt-p2v-ssh.sh -- 2.7.4
Richard W.M. Jones
2016-May-26 15:40 UTC
[Libguestfs] [PATCH 2/3] p2v: Disable SELinux in virt-p2v-make-disk.
The kickstart version of virt-p2v has SELinux disabled, so this is at least consistent. Mainly it avoids the very long relabel when the disk boots first time. --- p2v/virt-p2v-make-disk.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in index d0ff7bc..6e5bdac 100644 --- a/p2v/virt-p2v-make-disk.in +++ b/p2v/virt-p2v-make-disk.in @@ -152,9 +152,10 @@ EOF latest_version="$(cd /lib/modules; ls -1vr | head -1)" dracut -f --kver $latest_version EOF - # Double quotes because we want $tmpdir to be expanded: + # Double quotes because we want $tmpdir to be expanded. + # Disable SELinux for consistency with virt-p2v-make-kickstart. extra_args=" - --selinux-relabel + --edit /etc/selinux/config:s/^SELINUX=.*/SELINUX=disabled/g --upload $tmpdir/p2v.conf:/etc/dracut.conf.d/ --run $tmpdir/post-install " -- 2.7.4
Richard W.M. Jones
2016-May-26 15:40 UTC
[Libguestfs] [PATCH 3/3] p2v: Add a 'make run-virt-p2v' rule which boots virt-p2v in a VM.
A convenience method instead of having to work out the right qemu command line each time. --- .gitignore | 1 + p2v/Makefile.am | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index 285b28d..8509a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -337,6 +337,7 @@ Makefile.in /p2v/virt-p2v /p2v/virt-p2v.1 /p2v/virt-p2v.i686 +/p2v/virt-p2v.img /p2v/virt-p2v-make-disk /p2v/virt-p2v-make-disk.1 /p2v/virt-p2v-make-kickstart diff --git a/p2v/Makefile.am b/p2v/Makefile.am index f00cae9..01b8ddb 100644 --- a/p2v/Makefile.am +++ b/p2v/Makefile.am @@ -45,6 +45,7 @@ CLEANFILES = \ test-virt-p2v-pxe.initramfs \ test-virt-p2v-pxe.sshd_config \ virt-p2v.1 \ + virt-p2v.img \ virt-p2v-make-disk.1 \ virt-p2v-make-kickstart.1 @@ -167,6 +168,33 @@ 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. + +QEMU = qemu-system-$(host_cpu) +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 default to the USB drive. + $(QEMU) -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 + +$(top_builddir)/test-data/phony-guests/windows.img: + $(MAKE) -C $(top_builddir)/test-data/phony-guests windows.img + +virt-p2v.img: issue launch-virt-p2v p2v.service virt-p2v virt-p2v-make-disk + $(top_builddir)/run virt-p2v-make-disk -o $@ + # Tests. TESTS_ENVIRONMENT = $(top_builddir)/run --test -- 2.7.4
Pino Toscano
2016-May-26 16:01 UTC
Re: [Libguestfs] [PATCH 3/3] p2v: Add a 'make run-virt-p2v' rule which boots virt-p2v in a VM.
On Thursday 26 May 2016 16:40:16 Richard W.M. Jones wrote:> A convenience method instead of having to work out the right > qemu command line each time. > --- > .gitignore | 1 + > p2v/Makefile.am | 28 ++++++++++++++++++++++++++++ > 2 files changed, 29 insertions(+) > > diff --git a/.gitignore b/.gitignore > index 285b28d..8509a9d 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -337,6 +337,7 @@ Makefile.in > /p2v/virt-p2v > /p2v/virt-p2v.1 > /p2v/virt-p2v.i686 > +/p2v/virt-p2v.img > /p2v/virt-p2v-make-disk > /p2v/virt-p2v-make-disk.1 > /p2v/virt-p2v-make-kickstart > diff --git a/p2v/Makefile.am b/p2v/Makefile.am > index f00cae9..01b8ddb 100644 > --- a/p2v/Makefile.am > +++ b/p2v/Makefile.am > @@ -45,6 +45,7 @@ CLEANFILES = \ > test-virt-p2v-pxe.initramfs \ > test-virt-p2v-pxe.sshd_config \ > virt-p2v.1 \ > + virt-p2v.img \ > virt-p2v-make-disk.1 \ > virt-p2v-make-kickstart.1 > > @@ -167,6 +168,33 @@ 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. > + > +QEMU = qemu-system-$(host_cpu)Isn't m4/guestfs_qemu.m4 already exporting a QEMU variable for makefiles? -- Pino Toscano
Maybe Matching Threads
- Re: [PATCH 3/3] p2v: Add a 'make run-virt-p2v' rule which boots virt-p2v in a VM.
- [PATCH 6/6] p2v: tests: use a local blank-part disk image
- [PATCH 0/3] Three virt-p2v patches.
- [p2v PATCH] tests: fix run-virt-p2v-in-a-vm helper target
- [PATCH] build: Add common CLEANFILES and DISTCLEANFILES to common-rules.mk.