virt: more network support - #59146
Conversation
|
This PR is based on #59144 |
132d017 to
534ae88
Compare
|
re-run pr-macosxcatalina-py3-pytest |
|
Well, this is quite the monster PR 🙃 I'm OOO through the end of the year - I don't know how antsy you are to get this in, but if nobody reviews before I get back I'll plan to take a look at this Jan 4 |
|
I'ld like to have it in Aluminium ideally, so can still wait for you to come back I guess |
8164603 to
b226268
Compare
waynew
left a comment
There was a problem hiding this comment.
I'm about 25% through my review on this, but I'm off for the day -- I'll pick this up tomorrow AM Central Time, most likely.
waynew
left a comment
There was a problem hiding this comment.
praise: I have to say overall, great job! This was clearly a lot of coding and testing 🙌
Most of the feedback I have are just nitpicks - I didn't see any logic failures, and only one spot that had me ![]()
Once you've addressed the feedback (either 👍 the suggestions or 🗑️), I'm 👍 on this. Thank you so much, and again, great job!
There was a problem hiding this comment.
suggestion: setdefault would work here, too:
if errors:
status.setdefault("errors",[]).extend(errors)
There was a problem hiding this comment.
Addressed all the comments. Thanks for the thorough review!
e487008 to
b846e6b
Compare
io_uring has recently been added as another IO policy on virtual disks. Keep the parameter opened for changes. Also add the optional iothread ID in case the user wants to pin a disk to some IO thread (and thus to a CPU).
Stripping spaces and indentation from XML could also be useful in other places, moving to xmlutil to help reuse.
The network_update code will be rather similar to the pool_update one. In order to share the XML tree cleanup for easier comparisons, create a helper function in the virt module.
In order to let users define more types of virtual networks, expose more of the libvirt virtual network properties.
While converting the virt domain-related states to pytest I realized the __opts__["test"] == False case was not handled in some of them. This commit also fixes the return code for virt.shutdown, virt.powered_off, virt.snapshot and virt.rebooted states. It also prevents the actual call to be issued in test mode.
Expose the new host_devices parameter to the virt.running and virt.defined states.
On a running guest, libvirt changes the XML definition of the network interfaces of type "network" to the type of the network (for instance bridge). In such a case the virt.update() function will find the two NICs different even if they may not be... so we need to try harder to compare.
A network with hostdev forward mode has no bridge and no mac. So we need to handle this in a few places in the virt module.
In order to help reusing the device changes computing code and avoid getting a giant virt.update(), move the live update code of it into a specific internal function.
When a domain has a NIC of type network pointing to a network with hostdev forward, libvirt changes its running XML definition with a hostdev interface with a PCI address from those in the network. Handle this case to avoid useless interface detaching / attaching.
Libvirt adds the PCI addresses of the SR-IOV device virtual functions when only providing the physical function. Those need to be removed in order to avoid network changes for no reason in virt.network_update()
|
Just fixed the rebase on latest master to get the new test pass again. |
|
re-run pr-amazon2-py3-pytest |
|
re-run freebsd122-py3-pytest |
|
re-run freebsd122-py3-pytest |
|
re-run ubuntu2004-py3-pytest |
|
@dwoz could you merge this PR while it's Green and ACKed? |
|
re-run freebsd122-py3-pytest |
What does this PR do?
Add more parameters for virtual network creation in
virt.network_definedandvirt.network_runningstates.What issues does this PR fix or reference?
Fixes: #59143
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes