aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-10-03 11:06:12 +0100
committerJason Wang <jasowang@redhat.com>2022-10-28 13:28:52 +0800
commit7d0e12af59286f3784c3ab7502325fc6a051d117 (patch)
tree0d359f3e473aec496c2961a0c0b8e87b04be1509 /hw
parent8801ccd0500437a86e3d15a806f37ebb84605dce (diff)
downloadqemu-7d0e12af59286f3784c3ab7502325fc6a051d117.zip
qemu-7d0e12af59286f3784c3ab7502325fc6a051d117.tar.gz
qemu-7d0e12af59286f3784c3ab7502325fc6a051d117.tar.bz2
net: improve error message for missing netdev backend
The current message when using '-net user...' with SLIRP disabled at compile time is: qemu-system-x86_64: -net user: Parameter 'type' expects a net backend type (maybe it is not compiled into this binary) An observation is that we're using the 'netdev->type' field here which is an enum value, produced after QAPI has converted from its string form. IOW, at this point in the code, we know that the user's specified type name was a valid network backend. The only possible scenario that can make the backend init function be NULL, is if support for that backend was disabled at build time. Given this, we don't need to caveat our error message with a 'maybe' hint, we can be totally explicit. The use of QERR_INVALID_PARAMETER_VALUE doesn't really lend itself to user friendly error message text. Since this is not used to set a specific QAPI error class, we can simply stop using this pre-formatted error text and provide something better. Thus the new message is: qemu-system-x86_64: -net user: network backend 'user' is not compiled into this binary The case of passing 'hubport' for -net is also given a message reminding people they should have used -netdev/-nic instead, as this backend type is only valid for the modern syntax. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
0 files changed, 0 insertions, 0 deletions