Page MenuHomeFreeBSD

gnop(8): add the ability to set a nop provider's physical path
ClosedPublic

Authored by asomers on Dec 21 2017, 10:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 11:04 PM
Unknown Object (File)
Fri, Mar 22, 11:02 PM
Unknown Object (File)
Fri, Mar 22, 11:02 PM
Unknown Object (File)
Mar 9 2024, 10:56 AM
Unknown Object (File)
Jan 11 2024, 11:07 PM
Unknown Object (File)
Jan 10 2024, 1:43 AM
Unknown Object (File)
Jan 7 2024, 7:58 AM
Unknown Object (File)
Jan 7 2024, 7:34 AM

Details

Summary

gnop(8): add the ability to set a nop provider's physical path

While I'm here, expand the existing tests a bit.

Test Plan

ATF tests added

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

@brd this enhancement should allow us to replace all of the SAS phy stuff in the ZFS test suite. After that, the test suite won't require a SAS expander, or even physical hardware. It should be able to run in a VM.

sbin/geom/class/nop/geom_nop.c
54 ↗(On Diff #36891)

Is there a better letter I should've used? p and P were both taken, and geom's option parser restricts me to short options.

sys/geom/nop/g_nop.h
41 ↗(On Diff #36891)

Note that this flag prevents someone from setting the physical path to any string that begins with \255. But only a psychopath would want to do that.

tests/sys/geom/class/nop/nop_test.sh
30 ↗(On Diff #36891)

Renamed this test because it isn't about diskinfo(8); it's about geom(4).

57 ↗(On Diff #36891)

Some props, like physical path, can't be set on an md(4) device, so I added this test to cover them.

asomers added a subscriber: mav.

@mav this is the first GEOM class that needs to be changed in order to fix physpath handling, as we discussed. The tests for every other GEOM class will depend on this.

I don't understand the G_NOP_PHYSPATH_PASSTHROUGH stuff. Can't you just check for non-NULL or non-empty 'physpath' being passed in?

I don't understand the G_NOP_PHYSPATH_PASSTHROUGH stuff. Can't you just check for non-NULL or non-empty 'physpath' being passed in?

I tried that first. The problem is that it prevents you from creating a gnop device with a blank physical path on top of a device with a non-blank physical path. I needed some non-NULL sentinel.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 18 2018, 5:57 AM
This revision was automatically updated to reflect the committed changes.