Master -- pr52033 -- Volume infos fix#55165
Merged
dwoz merged 10 commits intosaltstack:masterfrom Dec 29, 2019
Merged
Conversation
Merged
3dce727 to
a241614
Compare
This was referenced Oct 30, 2019
a241614 to
7f9b36b
Compare
7f9b36b to
e13e23f
Compare
Contributor
Author
|
Also master port of PR #51691 |
e13e23f to
2e6ce85
Compare
This was referenced Dec 6, 2019
Contributor
Author
|
Also master-port of PR #52414 |
Contributor
Author
|
@dwoz pinging you on this PR since I merged a few other related ones that you were looking at. |
c608f04 to
c3bb736
Compare
Expose informations of the libvirt storage volumes, either for one or all the volumes. Among the provided data, this function exposes the names of the virtual machines using the volumes of file type.
All users to remove a libvirt storage volume.
It may happen on pools that have not refresh for a long time that the volume list is not matching reality. Then when calling the info() or XMLDesc() functions libvirt errors out. virt.volume_info() now handles this case.
Since the pool and volume parameters can be None, make them optional and default to None.
Even though the volume_infos handles the libvirt exception when a volume is missing, libvirt was still outputting the error message in the log. Since this can add noise to the log only record the libvirt error message in debug level.
libvirt raises an error when getting the list of volumes of a pool that is not active. Rule out those pools from virt.volume_infos since we still need to give infos on the other pools' volumes.
_get_domain returns a domain object when only one VM has been found. virt.volume_infos needs to take care of it or it will fail to list the volumes informations if the host in such a case.
virt._get_domain() throws an CommandExecutionError if there is no virtual machine. In volume_infos() this is not an error at all since the VMs list is only used to find out which VM uses each volume.
c3bb736 to
ddc8c35
Compare
dwoz
approved these changes
Dec 29, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Master port of PR #52033. Needs PR #55163 to be merged in before.
Tests written?
Yes
Commits signed with GPG?
Yes