Skip to content

Commit

Permalink
DAOS-16838 control: Fix dmg storage query usage with emulated NVMe
Browse files Browse the repository at this point in the history
Features: control
Required-githooks: true

Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Nov 29, 2024
1 parent eb1d707 commit fe52d98
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/control/server/instance_storage_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func bdevScanEngineAssigned(ctx context.Context, engine Engine, req *ctlpb.ScanN
return scanEngineBdevsOverDrpc(ctx, engine, req)
}

// Accommodate for VMD backing devices and emulated NVMe (AIO).
func getEffCtrlrCount(ctrlrs []*ctlpb.NvmeController) (int, error) {
pas := hardware.MustNewPCIAddressSet()
for _, c := range ctrlrs {
Expand All @@ -471,11 +472,13 @@ func getEffCtrlrCount(ctrlrs []*ctlpb.NvmeController) (int, error) {
if npas, err := pas.BackingToVMDAddresses(); err != nil {
return 0, err
} else {
pas = npas
return npas.Len(), nil
}
}

return pas.Len(), nil
// Return inputted number of controllers rather than number of parsed addresses to cater for
// the case of emulated NVMe where there will be no valid PCI address.
return len(ctrlrs), nil
}

// bdevScanEngine calls either in to the private engine storage provider to scan bdevs if engine process
Expand Down

0 comments on commit fe52d98

Please sign in to comment.