Author: mav
Date: Wed May 13 10:21:00 2015
New Revision: 282840
URL: https://svnweb.freebsd.org/changeset/base/282840

Log:
  MFC r281766, r281767:
  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.

Modified:
  stable/10/usr.sbin/bhyve/pci_virtio_net.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- stable/10/usr.sbin/bhyve/pci_virtio_net.c   Wed May 13 10:18:44 2015        
(r282839)
+++ stable/10/usr.sbin/bhyve/pci_virtio_net.c   Wed May 13 10:21:00 2015        
(r282840)
@@ -643,8 +643,8 @@ pci_vtnet_init(struct vmctx *ctx, struct
 
        pci_lintr_request(pi);
 
-       /* link always up */
-       sc->vsc_config.status = 1;
+       /* Link is up if we managed to open tap device. */
+       sc->vsc_config.status = (opts == NULL || 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()))
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to