>
> It feels to me like the two injection 'modes' should really be two
> separate commands, especially since they act on different classes of
> targets.
>
> So essentially, split both the injection and clear commands into:
>
> inject-protocol-error
> inject-media-error
> clear-protocol-error
> clear-media-error.
This seems reasonable but I should clarify it would only be 3 commands,
clear-protocol-error wouldn't be a thing since there's only an injection
action for protocol errors.
Should I keep this all in one file or split into two separate files
on protocol/media error lines? Could also do inject/clear files if that
seems more logical.
>
> That way the target operands for them are well defined - i.e. port
> objects for protocol errors and memdevs for media errors.
>
>
> Another thing - and I'm not too attached to either way for this -
>
> The -t 'long-string' feels a bit awkward. Could it be split into
> something like:
>
> --target={mem,cache} --type={correctable,uncorrectable,fatal}
>
> And then 'compose' the actual thing being injected from those options?
> Or is that unnecessary gymnastics?
>
No, I like that idea. I do think the argument names could be better though.
What about:
# inject-protocol-error <port> --protocol={mem,cache}
--severity={correctable,uncorrectable,fatal}
with the short flags for --protocol and --severity being -p and -s,
respectively?
For inject/clear-media-error it could stay as-is, i.e.:
# inject-media-error <memdev> -t={poison} -a=<device physical address>
or I could update it to be something like:
# inject-media-error <memdev> --poison -a=<device physical address>
Thanks,
Ben