Disks and images
Attach disks with -drive or -blockdev, in any of QEMU's formats. Node opens them in place, and a browser fetches them.
As in QEMU, a disk is an image file you pass with -drive. With if=virtio it becomes a virtio-blk-pci disk, and the guest sees /dev/vda, /dev/vdb and so on, in the order you list the drives.
warm-img create -f raw data.img 4G
warm-system-aarch64 ... -drive file=rootfs.qcow2,if=virtio -drive file=data.img,if=virtio,format=rawDrives work as they do in QEMU 11.1.1. That covers -drive and -blockdev with all their options, plus the images, formats and drivers described in QEMU's disk images and block drivers pages.
Formats
Warm64 supports QEMU's formats: qcow2, raw, qed, qcow, vdi, vhdx, vmdk, vpc, parallels, dmg, bochs, cloop and luks. QEMU's filter drivers work too, and in Node so do the network protocols nbd, http, https, ftp, ftps and ssh. -drive format=help lists them all. A qcow2 image has every qcow2 feature QEMU supports: backing files, compressed clusters, and the internal snapshots savevm saves into.
If a drive has no format=, Warm64 probes it and, like QEMU, warns when it's a raw image. Name the format to avoid the warning. To create images, use QEMU's qemu-img, or warm-img for raw ones.
Controllers
if=virtio is the usual choice, but QEMU's other controllers are there too. Use if=none,id=ID on the drive and drive=ID on the device:
| Device | Guest sees |
|---|---|
virtio-blk-pci | A virtio disk (/dev/vda). |
virtio-scsi-pci with scsi-hd or scsi-cd | SCSI disks and CD drives (/dev/sda, /dev/sr0). |
nvme | An NVMe drive (/dev/nvme0n1). |
ich9-ahci with ide-hd or ide-cd | SATA disks and CD drives. |
usb-storage or usb-uas | A USB disk, on a qemu-xhci controller. |
virtio-blk-device | A virtio disk on one of the board's virtio-mmio slots. |
warm-system-aarch64 ... -device virtio-scsi-pci -drive file=install.iso,if=none,id=cd,media=cdrom,format=raw -device scsi-cd,drive=cdWhere the guest's writes go
In Node (and so in warm-system-aarch64), images are opened in place, and the guest's writes reach the file as they happen. With -snapshot, or snapshot=on on a single drive, writes go to a temporary qcow2 overlay in $TMPDIR instead, which is removed when the machine exits, as in QEMU. readonly=on stops the guest writing at all.
In a browser, browserWARMHost() fetches each image whole by URL: relative to its base, absolute, or the blob: URL of a file the user picked. The guest's writes stay in memory and disappear when the machine ends. So a page doesn't need -snapshot, and the stock browser host refuses it anyway, since it has no temporary files for the overlay. A large image uses as much memory as its size.
For disks that persist in a browser, run Warm64 in a worker and give the host an openDisk that uses the Origin Private File System.
While the machine runs
The monitor and QMP have QEMU's block commands:
- Hot-plug:
drive_addorblockdev-add, thendevice_addonto apcie-root-portfrom the command line (as in QEMU, pcie.0 itself doesn't take hot-plug).device_delremoves a disk. - Removable media:
ejectandchange(QMP'sblockdev-change-medium) on a CD drive. - Growing a disk:
block_resize, and the guest's virtio disk sees the new size. - Block jobs:
block-stream,block-commit,drive-mirrorandblockdev-mirror,drive-backupandblockdev-backup, with QEMU's job states and events. - External snapshots:
blockdev-snapshot-syncputs a new qcow2 overlay on top of a disk. - Exporting: in Node,
nbd-server-startserves disks over NBD.