Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Apr 2015 14:23:19 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281766 - head/usr.sbin/bhyve
Message-ID:  <201504201423.t3KENJ39029556@svn.freebsd.org>

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



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