+def update_tap_from_vif(idl, tap_name, vif_name):
+ ifaces = idl.data["Interface"]
+ tap = None
+ vif = None
+
+ for i in ifaces.values():
+ name = i.name.as_scalar().strip('"')
+ if name == tap_name:
+ tap = i
+ elif name == vif_name:
+ vif = i
+
+ if vif and tap:
+ vxid = vif.external_ids
+ txid = tap.external_ids
+
+ keys = ["attached-mac", "xs-network-uuid", "xs-vif-uuid", "xs-vm-uuid"]
+ for k in keys:
+ if vxid.get(k) != txid.get(k):
+ set_external_id("Interface", tap_name, k, vxid.get(k))
+