Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
softmmu/vl.c: Disable default NIC if it has not been compiled into th…
…e 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>
  • Loading branch information
huth committed May 22, 2023
1 parent 01ecdaa commit 26a0802
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions softmmu/vl.c
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 26a0802

Please sign in to comment.