aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authorPeter Grehan <grehan@FreeBSD.org>2012-12-12 19:25:48 +0000
committerPeter Grehan <grehan@FreeBSD.org>2012-12-12 19:25:48 +0000
commit100ace48f365fe0c736b40daa8d602aaa786df46 (patch)
tree4595007215cab37a59391f352918bca066adb516 /usr.sbin/bhyve
parent2e325b3328c3d2fe04c876a72dca25886eb69b14 (diff)
downloadsrc-100ace48f365fe0c736b40daa8d602aaa786df46.tar.gz
src-100ace48f365fe0c736b40daa8d602aaa786df46.zip
Create unique MAC addresses for virtio devices that are
created with non-zero PCI function numbers. Remove obsolete reference to CFE. Obtained from: NetApp
Notes
Notes: svn path=/projects/bhyve/; revision=244159
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c11
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 e3ef57340c23..be848c6355b3 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);