chore(xo-server/snapshotVm): avoid using waitObjectState

This commit is contained in:
Julien Fontanet
2018-03-30 12:36:39 +02:00
parent 505f06c1d8
commit a83fa90d87

View File

@@ -1442,8 +1442,6 @@ export default class Xapi extends XapiBase {
nameLabel nameLabel
).then(extractOpaqueRef) ).then(extractOpaqueRef)
this.addTag(ref, 'quiesce')::ignoreErrors() this.addTag(ref, 'quiesce')::ignoreErrors()
await this._waitObjectState(ref, vm => includes(vm.tags, 'quiesce'))
} catch (error) { } catch (error) {
const { code } = error const { code } = error
if ( if (
@@ -1467,7 +1465,7 @@ export default class Xapi extends XapiBase {
// to-date object. // to-date object.
const [, snapshot] = await Promise.all([ const [, snapshot] = await Promise.all([
this.call('VM.set_is_a_template', ref, false), this.call('VM.set_is_a_template', ref, false),
this._waitObjectState(ref, snapshot => !snapshot.is_a_template), this.barrier(ref),
]) ])
return snapshot return snapshot