Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving Disk Paths via DiskManager #440

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ericavella
Copy link
Contributor

No description provided.

{
List<string> diskPaths = new List<string>();

return this.Logger.LogMessageAsync($"{nameof(UnixDiskManager)}.GetDiskPaths", EventContext.Persisted(), async () =>
Copy link
Contributor

Choose a reason for hiding this comment

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

You only need this wrap if you care about start and ends, do you need that information?

ErrorReason.DependencyNotFound);
}

foreach (Disk disk in disksToTest)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm understanding correctly, you just need the extension methods on Disks -> Disk.GetPreferredAccessPath? You don't need to put that into DiskManager if that's the case

Copy link
Contributor Author

@ericavella ericavella Feb 19, 2025

Choose a reason for hiding this comment

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

GetPreferredAccessPath is leveraged to get the access paths of all the disks attached / filtered by DiskFilter. Since this method (GetDisks + Filtering Disks + GetPreferredAccessPath) appears in >2 workloads & dependencies, thought it would be appropriate as a method through the disk manager

Copy link
Contributor

Choose a reason for hiding this comment

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

If that's the case you should call the GetDisks function above to avoid the duplicated filter code

Copy link
Contributor

@yangpanMS yangpanMS left a comment

Choose a reason for hiding this comment

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

I need to understand more about this. Could you use Disks.GetPreferredPath in the component that needs this? If you don't want to use foreach, you could write an extension just on the Disks.

ErrorReason.DependencyNotFound);
}

if (await this.CreateMountPointsAsync(disksToTest, cancellationToken).ConfigureAwait(false))
Copy link
Contributor

Choose a reason for hiding this comment

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

In FIO we still need to create mount points,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the profile to reflect that

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.

2 participants