summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-04-20 14:23:18 +0000
committermav <mav@FreeBSD.org>2015-04-20 14:23:18 +0000
commitf62a422e61b1042f94c9d1e523d7f8a6c1f3d75f (patch)
tree1d7f889d6f1b535f56c11f396f75a451932df322 /usr.sbin/bhyve
parent161ff946d4c0163d2c39c223f3f55df938b65510 (diff)
downloadFreeBSD-src-f62a422e61b1042f94c9d1e523d7f8a6c1f3d75f.zip
FreeBSD-src-f62a422e61b1042f94c9d1e523d7f8a6c1f3d75f.tar.gz
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
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index e6a5576..ced8aa3 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -644,8 +644,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
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()))
OpenPOWER on IntegriCloud