Skip to content

Commit 821ea00

Browse files
committed
clean code
1 parent 0c54ecb commit 821ea00

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

@xen-orchestra/backups/_incrementalVm.mjs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -160,42 +160,42 @@ export const importIncrementalVm = defer(async function importIncrementalVm(
160160
let vmRef
161161
if (isUpdate) {
162162
vmRef = targetRef
163-
await xapi.setFields('VM', vmRef, vmRecord)
164163
await Promise.all([
165-
xapi.setField('VM', vmRef, 'actions_after_crash', vmRecord.actions_after_crash),
166-
xapi.setField('VM', vmRef, 'actions_after_reboot', vmRecord.actions_after_reboot),
167-
xapi.setField('VM', vmRef, 'actions_after_shutdown', vmRecord.actions_after_shutdown),
168-
vmRecord.domain_type !== undefined && xapi.setField('VM', vmRef, 'domain_type', vmRecord.domain_type),
169-
xapi.setField('VM', vmRef, 'ha_restart_priority', vmRecord.ha_restart_priority),
170-
xapi.setField('VM', vmRef, 'has_vendor_device', vmRecord.has_vendor_device),
171-
xapi.setField('VM', vmRef, 'HVM_boot_params', vmRecord.HVM_boot_params),
172-
xapi.setField('VM', vmRef, 'HVM_boot_policy', vmRecord.HVM_boot_policy),
173-
vmRecord.HVM_shadow_multiplier !== undefined &&
174-
xapi.setField('VM', vmRef, 'HVM_shadow_multiplier', vmRecord.HVM_shadow_multiplier),
175-
xapi.setField('VM', vmRef, 'memory_dynamic_max', vmRecord.memory_dynamic_max),
176-
xapi.setField('VM', vmRef, 'memory_dynamic_min', vmRecord.memory_dynamic_min),
177-
xapi.setField('VM', vmRef, 'memory_static_max', vmRecord.memory_static_max),
178-
xapi.setField('VM', vmRef, 'memory_static_min', vmRecord.memory_static_min),
179-
xapi.setField('VM', vmRef, 'name_description', vmRecord.name_description),
180-
xapi.setField('VM', vmRef, 'order', vmRecord.order),
181-
xapi.setField('VM', vmRef, 'other_config', vmRecord.other_config),
182-
xapi.setField('VM', vmRef, 'platform', vmRecord.platform),
183-
xapi.setField('VM', vmRef, 'PV_args', vmRecord.PV_args),
184-
xapi.setField('VM', vmRef, 'PV_bootloader', vmRecord.PV_bootloader),
185-
xapi.setField('VM', vmRef, 'PV_bootloader_args', vmRecord.PV_bootloader_args),
186-
xapi.setField('VM', vmRef, 'PV_kernel', vmRecord.PV_kernel),
187-
xapi.setField('VM', vmRef, 'PV_legacy_args', vmRecord.PV_legacy_args),
188-
xapi.setField('VM', vmRef, 'PV_ramdisk', vmRecord.PV_ramdisk),
189-
xapi.setField('VM', vmRef, 'recommendations', vmRecord.recommendations),
190-
xapi.setField('VM', vmRef, 'shutdown_delay', vmRecord.shutdown_delay),
191-
xapi.setField('VM', vmRef, 'start_delay', vmRecord.start_delay),
192-
vmRecord.suspend_SR !== undefined && xapi.setField('VM', vmRef, 'suspend_SR', vmRecord.suspend_SR),
193-
xapi.setField('VM', vmRef, 'tags', vmRecord.tags),
194-
xapi.setField('VM', vmRef, 'user_version', vmRecord.user_version),
195-
xapi.setField('VM', vmRef, 'VCPUs_at_startup', vmRecord.VCPUs_at_startup),
196-
xapi.setField('VM', vmRef, 'VCPUs_max', vmRecord.VCPUs_max),
197-
xapi.setField('VM', vmRef, 'VCPUs_params', vmRecord.VCPUs_params),
198-
vmRecord.xenstore_data !== undefined && xapi.setField('VM', vmRef, 'xenstore_data', vmRecord.xenstore_data),
164+
xapi.setFields('VM', vmRef, {
165+
actions_after_crash: vmRecord.actions_after_crash,
166+
actions_after_reboot: vmRecord.actions_after_reboot,
167+
actions_after_shutdown: vmRecord.actions_after_shutdown,
168+
domain_type: vmRecord.domain_type,
169+
ha_restart_priority: vmRecord.ha_restart_priority,
170+
has_vendor_device: vmRecord.has_vendor_device,
171+
HVM_boot_params: vmRecord.HVM_boot_params,
172+
HVM_boot_policy: vmRecord.HVM_boot_policy,
173+
HVM_shadow_multiplier: vmRecord.HVM_shadow_multiplier,
174+
memory_dynamic_max: vmRecord.memory_dynamic_max,
175+
memory_dynamic_min: vmRecord.memory_dynamic_min,
176+
memory_static_max: vmRecord.memory_static_max,
177+
memory_static_min: vmRecord.memory_static_min,
178+
name_description: vmRecord.name_description,
179+
order: vmRecord.order,
180+
other_config: vmRecord.other_config,
181+
platform: vmRecord.platform,
182+
PV_args: vmRecord.PV_args,
183+
PV_bootloader: vmRecord.PV_bootloader,
184+
PV_bootloader_args: vmRecord.PV_bootloader_args,
185+
PV_kernel: vmRecord.PV_kernel,
186+
PV_legacy_args: vmRecord.PV_legacy_args,
187+
PV_ramdisk: vmRecord.PV_ramdisk,
188+
recommendations: vmRecord.recommendations,
189+
shutdown_delay: vmRecord.shutdown_delay,
190+
start_delay: vmRecord.start_delay,
191+
suspend_SR: vmRecord.suspend_SR,
192+
tags: vmRecord.tags,
193+
user_version: vmRecord.user_version,
194+
VCPUs_at_startup: vmRecord.VCPUs_at_startup,
195+
VCPUs_max: vmRecord.VCPUs_max,
196+
VCPUs_params: vmRecord.VCPUs_params,
197+
xenstore_data: vmRecord.xenstore_data,
198+
}),
199199
targetVm.update_blocked_operations({
200200
start: 'Importing…',
201201
start_on: 'Importing…',

0 commit comments

Comments
 (0)