-
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
Loader fix #58332
Loader fix #58332
Conversation
re-run full all |
re-run all |
1 similar comment
re-run all |
Rebased on master, fixed the black issues (how comes they weren't there yesterday?) and add the changelog file that I forgot to |
rebased on master, removed the black changes due to new version rollback. |
When a virt.init or virt.update fails, the libvirt error is sometimes not enough to understand the issue. Output the XML definition as debug trace to make it easy.
This function helps getting ElementTree XML nodes and creating the missing parents if needed.
Add a new function to easily extract values from an object. This function also handles lists of values with placeholders in the path used to search the value.
In order to ease changing XML trees, add salt.utils.xmlutil.change_xml(). This function allows changing the XML based on a set of rules passed as argument.
In order to handle more parameters in the future, refactor the XML diffing in virt.update to only require adding entries in a mapping array. Using the refactoring the boot parameters are also better handled and we are thus fixing an issue when updating existing loader parameter. See the added test case.
@s0undt3ch rebased on master and moved the new tests to the |
@s0undt3ch @Akm0d all tests green and the requested changes are in. Will hit the 'update branch' button |
@dwoz since it's all green now, could you merge it? |
If CPU is changed, the memory change would be short circuited. This is a regression introduced by PR saltstack#58332
If CPU is changed, the memory change would be short circuited. This is a regression introduced by PR #58332
* Fix various spelling mistakes in master branch (saltstack#55954) * Fix typo of additional Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of against Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of amount Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of argument Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attempt Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of bandwidth Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of caught Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of compatibility Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of consistency Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of conversions Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of corresponding Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dependent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dictionary Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disabled Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of adapters Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disassociates Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of changes Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of command Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of communicate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of community Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of configuration Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of default Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of absence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attribute Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of container Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of described Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of existence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of explicit Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of formatted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of guarantees Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hexadecimal Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hierarchy Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of initialize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of label Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of management Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of mismatch Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of don't Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of manually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of getting Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of information Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of meant Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of nonexistent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of occur Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of omitted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of normally Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of overridden Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of repository Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separator Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of specific Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of successful Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of succeeded Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of support Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of version Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of that's Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of "will be removed" Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of release Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of synchronize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of python Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of usually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of override Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of running Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of whether Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of package Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of persist Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of preferred Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of present Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of run Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "allows someone to..." "Allows to" is not correct English. It must either be "allows someone to" or "allows doing". Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "number of times" Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of msgpack Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemonized Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemons Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of extemporaneous Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of instead Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of returning Signed-off-by: Benjamin Drung <[email protected]> * Fix literal comparissons * virt: Convert cpu_baseline ElementTree to string In commit 0f5184c (Remove minidom use in virt module) the value of `cpu` become `xml.etree.ElementTree.Element` and no longer has a method `toxml()`. This results in the following error: $ salt '*' virt.cpu_baseline host2: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/salt/minion.py", line 1675, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.7/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.7/site-packages/salt/modules/virt.py", line 4410, in cpu_baseline return cpu.toxml() AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml' Signed-off-by: Radostin Stoyanov <[email protected]> * PR#57374 backport virt: pool secret should be undefined in pool_undefine not pool_delete virt: handle build differently depending on the pool type virt: don't fail if the pool secret has been removed * PR saltstack#57396 backport add firmware auto select feature * virt: Update dependencies Closes: saltstack#57641 Signed-off-by: Radostin Stoyanov <[email protected]> * use null in sls file to map None object add sls file example reword doc * Update virt module and states and their tests to python3 * PR saltstack#57545 backport Move virt.init boot_dev parameter away from the kwargs virt: handle boot device in virt.update() virt: add boot_dev parameter to virt.running state * PR saltstack#57431 backport virt: Handle no available hypervisors virt: Remove unused imports * Blacken salt * Add method to remove circular references in data objects and add test (saltstack#54930) * Add method to remove circular references in data objects and add test * remove trailing whitespace * Blacken changed files Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]> * PR saltstack#58332 backport virt: add debug log with VM XML definition Add xmlutil.get_xml_node() helper function Add salt.utils.data.get_value function Add change_xml() function to xmlutil virt.update: refactor the XML diffing code virt.test_update: move some code to make test more readable Co-authored-by: Benjamin Drung <[email protected]> Co-authored-by: Pedro Algarvio <[email protected]> Co-authored-by: Radostin Stoyanov <[email protected]> Co-authored-by: Firefly <[email protected]> Co-authored-by: Blacken Salt <[email protected]> Co-authored-by: Joe Eacott <[email protected]> Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]>
* Fix virt update when cpu and memory are changed If CPU is changed, the memory change would be short circuited. This is a regression introduced by PR saltstack#58332 * virt: add VM memory tunning support * avoid comparing string with integer * fix pre-commit failure * Properly fix memory setting regression in virt.update The 'mem' property in the virt.update value should indicate the result of a live memory setting. The value should be an int in KiB. Fixing the code and tests for this. * virt: add stop_on_reboot parameter in guest states and definition It can be needed to force a VM to stop instead of rebooting. A typical example of this is when creating a VM using a install CDROM ISO or when using an autoinstallation profile. Forcing a shutdown allows libvirt to pick up another XML definition for the new start to remove the firstboot-only options. * virt: expose live parameter in virt.defined state Allow updating the definition of a VM without touching the live instance. This can be helpful since live update may change the device names in the guest. Co-authored-by: firefly <[email protected]> Co-authored-by: gqlo <[email protected]>
* Fix various spelling mistakes in master branch (saltstack#55954) * Fix typo of additional Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of against Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of amount Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of argument Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attempt Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of bandwidth Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of caught Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of compatibility Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of consistency Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of conversions Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of corresponding Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dependent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dictionary Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disabled Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of adapters Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disassociates Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of changes Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of command Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of communicate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of community Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of configuration Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of default Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of absence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attribute Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of container Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of described Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of existence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of explicit Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of formatted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of guarantees Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hexadecimal Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hierarchy Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of initialize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of label Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of management Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of mismatch Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of don't Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of manually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of getting Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of information Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of meant Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of nonexistent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of occur Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of omitted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of normally Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of overridden Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of repository Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separator Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of specific Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of successful Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of succeeded Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of support Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of version Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of that's Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of "will be removed" Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of release Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of synchronize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of python Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of usually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of override Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of running Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of whether Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of package Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of persist Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of preferred Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of present Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of run Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "allows someone to..." "Allows to" is not correct English. It must either be "allows someone to" or "allows doing". Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "number of times" Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of msgpack Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemonized Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemons Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of extemporaneous Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of instead Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of returning Signed-off-by: Benjamin Drung <[email protected]> * Fix literal comparissons * virt: Convert cpu_baseline ElementTree to string In commit 0f5184c (Remove minidom use in virt module) the value of `cpu` become `xml.etree.ElementTree.Element` and no longer has a method `toxml()`. This results in the following error: $ salt '*' virt.cpu_baseline host2: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/salt/minion.py", line 1675, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.7/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.7/site-packages/salt/modules/virt.py", line 4410, in cpu_baseline return cpu.toxml() AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml' Signed-off-by: Radostin Stoyanov <[email protected]> * PR#57374 backport virt: pool secret should be undefined in pool_undefine not pool_delete virt: handle build differently depending on the pool type virt: don't fail if the pool secret has been removed * PR saltstack#57396 backport add firmware auto select feature * virt: Update dependencies Closes: saltstack#57641 Signed-off-by: Radostin Stoyanov <[email protected]> * use null in sls file to map None object add sls file example reword doc * Update virt module and states and their tests to python3 * PR saltstack#57545 backport Move virt.init boot_dev parameter away from the kwargs virt: handle boot device in virt.update() virt: add boot_dev parameter to virt.running state * PR saltstack#57431 backport virt: Handle no available hypervisors virt: Remove unused imports * Blacken salt * Add method to remove circular references in data objects and add test (saltstack#54930) * Add method to remove circular references in data objects and add test * remove trailing whitespace * Blacken changed files Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]> * PR saltstack#58332 backport virt: add debug log with VM XML definition Add xmlutil.get_xml_node() helper function Add salt.utils.data.get_value function Add change_xml() function to xmlutil virt.update: refactor the XML diffing code virt.test_update: move some code to make test more readable Co-authored-by: Benjamin Drung <[email protected]> Co-authored-by: Pedro Algarvio <[email protected]> Co-authored-by: Radostin Stoyanov <[email protected]> Co-authored-by: Firefly <[email protected]> Co-authored-by: Blacken Salt <[email protected]> Co-authored-by: Joe Eacott <[email protected]> Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]>
* Fix virt update when cpu and memory are changed If CPU is changed, the memory change would be short circuited. This is a regression introduced by PR saltstack#58332 * virt: add VM memory tunning support * avoid comparing string with integer * fix pre-commit failure * Properly fix memory setting regression in virt.update The 'mem' property in the virt.update value should indicate the result of a live memory setting. The value should be an int in KiB. Fixing the code and tests for this. * virt: add stop_on_reboot parameter in guest states and definition It can be needed to force a VM to stop instead of rebooting. A typical example of this is when creating a VM using a install CDROM ISO or when using an autoinstallation profile. Forcing a shutdown allows libvirt to pick up another XML definition for the new start to remove the firstboot-only options. * virt: expose live parameter in virt.defined state Allow updating the definition of a VM without touching the live instance. This can be helpful since live update may change the device names in the guest. Co-authored-by: firefly <[email protected]> Co-authored-by: gqlo <[email protected]>
* Fix various spelling mistakes in master branch (saltstack#55954) * Fix typo of additional Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of against Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of amount Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of argument Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attempt Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of bandwidth Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of caught Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of compatibility Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of consistency Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of conversions Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of corresponding Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dependent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of dictionary Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disabled Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of adapters Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of disassociates Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of changes Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of command Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of communicate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of community Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of configuration Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of default Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of absence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of attribute Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of container Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of described Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of existence Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of explicit Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of formatted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of guarantees Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hexadecimal Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of hierarchy Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of initialize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of label Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of management Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of mismatch Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of don't Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of manually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of getting Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of information Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of meant Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of nonexistent Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of occur Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of omitted Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of normally Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of overridden Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of repository Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separate Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of separator Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of specific Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of successful Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of succeeded Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of support Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of version Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of that's Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of "will be removed" Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of release Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of synchronize Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of python Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of usually Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of override Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of running Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of whether Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of package Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of persist Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of preferred Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of present Signed-off-by: Benjamin Drung <[email protected]> * Fix typo of run Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "allows someone to..." "Allows to" is not correct English. It must either be "allows someone to" or "allows doing". Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of "number of times" Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of msgpack Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemonized Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of daemons Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of extemporaneous Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of instead Signed-off-by: Benjamin Drung <[email protected]> * Fix spelling mistake of returning Signed-off-by: Benjamin Drung <[email protected]> * Fix literal comparissons * virt: Convert cpu_baseline ElementTree to string In commit 0f5184c (Remove minidom use in virt module) the value of `cpu` become `xml.etree.ElementTree.Element` and no longer has a method `toxml()`. This results in the following error: $ salt '*' virt.cpu_baseline host2: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/salt/minion.py", line 1675, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.7/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.7/site-packages/salt/modules/virt.py", line 4410, in cpu_baseline return cpu.toxml() AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml' Signed-off-by: Radostin Stoyanov <[email protected]> * PR#57374 backport virt: pool secret should be undefined in pool_undefine not pool_delete virt: handle build differently depending on the pool type virt: don't fail if the pool secret has been removed * PR saltstack#57396 backport add firmware auto select feature * virt: Update dependencies Closes: saltstack#57641 Signed-off-by: Radostin Stoyanov <[email protected]> * use null in sls file to map None object add sls file example reword doc * Update virt module and states and their tests to python3 * PR saltstack#57545 backport Move virt.init boot_dev parameter away from the kwargs virt: handle boot device in virt.update() virt: add boot_dev parameter to virt.running state * PR saltstack#57431 backport virt: Handle no available hypervisors virt: Remove unused imports * Blacken salt * Add method to remove circular references in data objects and add test (saltstack#54930) * Add method to remove circular references in data objects and add test * remove trailing whitespace * Blacken changed files Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]> * PR saltstack#58332 backport virt: add debug log with VM XML definition Add xmlutil.get_xml_node() helper function Add salt.utils.data.get_value function Add change_xml() function to xmlutil virt.update: refactor the XML diffing code virt.test_update: move some code to make test more readable Co-authored-by: Benjamin Drung <[email protected]> Co-authored-by: Pedro Algarvio <[email protected]> Co-authored-by: Radostin Stoyanov <[email protected]> Co-authored-by: Firefly <[email protected]> Co-authored-by: Blacken Salt <[email protected]> Co-authored-by: Joe Eacott <[email protected]> Co-authored-by: xeacott <[email protected]> Co-authored-by: Frode Gundersen <[email protected]> Co-authored-by: Daniel A. Wozniak <[email protected]>
* Fix virt update when cpu and memory are changed If CPU is changed, the memory change would be short circuited. This is a regression introduced by PR saltstack#58332 * virt: add VM memory tunning support * avoid comparing string with integer * fix pre-commit failure * Properly fix memory setting regression in virt.update The 'mem' property in the virt.update value should indicate the result of a live memory setting. The value should be an int in KiB. Fixing the code and tests for this. * virt: add stop_on_reboot parameter in guest states and definition It can be needed to force a VM to stop instead of rebooting. A typical example of this is when creating a VM using a install CDROM ISO or when using an autoinstallation profile. Forcing a shutdown allows libvirt to pick up another XML definition for the new start to remove the firstboot-only options. * virt: expose live parameter in virt.defined state Allow updating the definition of a VM without touching the live instance. This can be helpful since live update may change the device names in the guest. Co-authored-by: firefly <[email protected]> Co-authored-by: gqlo <[email protected]>
What does this PR do?
Refactor the way the virtual machine description XML is modified in
virt.udpate()
. This has two advantages:What issues does this PR fix or reference?
Fixes: #58331
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes