svn commit: r281766 - head/usr.sbin/bhyve
Alexander Motin
mav at FreeBSD.org
Mon Apr 20 14:23:19 UTC 2015
Author: mav
Date: Mon Apr 20 14:23:18 2015
New Revision: 281766
URL: https://svnweb.freebsd.org/changeset/base/281766
Log:
Report link as up only if we managed to open tap device.
It would be cool to report tap device status, but it has no such API.
MFC after: 2 weeks
Modified:
head/usr.sbin/bhyve/pci_virtio_net.c
Modified: head/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 20 10:44:46 2015 (r281765)
+++ head/usr.sbin/bhyve/pci_virtio_net.c Mon Apr 20 14:23:18 2015 (r281766)
@@ -644,8 +644,8 @@ pci_vtnet_init(struct vmctx *ctx, struct
pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK);
pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET);
- /* link always up */
- sc->vsc_config.status = 1;
+ /* Link is up if we managed to open tap device. */
+ sc->vsc_config.status = (sc->vsc_tapfd >= 0);
/* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */
if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix()))
More information about the svn-src-head
mailing list