From be564b7d79466fafb92e2b9d6657cfa3c6b65fae Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 8 Nov 2019 16:24:11 +0000 Subject: [PATCH] run: Add --disk-channel opt, support nvme AWS uses NVMe, and so does bare metal, so it's very important to test with. We regressed coreos-growpart recently on NVMe, see https://bugzilla.redhat.com/show_bug.cgi?id=1769157 --- src/cmd-run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cmd-run b/src/cmd-run index c3fdc32728..14d518610d 100755 --- a/src/cmd-run +++ b/src/cmd-run @@ -16,6 +16,7 @@ dn=$(dirname "$0") BUILDID=latest IMAGE_TYPE=qemu VM_DISK= +DISK_CHANNEL=virtio VM_MEMORY=2048 VM_DISKSIZE= VM_PERSIST_IMG= @@ -33,6 +34,7 @@ Options: -b --buildid Target buildid (default latest) -I --imgtype Target image type (qemu, metal, etc. Default qemu) -d DISK Root disk drive (won't be changed by default) + --disk-channel TYPE Communication mechanism for root device: virtio, nvme --persist-to-img IMG Persist changes to a separate image -i FILE File containing an Ignition config to merge into the default config --srv src Mount (via 9p) src on the host as /var/srv in guest @@ -75,6 +77,9 @@ while [ $# -ge 1 ]; do -d) VM_DISK="$2" shift 2 ;; + --disk-channel) + DISK_CHANNEL="$2" + shift 2 ;; --persist-to-img) VM_PERSIST_IMG="$2" shift 2 ;; @@ -368,7 +373,11 @@ Host coreos EOF fi -set -- -drive if=virtio,file="${VM_IMG}" "$@" +case "${DISK_CHANNEL}" in + virtio) set -- -drive if=virtio,file="${VM_IMG}" "$@" ;; + nvme) set -- -device nvme,drive=D22,serial=1234 -drive file="${VM_IMG}",if=none,id=D22 "$@" ;; + *) die "Invalid --disk-channel ${DISK_CHANNEL}" ;; +esac # There is no BIOS on aarch64, so we need a firmware to boot the system if [ "$(arch)" == "aarch64" ]; then