mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 00:16:04 +00:00
fix(vrtManager): a NIC's edit keeps the parameters of its filter
Saving a NIC's settings replaced its filterref even when the filter stayed the same, so its parameters were lost: clean-traffic with a fixed IP went back to learning the address at the next start. The same filter now keeps its element; another filter replaces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
8d09e08908
commit
e206862856
2 changed files with 21 additions and 2 deletions
|
|
@ -2813,9 +2813,11 @@ class wvmInstance(wvmConnect):
|
|||
iface.remove(old_model)
|
||||
if model and model != "default": # default: no model, libvirt chooses
|
||||
etree.SubElement(iface, "model", type=model)
|
||||
# the same filter keeps its parameters (clean-traffic's IP, for one)
|
||||
for old_filter in iface.findall("filterref"):
|
||||
iface.remove(old_filter)
|
||||
if nwfilter:
|
||||
if old_filter.get("filter") != nwfilter:
|
||||
iface.remove(old_filter)
|
||||
if nwfilter and iface.find("filterref") is None:
|
||||
etree.SubElement(iface, "filterref", filter=nwfilter)
|
||||
|
||||
self._defineXML(etree.tostring(tree).decode())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue