Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2015 10:21:01 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r282840 - stable/10/usr.sbin/bhyve
Message-ID:  <201505131021.t4DAL1fj087856@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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()))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505131021.t4DAL1fj087856>