-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
More VM tuning in virt module and states #59007
Merged
Merged
Conversation
This file contains 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
93a6f22
to
a6ac779
Compare
15 tasks
a6ac779
to
eef8b05
Compare
When deleting an attribute that doesn't exist in the node we should not report a change was made.
When updating we shouldn't set the value as text in those elements. Libvirt seems happy with it, but it forces modifying the VM definition even if there was no change.
When updating an XML file, we may need to have a more intelligent comparison of the current and new values. This typically fits for the case of numeric values that may have a negligible delta.
Libvirt may round the memory values when defining or updating a VM. That is perfectly fine, but then the value are slightly different from the ones passed to the virt.update() function or the virt.running state. In those cases the state would be reapplied even though there is no real difference with the VM. In order to handle that case the memory parameters in the virt.update mapping now have a comparison function that considers the tiny differences as equal. This commit also factorizes the creation of the memory entries in the virt.update() mapping.
In the mapping passed to xmlutil.change_xml() in virt.update() there are a lot of common patterns. Extract these into helper functions. Some of them are common enough to even be defined in the xmlutil module.
For libvirt to be able to communicate with the QEMU Guest Agent if installed in the guest, a channel named org.qemu.guest_agent.0 is needed. Add this channel by default on all newly created KVM virtual machines.
Multiple libvirt cpuset notations can designate the same thing. We need to expand those notations into an actual cpu list in order to be able to properly compare. For instance if the libvirt definition has '0-5,^4', and we have '0,1,2,3,5' passed to virt.update(), those should not trigger an update of the définition since they are defining the same thing.
eef8b05
to
f9ca726
Compare
krionbsd
approved these changes
Dec 1, 2020
re-run pr-centos7-py3-tcp-pytest |
re-run pr-centos8-py3-pytest |
re-run pr-freebsd122-py3-pytest |
@dwoz could you merge this follow up PR for the virt module? |
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?
In order to be able to create big performance-optimized VM, we need to expose more parameters like the kvm
hint-dedicated
feature flag or the clock configuration.This pull request also includes a few follow up fixes from PR #58196.
Merge requirements satisfied?
Commits signed with GPG?
Yes