feat(xapi/VDI_create): move sm_config in second param

Similarly to other creation methods, properties that must be explicited are passed in second param.
This commit is contained in:
Julien Fontanet 2022-06-02 14:44:01 +02:00
parent a0994bc428
commit 0008f2845c
3 changed files with 6 additions and 6 deletions

View File

@ -30,7 +30,6 @@ class Vdi {
other_config = {},
read_only = false,
sharable = false,
sm_config,
SR,
tags,
type = 'user',
@ -39,10 +38,10 @@ class Vdi {
},
{
// blindly copying `sm_config` from another VDI can create problems,
// therefore it is ignored by default by this method
// therefore it should be passed explicitly
//
// see https://github.com/vatesfr/xen-orchestra/issues/4482
setSmConfig = false,
sm_config,
} = {}
) {
return this.call('VDI.create', {
@ -51,7 +50,7 @@ class Vdi {
other_config,
read_only,
sharable,
sm_config: setSmConfig ? sm_config : undefined,
sm_config,
SR,
tags,
type,

View File

@ -25,4 +25,6 @@
<!--packages-start-->
- @xen-orchestra/xapi minor
<!--packages-end-->

View File

@ -740,9 +740,8 @@ async function createNewDisk(xapi, sr, vm, diskSize) {
name_description: 'Created by XO',
size: createVdiSize,
sr,
sm_config: { type: 'raw' },
},
{ setSmConfig: true }
{ sm_config: { type: 'raw' } }
)
if (extensionSize > 0) {
const { type, uuid: srUuid, $PBDs } = xapi.getObject(sr)