Date: Wed, 12 Dec 2012 19:25:49 +0000 (UTC) From: Peter Grehan <grehan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244159 - projects/bhyve/usr.sbin/bhyve Message-ID: <201212121925.qBCJPnmC028821@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212121925.qBCJPnmC028821>