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

Rework NetworkUpdate workaround #950

Merged
merged 3 commits into from
Jul 30, 2022
Merged

Conversation

cfergeau
Copy link
Contributor

The libvirt version check which is currently to decide whether to swap
libvirt.NetworkUpdate arguments is not enough. The fix was backported to
older libvirt in RHEL/CentOS (for example in
libvirt-6.0.0-37.1.module+el8.5.0+13858+39fdc467 ), and the current version
checking code would be swapping the arguments when it's no longer needed.

This commit uses the same code as libvirt client libraries instead, it
checks if the libvirt connection supports the new NetworkUpdate call or
not. I've tested this code with both libvirt-6.0.0-37.1 and
libvirt-6.0.0-37 and in each case, the correct call was done to
libvirt.NetworkUpdate

Please make sure you read the contributor documentation before opening a Pull Request.

@cfergeau
Copy link
Contributor Author

I've updated this to make use of the new NetworkUpdateCompat which takes care of this at the digitalocean/go-libvirt level.

@ElCoyote27
Copy link

Thank you @cfergeau ! I hope it gets merged soonish

@cfergeau
Copy link
Contributor Author

cfergeau commented Jul 7, 2022

@dmacvicar is this missing anything to get reviewed?

@dmacvicar
Copy link
Owner

Thanks. Can you cherry-pick 0b2f708 and 7a733d2 from dmacvicar-cfergeau-network-update to get the pipeline passing?

cfergeau and others added 3 commits July 8, 2022 10:00
…rtxml

This is the same go module, it was renamed so that it can start
following go module versioning (only change major version if there are
API/ABI breakages).
github.com/libvirt/libvirt-go-xml is no longer maintained/updated.
The libvirt version check which is currently to decide whether to swap
libvirt.NetworkUpdate arguments is not enough. The fix was backported to
older libvirt in RHEL/CentOS (for example in
libvirt-6.0.0-37.1.module+el8.5.0+13858+39fdc467 ), and the current
version checking code would be swapping the arguments when it's no
longer needed.

This commit uses NetworkUpdateCompat which was recently introduced in
digitalocean/go-libvirt, and which takes care of this by checking
libvirt connection features.
@cfergeau
Copy link
Contributor Author

cfergeau commented Jul 8, 2022

Thanks. Can you cherry-pick 0b2f708 and 7a733d2 from dmacvicar-cfergeau-network-update to get the pipeline passing?

Done! I squashed the commit fixing linting in Remove NetworkUpdate workaround, if you prefer to keep it separate to keep authorship info, let me know!

NB: since 'Allow edits by maintainers' is checked, you could add a cfergeau remote set to git@github.com:cfergeau/terraform-provider-libvirt.git and push directly to my network-update branch instead of creating an intermediate origin/dmacvicar-cfergeau-network-update one.

@dmacvicar dmacvicar merged commit f6f8a26 into dmacvicar:main Jul 30, 2022
@cfergeau cfergeau deleted the network-update branch August 18, 2022 10:51
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