fix(xapi/VM_destroy): correctly check *other* VM is not control domain

This commit is contained in:
Julien Fontanet
2021-04-15 11:52:56 +02:00
parent a25708be2b
commit 5a5c0326b7

View File

@@ -330,7 +330,7 @@ module.exports = class Vm {
// Dont destroy if attached to other (non control domain) VMs
for (const vbdRef of await this.getField('VDI', vdiRef, 'VBDs')) {
const vmRef2 = await this.getField('VBD', vbdRef, 'VM')
if (vmRef2 !== vmRef && !(await this.getField('VM', vmRef, 'is_control_domain'))) {
if (vmRef2 !== vmRef && !(await this.getField('VM', vmRef2, 'is_control_domain'))) {
return
}
}