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

drmgr behavior with malformed DRC index/name arguments #60

Open
nathanlynch opened this issue Apr 5, 2021 · 0 comments
Open

drmgr behavior with malformed DRC index/name arguments #60

nathanlynch opened this issue Apr 5, 2021 · 0 comments

Comments

@nathanlynch
Copy link
Member

drmgr with the -s drc-spec silently converts a malformed DRC index or name to a quantity operation of 1:

[root@ltcalpine2-lp9 ~]# rpm -q powerpc-utils-core
powerpc-utils-core-1.3.8-3.fc33.ppc64le
[root@ltcalpine2-lp9 ~]# drmgr -c mem -h
Usage: drmgr [-w minutes] [-d detail_level] [-C | --capabilities] [-h | --help]
-c mem {-a | -r} {-q <quantity> -p {variable_weight | ent_capacity} | {-q <quantity> | -s [<drc_name> | <drc_index>]}}
[root@ltcalpine2-lp9 ~]# drmgr -d 5 -c mem -r -s 800003fe

########## Apr 05 08:30:20 2021 ##########
drmgr: -d 5 -c mem -r -s 800003fe 
Validating Memory DLPAR capability...yes.
Initiating kernel DLPAR "memory remove count 1"
Success
DR_TOTAL_RESOURCES=1
########## Apr 05 08:30:20 2021 ##########
[root@ltcalpine2-lp9 ~]# lsmem -a | grep 3fe
0x0000003fe0000000-0x0000003fefffffff  256M online       yes  1022
[root@ltcalpine2-lp9 ~]# drmgr -d 5 -c mem -r -s 0x800003fe

########## Apr 05 08:30:38 2021 ##########
drmgr: -d 5 -c mem -r -s 0x800003fe 
Validating Memory DLPAR capability...yes.
Initiating kernel DLPAR "memory remove index 0x800003fe"
Success
DR_TOTAL_RESOURCES=1
########## Apr 05 08:30:38 2021 ##########
[root@ltcalpine2-lp9 ~]# lsmem -a | grep 3fe
[root@ltcalpine2-lp9 ~]# 

Usually this bites me when I forget to put a leading 0x on a DRC index, but if you get a DRC name wrong it does the same thing:

[root@ltcalpine2-lp9 ~]# drmgr -d 5 -c mem -r -s totally-invalid

########## Apr 05 08:32:46 2021 ##########
drmgr: -d 5 -c mem -r -s totally-invalid 
Validating Memory DLPAR capability...yes.
Initiating kernel DLPAR "memory remove count 1"
Success
DR_TOTAL_RESOURCES=1
########## Apr 05 08:32:46 2021 ##########

I think drmgr should be changed to fail the operation instead of treating it as an implicit remove by quantity. Perhaps it could be more accommodating for the missing leading 0x since it doesn't appear to treat a numerical argument without it as decimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants