On Thu, 2022-07-14 at 14:13 -0700, Dan Williams wrote: > Verma, Vishal L wrote: > > > > > > +# grab the list of memdevs grouped by host-bridge interleave position > > > +port_dev0=$($CXL list -T -d $decoder | jq -r ".[] | > > > + .targets | .[] | select(.position == 0) | .target") > > > +port_dev1=$($CXL list -T -d $decoder | jq -r ".[] | > > > + .targets | .[] | select(.position == 1) | .target") > > > > With my pending update to make memdevs and regions the default listing > > if no other top level object specified, the above listing breaks as it > > can't deal with the extra memdevs now listed. > > > > I think it may make sense to fine tune the defaults a bit - i.e. if > > a -d is supplied, assume -D, but no other default top-level objects. > > Yes, this is what I would expect. > > > However I think this would be more resilient regardless, if it > > explicitly specified a -D: > > True, but it's a bit redundant. > > Why does the -RM default break: > > cxl list [-T] -d $decoder > > ...? Doesn't the final "num_list_flags() == 0" check come after: > > if (param.decoder_filter) > param.decoders = true; > > ...has prevented the default?
Ah yes I see the problem - I added the new default unconditionally in the first pass of num_list_flags() == 0, which was also checking the above condition. I basically need to let it run through the list of 'if -d then -D' type stuff, then check num_list_flags() again, and if 0, only then enable -R and -M. Will fix this in my patch, no need for the -D change above.
