stages/qemu: expose vpc options

Currently we hard code the vpc options `subformat=fixed` and
`force_size`, which are needed to generate valid azure images
with newer versions of qemu. But for other use cases or other
versions of qemu these options might not be wanted or valid.
Expose all the options but with defaults corresponding to the
old behavior.
Add a unit test for the `force_size` option to check its
effect. Also add a check for the correct size to the existing, 
default value (i.e. `force_size` being `true`).
This commit is contained in:
Christian Kellner 2022-06-14 12:12:08 +02:00 committed by Tomáš Hozza
parent 3ffba19205
commit 86123da599
4 changed files with 82 additions and 2 deletions

View file

@ -27,7 +27,12 @@
}
},
"image.vpc": {
"format": "raw"
"format": "raw",
"virtual-size": 104858112
},
"image-no-force-size.vpc": {
"format": "raw",
"virtual-size": 104866304
},
"image.vhdx": {
"format": "vhdx"

View file

@ -522,6 +522,33 @@
}
]
},
{
"name": "image-no-force-size.vpc",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.qemu",
"inputs": {
"image": {
"type": "org.osbuild.files",
"origin": "org.osbuild.pipeline",
"references": {
"name:image": {
"file": "image.raw"
}
}
}
},
"options": {
"filename": "image-no-force-size.vpc",
"format": {
"type": "vpc",
"force_size": false
}
}
}
]
},
{
"name": "image.vhdx",
"build": "name:build",

View file

@ -179,6 +179,33 @@
}
]
},
{
"name": "image-no-force-size.vpc",
"build": "name:build",
"stages": [
{
"type": "org.osbuild.qemu",
"inputs": {
"image": {
"type": "org.osbuild.files",
"origin": "org.osbuild.pipeline",
"references": {
"name:image": {
"file": "image.raw"
}
}
}
},
"options": {
"filename": "image-no-force-size.vpc",
"format": {
"type": "vpc",
"force_size": false
}
}
}
]
},
{
"name": "image.vhdx",
"build": "name:build",