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

utils_disk/libvirt_disk: add way to handle disk by path #3729

Merged

Conversation

smitterl
Copy link
Contributor

@smitterl smitterl commented Jul 27, 2023

Partitions in /proc/partitions are not persistent which
can lead to problems when a test checks if a disk was cold
plugged.

Use persistent naming from /dev/disk/by-path which allows
us to easily identify those disks and partitions with
the attached disk by their libvirt

.

Add and update other functions to be compatible with this way
of dealing with partitions.

@smitterl smitterl changed the title utils_disk: add function to retrieve partitions by disk path utils_disk/libvirt_disk: add way to handle disk by path Jul 27, 2023
@smitterl
Copy link
Contributor Author

smitterl commented Aug 2, 2023

Used in autotest/tp-libvirt#5060

Copy link
Contributor

@chloerh chloerh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest is ok to me.

if err:
raise exceptions.TestError("Failed to list partitions in /dev/disk/by-path")
r = out.split()
logging.debug("Partitions by path: %s", r)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logging.debug("Partitions by path: %s", r)
LOG.debug("Partitions by path: %s", r)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chloerh Thank you! Updated.

Partitions in /proc/partitions are not persistent which
can lead to problems when a test checks if a disk was cold
plugged.

Use persistent naming from /dev/disk/by-path which allows
us to easily identify those disks and partitions with
the attached disk by their libvirt <address/>.

Add and update other functions to be compatible with this way
of dealing with partitions.

Signed-off-by: Sebastian Mitterle <[email protected]>
Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chunfuwen chunfuwen merged commit 7c8692a into avocado-framework:master Sep 5, 2023
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants