Skip to content

core: MBS / Cinder code path parity - #1153

Merged
dupondje merged 1 commit into
oVirt:masterfrom
ryan-ronnander:linbit/mbs-cinder-parity
Jun 2, 2026
Merged

core: MBS / Cinder code path parity#1153
dupondje merged 1 commit into
oVirt:masterfrom
ryan-ronnander:linbit/mbs-cinder-parity

Conversation

@ryan-ronnander

Copy link
Copy Markdown
Contributor

More MBS quality-of-life improvements:

  • engine has many places that need to treat both Cinder and MBS as one
    case (isCinderDomain() || isManagedBlockStorage()) because the two
    share the relevant traits: one volume per disk, no qcow2 chain to
    aggregate, vendor-side capacity accounting
  • many places historically checked only isCinderDomain() and never got
    the parallel isManagedBlockStorage() added when MBS landed, causing
    MBS domains to fall through to SPM-style code paths that don't match
    their semantics
  • add StorageType.isVendorManagedBlock() to name that combined case as
    a single concept; replace 7 partially-applied checks with the helper:
    • 6 methods in StorageDomainValidator (hasSpaceFor* / threshold
      methods that previously skipped engine-side space checks for
      Cinder but ran the check on MBS)
    • 1 check in GetAllDisksByStorageDomainIdQuery (previously ran
      SPM-style snapshot aggregation on MBS instead of the simple list
      path)
  • update StorageDomainValidatorFreeSpaceTest to recognize MBS as a
    short-circuit case for the cloned / snapshots / all-disks checks,
    matching the validator's actual behavior after the helper widens the
    skip from Cinder-only to vendor-managed
  • when Cinder is fully removed (CentOS Stream 10 already dropped it)
    the helper collapses to isManagedBlockStorage() and the
    isCinderDomain machinery can be deleted in a single follow-up

Found and addressed while improving oVirt's Managed Block Storage support. No user-visible bug fixed — this is code-hygiene and latent-correctness for shared engine code paths.

Part of an ongoing series of MBS improvements:

Changes introduced with this PR

  • StorageType: new helper isVendorManagedBlock() returning true for either Cinder or MBS, with a doc comment explaining the shared semantics
  • StorageDomainValidator: 6 methods changed from isCinderDomain() (or isCinderDomain() || isManagedBlockStorage()) to isVendorManagedBlock()
  • GetAllDisksByStorageDomainIdQuery: 1 check changed similarly, with a comment noting the simple list path applies to vendor-managed-block domains generally, not just Cinder
  • StorageDomainValidatorFreeSpaceTest: parameterization aligned so MBS is recognized as a short-circuit case in the cloned / snapshots / all-disks tests, matching the validator's actual behavior

Are you the owner of the code you are sending in, or do you have permission of the owner?

Yes.

- Engine has many places that need to treat both Cinder and
  Managed Block Storage as one case
  (isCinderDomain() || isManagedBlockStorage()) because the two
  share the relevant traits: one volume per disk, no qcow2 chain
  to aggregate, vendor-side capacity accounting. Cinder and MBS
  are sequential rather than parallel features (MBS is the
  successor); both consistently take the same code path when the
  engine knows about both.
- Many places historically checked only isCinderDomain() and
  never got the parallel isManagedBlockStorage() added when MBS
  landed, causing MBS domains to fall through to SPM-style code
  paths that don't match their semantics.
- Add StorageType.isVendorManagedBlock() naming the combined case
  as a single concept; replace 7 partially-applied checks with the
  helper:
    * 6 methods in StorageDomainValidator (hasSpaceFor*/threshold
      methods that previously skipped engine-side space checks
      for Cinder but ran the check on MBS)
    * 1 check in GetAllDisksByStorageDomainIdQuery (previously
      ran SPM-style snapshot aggregation on MBS instead of the
      simple list path)
- Update StorageDomainValidatorFreeSpaceTest to recognize MBS
  as a short-circuit case for the cloned/snapshots/all-disks
  checks, matching the validator's actual behavior after the
  helper widens the skip from Cinder-only to vendor-managed.
- When Cinder is fully removed (CentOS Stream 10 already dropped
  it) the helper collapses to isManagedBlockStorage() and the
  isCinderDomain machinery can be deleted in a single follow-up.

Signed-off-by: Ryan Ronnander <rronnander@linbit.com>
@peter-boden
peter-boden self-requested a review June 2, 2026 13:29

@peter-boden peter-boden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dupondje
dupondje merged commit 2966d41 into oVirt:master Jun 2, 2026
3 checks passed
@ryan-ronnander
ryan-ronnander deleted the linbit/mbs-cinder-parity branch July 10, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants