fix(xapi/host): fix async use in a sync block for smart reboot (#10180)

* fix(xapi/host): fix async use in a sync block for smart reboot
This commit is contained in:
Mathieu
2026-07-29 09:38:38 +02:00
committed by GitHub
parent 09bd5c3425
commit 6a0332a784
2 changed files with 7 additions and 3 deletions

View File

@@ -48,14 +48,16 @@ class Host {
// check the VMs with PCI passthrough
const vms = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref))
const vmsNotSuspendable = vms.filter(async vm => {
const vmsNotSuspendable = []
await asyncEach(vms, async vm => {
try {
await this.call('VM.assert_operation_valid', vm.$ref, 'suspend')
return false
} catch (err) {
return true
vmsNotSuspendable.push(vm)
}
})
const vmsNotSuspendableRefs = new Set(vmsNotSuspendable.map(vm => vm.$ref))
const vmsWithSuspendBlocked = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref)).filter(

View File

@@ -30,6 +30,7 @@
- [XO6] Fix the VM's VDI tab, which sometimes displays an error (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
- [XO6] Reduce the number of HTTP requests when navigating between pages (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
- [Backups] Don't hide errors during transfers (PR [#10183](https://github.com/vatesfr/xen-orchestra/pull/10183))
- [Smart reboot] Fix `suspendBlocked` error when no issue to suspend resident VMs (PR [#10180](https://github.com/vatesfr/xen-orchestra/pull/10180))
### Packages to release
@@ -54,6 +55,7 @@
- @xen-orchestra/rest-api minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
- @xen-orchestra/xapi patch
- xo-server minor
- xo-server-openmetrics minor
- xo-web minor