Heinrich Schuchardt | 2ac53a5 | 2023-07-24 12:04:18 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | Emulation of block devices |
| 4 | -------------------------- |
| 5 | |
| 6 | QEMU can emulate common block devices by adding the following parameters to |
| 7 | the qemu-system-<arch> command line: |
| 8 | |
| 9 | * MMC |
| 10 | |
| 11 | .. code-block:: bash |
| 12 | |
| 13 | -device sdhci-pci,sd-spec-version=3 \ |
| 14 | -device sd-card,drive=MMC1 \ |
| 15 | -drive if=none,file=disk.img,format=raw,id=MMC1 |
| 16 | |
| 17 | * NVMe |
| 18 | |
| 19 | .. code-block:: bash |
| 20 | |
| 21 | -drive if=none,file=disk.img,format=raw,id=NVME1 \ |
| 22 | -device nvme,drive=NVME1,serial=nvme-1 |
| 23 | |
| 24 | * SATA |
| 25 | |
| 26 | .. code-block:: bash |
| 27 | |
| 28 | -device ahci,id=ahci0 \ |
| 29 | -drive if=none,file=disk.img,format=raw,id=SATA1 \ |
| 30 | -device ide-hd,bus=ahci0.0,drive=SATA1 |
| 31 | |
| 32 | * USB |
| 33 | |
| 34 | .. code-block:: bash |
| 35 | |
| 36 | -device qemu-xhci \ |
| 37 | -drive if=none,file=disk.img,format=raw,id=USB1 \ |
| 38 | -device usb-storage,drive=USB1 |