Support converting types during upload

Allow the user to specify other, non-raw files and upload them,
performing a conversion with qemu-img convert and a temporary block
device as a shim (since qemu-img can't use FIFOs).

Also ensures that the target volume exists before proceeding.

Addresses #68
This commit is contained in:
2020-02-09 19:43:07 -05:00
parent 49e5ce1176
commit e419855911
4 changed files with 166 additions and 38 deletions

View File

@ -4696,8 +4696,23 @@
"description": "",
"parameters": [
{
"description": "The raw binary contents of the file",
"description": "The type of source image file",
"enum": [
"raw",
"vmdk",
"qcow2",
"qed",
"vdi",
"vpc"
],
"in": "query",
"name": "image_format",
"required": true,
"type": "string"
},
{
"description": "The raw binary contents of the file",
"in": "formdata",
"name": "file",
"required": true,
"type": "binary"