feat(disk-transform): port getBlockIndexesCount to the relevant classes (#10058)

This commit is contained in:
Florent BEAUCHAMP
2026-07-15 14:04:53 +02:00
committed by GitHub
parent 3ffd9b1f56
commit 0cfcb998a2
4 changed files with 15 additions and 1 deletions

View File

@@ -79,6 +79,11 @@ export class DiskLargerBlock extends RandomAccessDisk {
return indexes
}
getBlockIndexesCount(): number {
let blockRatio = this.getBlockSize() / this.source.getBlockSize()
return this.#source.getBlockIndexesCount() / blockRatio
}
hasBlock(index: number): boolean {
const source = this.source
let maxBlockSource = Math.ceil(source.getVirtualSize() / source.getBlockSize())

View File

@@ -42,6 +42,9 @@ export class DiskPassthrough extends Disk {
getBlockIndexes(): Array<number> {
return this.source.getBlockIndexes()
}
getBlockIndexesCount(): number {
return this.source.getBlockIndexesCount()
}
hasBlock(index: number): boolean {
return this.source.hasBlock(index)
}
@@ -102,6 +105,9 @@ export abstract class RandomDiskPassthrough extends RandomAccessDisk {
getBlockIndexes(): Array<number> {
return this.source.getBlockIndexes()
}
getBlockIndexesCount(): number {
return this.source.getBlockIndexesCount()
}
hasBlock(index: number): boolean {
return this.source.hasBlock(index)
}

View File

@@ -49,6 +49,9 @@ export class NegativeDisk extends RandomAccessDisk {
getBlockIndexes(): Array<number> {
return this.#child.getBlockIndexes()
}
getBlockIndexesCount(): number {
return this.#child.getBlockIndexesCount()
}
hasBlock(index: number): boolean {
return this.#child.hasBlock(index)
}

View File

@@ -52,6 +52,7 @@
- @vates/types minor
- @xen-orchestra/backup-archive patch
- @xen-orchestra/disk-transform patch
- @xen-orchestra/rest-api minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
@@ -60,5 +61,4 @@
- xen-api minor
- xo-server minor
<!--packages-end-->