Support multiple disks in qemu

This changes the CLI specification for disks, as it needs to be able to
be repeated.

```
linuxkit run qemu -disk name,size=1G,format=qcow2 ...
```

Options may be omitted.

Currently other local backends may not support multiple disks, but this
can be added in future. Code for cloud backends has not changed as the
disk support is specific to the platform.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-05-31 17:20:10 +01:00
parent b822bff6ad
commit 25a1e12cf3
7 changed files with 166 additions and 79 deletions

View File

@@ -19,5 +19,5 @@ trap clean_up EXIT
moby build -output qcow2 -name "${NAME}" test.yml
[ -f "${NAME}.qcow2" ] || exit 1
linuxkit run qemu -disk-format qcow2 "${NAME}.qcow2" | grep -q "Welcome to LinuxKit"
linuxkit run qemu "${NAME}.qcow2" | grep -q "Welcome to LinuxKit"
exit 0

View File

@@ -19,7 +19,7 @@ trap clean_up EXIT
# Test code goes here
moby build -output kernel+initrd run.yml
moby build -output kernel+initrd mkimage.yml
linuxkit run qemu -disk-size 200 -disk-format qcow2 -disk disk.qcow2 -kernel mkimage
linuxkit run qemu -disk disk.qcow2,size=200M,format=qcow2 -kernel mkimage
linuxkit run qemu disk.qcow2
exit 0