diff options
author | Thomas Huth <thuth@redhat.com> | 2023-05-10 21:26:13 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-05-22 09:39:15 +0200 |
commit | 26a0802d1ccbf3c3c659f3d2641cf7deef0e70ac (patch) | |
tree | 1ea784ce1635e265d0a670ffe52fed5312d058e3 | |
parent | 01ecdaa40e0c14b99ae7e81b5bfce9b6bd6e167c (diff) | |
download | qemu-26a0802d1ccbf3c3c659f3d2641cf7deef0e70ac.zip qemu-26a0802d1ccbf3c3c659f3d2641cf7deef0e70ac.tar.gz qemu-26a0802d1ccbf3c3c659f3d2641cf7deef0e70ac.tar.bz2 |
softmmu/vl.c: Disable default NIC if it has not been compiled into the binary
Don't try to instantiate a default NIC if it is not available (since
this will cause QEMU to abort). Emit a warning instead.
Message-Id: <20230512124033.502654-5-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r-- | softmmu/vl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index 43d3b97..b0b96f6 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1294,6 +1294,13 @@ static void qemu_disable_default_devices(void) default_monitor = 0; default_net = 0; default_vga = 0; + } else { + if (default_net && machine_class->default_nic && + !module_object_class_by_name(machine_class->default_nic)) { + warn_report("Default NIC '%s' is not available in this binary", + machine_class->default_nic); + default_net = 0; + } } } |