svn commit: r244159 - projects/bhyve/usr.sbin/bhyve
Peter Grehan
grehan at FreeBSD.org
Wed Dec 12 19:25:49 UTC 2012
Author: grehan
Date: Wed Dec 12 19:25:48 2012
New Revision: 244159
URL: http://svnweb.freebsd.org/changeset/base/244159
Log:
Create unique MAC addresses for virtio devices that are
created with non-zero PCI function numbers.
Remove obsolete reference to CFE.
Obtained from: NetApp
Modified:
projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c
Modified: projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 17:49:01 2012 (r244158)
+++ projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 19:25:48 2012 (r244159)
@@ -548,14 +548,15 @@ pci_vtnet_init(struct vmctx *ctx, struct
/*
* 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);
More information about the svn-src-projects
mailing list