Skip to contentSkip to conversation

ts-host-install: Do not force MAC address of Xen vifs

PATCH New Ian Jackson 1 participant 1 message Apr 15, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-host-install: Do not force MAC address of Xen vifs

For some broken hosts we explicitly force the mac address in software. (This is controlled by the ForceMacAddress host property.)

We achieve this by writing a udev rule (which ends up both in the installer and in the initramfs) which calls `ip link set ... address'.

However: in some cases we share the initramfs with guests. In particular, the `xen-tools' package likes to use the host initramfs.

In stretch at least, this rule, empirically, applies in the guest too. The result is that with ForceMacAddress, the guest ends up with the same mac address as the host, breaking everything.

Fix this by explicitly excluding Xen network interfaces. These all get a proper mac address from xenstore (ultimately, from osstest itself via the guest config, or in other configurations from libxl).

I don't know why this apparently worked on jessie. Startup order changes are a possibility.

---
 ts-host-install | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-host-install +1 -1
index ea087a25..4213c3a2 100755
@@ -212,7 +212,7 @@ sub setup_netboot_firstboot($) {
         file_simple_write_contents
             ($persistent_net_rules,
              $ho->{Flags}{'force-mac-address'} ? <<END : <<END);
-SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="$wantphysif", RUN += "$ipcmd link set $wantphysif address $ho->{Ether}"
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEMS!="xen", KERNEL=="$wantphysif", RUN += "$ipcmd link set $wantphysif address $ho->{Ether}"
 END
 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="$ho->{Ether}", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="$wantphysif"
 END
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel