-
Notifications
You must be signed in to change notification settings - Fork 243
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
utils_libvirt/libvirt_disk: add function to get disk by serial #3814
Conversation
a9bf763
to
ae230b5
Compare
@chunfuwen Please help review. As mentioned on #3811 (comment) unfortunately we can't set serial on LUNs but its implementation might be useful on other occasions. |
Use the SERIAL that can be set via libvirt, to select its disk path under /dev/. Suggested-by: Chunfu Wen <[email protected]> Signed-off-by: Sebastian Mitterle <[email protected]>
ae230b5
to
51863db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@smitterl ,could you upload one simple test result? |
@@ -102,6 +102,31 @@ def get_non_root_disk_name(session): | |||
return name.strip(), mpoint.strip() | |||
|
|||
|
|||
def get_disk_by_serial(session, serial): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have same function in utils_disk.py.
def get_disk_by_serial(serial_str, session=None):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer. I'll close this one.
Closing this as there is already another implementation with the same API. |
Use the SERIAL to identify a disk and return its path.
Suggested-by: Chunfu Wen [email protected]
Signed-off-by: Sebastian Mitterle [email protected]