Laszlo Ersek
2022-Mar-25 17:05 UTC
[Libguestfs] [p2v PATCH 2/2] Makefile.am: add "run-virt-p2v-in-an-nvme-vm"
For testing NVMe disks, use the hints in QEMU's "docs/system/devices/nvme.rst". Map the blank disk image to two separate NVMe namespaces, plus expose the system disk as an NVMe drive. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1945835 Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- Makefile.am | 32 ++++++++++++++++++++ docs/p2v-hacking.pod | 11 ++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 678eff4d7026..2080890b14e3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -278,6 +278,38 @@ run-virt-p2v-in-a-vm: virt-p2v.img $(PHYSICAL_MACHINE) -device e1000,netdev=net2 \ $(QEMU_OPTIONS) \ & + +run-virt-p2v-in-an-nvme-vm: virt-p2v.img $(PHYSICAL_MACHINE) $(BLANK_DISK) + $(shell guestfish get-hv) \ + -M pc,accel=kvm:tcg \ + -cpu host \ + -m 2048 \ + -boot menu=on \ + \ + -drive id=phys,if=none,format=raw,file=$(PHYSICAL_MACHINE),snapshot=on \ + -device nvme,drive=phys,serial=01234567 \ + \ + -drive id=usb0,if=none,format=raw,file=$<,snapshot=on \ + -device piix3-usb-uhci,id=usb-bus \ + -device usb-storage,drive=usb0,bootindex=1,bus=usb-bus.0 \ + \ + -drive id=blank1,if=none,format=raw,file=$(BLANK_DISK),snapshot=on \ + -drive id=blank2,if=none,format=raw,file=$(BLANK_DISK),snapshot=on \ + -device nvme,id=nvme-ctrl,serial=89abcdef \ + -device nvme-ns,drive=blank1,bus=nvme-ctrl \ + -device nvme-ns,drive=blank2,bus=nvme-ctrl \ + \ + -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 \ + \ + $(QEMU_OPTIONS) \ + & endif HAVE_LIBGUESTFS run-virt-p2v-non-gui-conversion: stamp-test-virt-p2v-pxe-data-files diff --git a/docs/p2v-hacking.pod b/docs/p2v-hacking.pod index 2c0a14c093a3..6dd42490ac26 100644 --- a/docs/p2v-hacking.pod +++ b/docs/p2v-hacking.pod @@ -128,12 +128,15 @@ A more realistic test is to run virt-p2v inside a VM on the local machine. To do that, do: make run-virt-p2v-in-a-vm + make run-virt-p2v-in-an-nvme-vm -This also runs qemu with the "physical machine" disk (which you can +These also run 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. You can change the qemu binary and add -extra qemu options by setting C<QEMU> and/or C<QEMU_OPTIONS> on the -make commandline. +network cards for testing. The second target exposes the "physical +machine" disk as an NVMe controller, plus adds two blank disks as +distinct namespaces of another NVMe controller. You can change the +qemu binary and add extra qemu options by setting C<QEMU> and/or +C<QEMU_OPTIONS> on the make commandline. A third way to run virt-p2v simulates fairly accurately the program being downloaded over PXE and then doing an automatic conversion of -- 2.19.1.3.g30247aa5d201
Richard W.M. Jones
2022-Mar-25 19:56 UTC
[Libguestfs] [p2v PATCH 2/2] Makefile.am: add "run-virt-p2v-in-an-nvme-vm"
ACK series. I don't see any issues with adding more run-* targets (second patch), as long as they are useful which this one is. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top