Patch Virtio PCI net driver to log message before dying

This commit is contained in:
Ehmry - 2020-11-10 15:44:19 +01:00
parent 2925af0c89
commit 6e37206cb3
2 changed files with 33 additions and 1 deletions

View File

@ -127,7 +127,11 @@ in {
vfs_ttf.portInputs = [ libc stb ];
virtdev_rom = { };
virtio_nic_drv = { };
virtio_nic_drv = {
patches = [ ./virtio_net.patch ];
postInstall = "mv $out/bin/virtio_*_nic $out/bin/$pname";
};
wifi_drv.portInputs = [ dde_linux libc openssl ];

View File

@ -0,0 +1,28 @@
From 9ed1198edd840a1bae24411e86e3ef0e6cab9340 Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net>
Date: Tue, 10 Nov 2020 14:21:12 +0100
Subject: [PATCH] drivers/nic/virtio/pci: log error before exit
---
repos/os/src/drivers/nic/virtio/pci_device.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/repos/os/src/drivers/nic/virtio/pci_device.cc b/repos/os/src/drivers/nic/virtio/pci_device.cc
index abef1ca5ea..56d2bf6c92 100644
--- a/repos/os/src/drivers/nic/virtio/pci_device.cc
+++ b/repos/os/src/drivers/nic/virtio/pci_device.cc
@@ -50,7 +50,10 @@ struct Virtio_pci_nic::Main
log("--- VirtIO PCI driver started ---");
env.parent().announce(env.ep().manage(root));
}
- catch (...) { env.parent().exit(-1); }
+ catch (Device_not_found) {
+ error("device not found");
+ env.parent().exit(-1);
+ }
};
--
2.28.0