diff options
author | Alexander Motin <mav@FreeBSD.org> | 2015-04-20 14:23:18 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2015-04-20 14:23:18 +0000 |
commit | f2c58daab8b07b935ed74c8232102c3ac42f0386 (patch) | |
tree | 1d7f889d6f1b535f56c11f396f75a451932df322 | |
parent | 714487538871676cc143058f75fedf9f37583e96 (diff) | |
download | src-f2c58daab8b07b935ed74c8232102c3ac42f0386.tar.gz src-f2c58daab8b07b935ed74c8232102c3ac42f0386.zip |
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
Notes
Notes:
svn path=/head/; revision=281766
-rw-r--r-- | usr.sbin/bhyve/pci_virtio_net.c | 4 |
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 e6a5576cf555..ced8aa3bc4e1 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())) |