[PATCH v3 05/10] scripts: qemu_interactive.py: add new --nvmeblk option
Ahmad Fatoum <[email protected]> Mon, 29 Jun 2026 14:45:24 +0200
| Newsgroups | org.infradead.lists.barebox |
|---|---|
| Message-ID | <[email protected]> |
To be able to test the recent non-512-byte block support, add a --nvmeblk option that behaves like --blk, but appears to the guest as block device. Signed-off-by: Ahmad Fatoum <[email protected]> --- v1 -> v3: - no change --- arch/arm/configs/multi_v8_defconfig | 2 ++ scripts/qemu_interactive.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/configs/multi_v8_defconfig b/arch/arm/configs/multi_v8_defconfig index 9712113bf1cd..5ea63372d050 100644 --- a/arch/arm/configs/multi_v8_defconfig +++ b/arch/arm/configs/multi_v8_defconfig @@ -103,6 +103,7 @@ CONFIG_CMD_MAGICVAR_HELP=y CONFIG_CMD_SAVEENV=y CONFIG_CMD_FILETYPE=y CONFIG_CMD_LN=y +CONFIG_CMD_STAT=y CONFIG_CMD_MD5SUM=y CONFIG_CMD_SHA1SUM=y CONFIG_CMD_SHA224SUM=y @@ -284,6 +285,7 @@ CONFIG_PHY_ROCKCHIP_USBDP=y CONFIG_ROCKCHIP_IODOMAIN=y CONFIG_ROCKCHIP_PM_DOMAINS=y CONFIG_TI_SCI_PM_DOMAINS=y +CONFIG_BLK_DEV_NVME=y CONFIG_NVMEM_REBOOT_MODE=y CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_PCI=y diff --git a/scripts/qemu_interactive.py b/scripts/qemu_interactive.py index 827a831725ba..77ff6f9fc8b4 100755 --- a/scripts/qemu_interactive.py +++ b/scripts/qemu_interactive.py @@ -49,6 +49,9 @@ def register_shared_options(parser): _add_option(parser, "--blk", action="append", dest="qemu_block", default=[], metavar="FILE", help="Pass block device to emulated barebox. Can be specified more than once") + _add_option(parser, "--nvmeblk", action="append", dest="qemu_nvmeblock", + default=[], metavar="FILE", + help="Pass NVMe block device with 4K sector size to emulated barebox. Can be specified more than once") _add_option(parser, "--usbblk", action="append", dest="qemu_usbblock", default=[], metavar="FILE", help="Pass USB block device to emulated barebox. Can be specified more than once") @@ -260,6 +263,13 @@ def apply_shared_options(strategy, target, options, *, interactive, fail=None): else: fail("--blk unsupported for target\n") + for i, blk in enumerate(_get_list_option(options, "qemu_nvmeblock")): + _append_qemu_args( + strategy, fail, + "-drive", f"if=none,format=raw,id=nvme{i},file={blk}", + "-device", f"nvme,drive=nvme{i},serial=0ba2eb08,logical_block_size=4096,physical_block_size=4096" + ) + for i, blk in enumerate(_get_list_option(options, "qemu_usbblock")): _append_qemu_args( strategy, fail, -- 2.47.3