diff options
author | grehan <grehan@FreeBSD.org> | 2012-12-12 19:25:48 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2012-12-12 19:25:48 +0000 |
commit | da369593398d675703857dee838cef0fe00d4082 (patch) | |
tree | 4595007215cab37a59391f352918bca066adb516 /usr.sbin/bhyve | |
parent | ad362d1440f4ef139f2108cda83df3bded25f5f7 (diff) | |
download | FreeBSD-src-da369593398d675703857dee838cef0fe00d4082.zip FreeBSD-src-da369593398d675703857dee838cef0fe00d4082.tar.gz |
Create unique MAC addresses for virtio devices that are
created with non-zero PCI function numbers.
Remove obsolete reference to CFE.
Obtained from: NetApp
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r-- | usr.sbin/bhyve/pci_virtio_net.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c index e3ef573..be848c6 100644 --- a/usr.sbin/bhyve/pci_virtio_net.c +++ b/usr.sbin/bhyve/pci_virtio_net.c @@ -548,14 +548,15 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) /* * The MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the vm name. The slot number is - * prepended to this for slots other than 1, so that - * CFE can netboot from the equivalent of slot 1. + * followed by an MD5 of the vm name. The slot/func number is + * prepended to this for slots other than 1:0, so that + * a bootloader can netboot from the equivalent of slot 1. */ - if (pi->pi_slot == 1) { + if (pi->pi_slot == 1 && pi->pi_func == 0) { strncpy(nstr, vmname, sizeof(nstr)); } else { - snprintf(nstr, sizeof(nstr), "%d-%s", pi->pi_slot, vmname); + snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, + pi->pi_func, vmname); } MD5Init(&mdctx); |