summaryrefslogtreecommitdiff
path: root/Kernel/VirtIO
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-18 16:06:35 +0300
committerAndreas Kling <kling@serenityos.org>2021-04-18 22:06:42 +0200
commitaaf3d26dae90318e4d530ccc164574914223feeb (patch)
tree6c6151687dbd6a54b4dff12d584ff48ff450334c /Kernel/VirtIO
parent7dc95721ee0087846d818fdc46b380ed888c1d0e (diff)
downloadserenity-aaf3d26dae90318e4d530ccc164574914223feeb.zip
Kernel: Add kernel command line flag to disable VirtIO support
This command line flag can be used to disable VirtIO support on certain configurations (native windows) where interfacing with virtio devices can cause qemu to freeze.
Diffstat (limited to 'Kernel/VirtIO')
-rw-r--r--Kernel/VirtIO/VirtIO.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/VirtIO/VirtIO.cpp b/Kernel/VirtIO/VirtIO.cpp
index 203a529986..b01689a036 100644
--- a/Kernel/VirtIO/VirtIO.cpp
+++ b/Kernel/VirtIO/VirtIO.cpp
@@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <Kernel/CommandLine.h>
#include <Kernel/VirtIO/VirtIO.h>
#include <Kernel/VirtIO/VirtIOConsole.h>
#include <Kernel/VirtIO/VirtIORNG.h>
@@ -32,6 +33,8 @@ namespace Kernel {
void VirtIO::detect()
{
+ if (kernel_command_line().disable_virtio())
+ return;
PCI::enumerate([&](const PCI::Address& address, PCI::ID id) {
if (address.is_null() || id.is_null())
return;