@xen-orchestra/backups 0.69.0 → 0.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/_cleanVm.mjs +3 -39
  2. package/package.json +1 -1
package/_cleanVm.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as UUID from 'uuid'
2
- import sum from 'lodash/sum.js'
3
2
  import { asyncMap } from '@xen-orchestra/async-map'
4
- import { Constants, openVhd, VhdAbstract, VhdFile } from 'vhd-lib'
3
+ import { Constants, openVhd, VhdAbstract } from 'vhd-lib'
5
4
  import { isVhdAlias, resolveVhdAlias } from 'vhd-lib/aliases.js'
6
5
  import { basename, dirname, resolve } from 'node:path'
7
6
  import { isMetadataFile, isVhdFile, isVhdSumFile, isXvaFile, isXvaSumFile } from './_backupType.mjs'
@@ -16,27 +15,6 @@ import handlerPath from '@xen-orchestra/fs/path'
16
15
 
17
16
  const { DISK_TYPES } = Constants
18
17
 
19
- // checking the size of a vhd directory is costly
20
- // 1 Http Query per 1000 blocks
21
- // we only check size of all the vhd are VhdFiles
22
- function shouldComputeVhdsSize(handler, vhds) {
23
- if (handler.isEncrypted) {
24
- return false
25
- }
26
- return vhds.every(vhd => vhd instanceof VhdFile)
27
- }
28
-
29
- const computeVhdsSize = (handler, vhdPaths) =>
30
- Disposable.use(
31
- vhdPaths.map(vhdPath => openVhd(handler, vhdPath)),
32
- async vhds => {
33
- if (shouldComputeVhdsSize(handler, vhds)) {
34
- const sizes = await asyncMap(vhds, vhd => vhd.getSize())
35
- return sum(sizes)
36
- }
37
- }
38
- )
39
-
40
18
  // chain is [ ancestor, child_1, ..., child_n ]
41
19
  async function _mergeVhdChain(handler, chain, { logInfo, remove, mergeBlockConcurrency }) {
42
20
  logInfo(`merging VHD chain`, { chain })
@@ -580,7 +558,7 @@ export async function cleanVm(
580
558
  let fileSystemSize
581
559
  const mergedSize = metadataWithMergedVhd[metadataPath]
582
560
 
583
- const { mode, size, vhds, xva } = metadata
561
+ const { mode, size, xva } = metadata
584
562
 
585
563
  try {
586
564
  if (mode === 'full') {
@@ -596,21 +574,7 @@ export async function cleanVm(
596
574
  })
597
575
  }
598
576
  } catch (error) {
599
- // can fail with encrypted remote
600
- }
601
- } else if (mode === 'delta') {
602
- // don't warn if the size has changed after a merge
603
- if (mergedSize === undefined) {
604
- const linkedVhds = Object.keys(vhds).map(key => resolve('/', vmDir, vhds[key]))
605
- fileSystemSize = await computeVhdsSize(handler, linkedVhds)
606
- // the size is not computed in some cases (e.g. VhdDirectory)
607
- if (fileSystemSize !== undefined && fileSystemSize !== size) {
608
- logWarn('cleanVm: incorrect backup size in metadata', {
609
- path: metadataPath,
610
- actual: size ?? 'none',
611
- expected: fileSystemSize,
612
- })
613
- }
577
+ // will fail with encrypted remote
614
578
  }
615
579
  }
616
580
  } catch (error) {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/vatesfr/xen-orchestra.git"
10
10
  },
11
- "version": "0.69.0",
11
+ "version": "0.69.1",
12
12
  "engines": {
13
13
  "node": ">=14.18"
14
14
  },