Bug 524880

Summary: The error message should be more explicit when bridge networking is disabled
Product: [Community] Virtualization Tools Reporter: Laurent Léonard <laurent>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, dallan, devurandom, laurent, libvirt-maint, mprivozn, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-25 13:11:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laurent Léonard 2009-09-22 15:03:08 UTC
Description of problem:
The error message from libvirt should be more explicit when bridge networking is disabled in the Linux kernel:

~# virsh net-start default
libvir: QEMU error : internal error cannot create bridge 'virbr0' : Package not installed
error: Failed to start network default

Version-Release number of selected component (if applicable):
0.4.6

How reproducible:
Always

Steps to Reproduce:
1. Get a Linux kernel without bridge networking support.
2. Try to start a virtual network.
  
Actual results:
libvir: QEMU error : internal error cannot create bridge 'virbr0' : Package not installed
error: Failed to start network default

Expected results:
A more explicit error message.

Comment 1 Dave Allan 2013-06-25 12:22:48 UTC
Michal, is this still relevant?

Comment 2 Michal Privoznik 2013-06-25 13:11:09 UTC
Currently you'll get:

virsh # net-start default
error: Failed to start network default
error: Unable to create bridge virbr0: Function not implemented

Can that be considered as more explicit? I think the requester wanted us to tell which package should he install - but that's out of libvirt scope (if even feasible). Getting 'Function not implemented' (=ENOSYS) is the best we can do here for a reasonable trade-off. Hence, I am closing this one. If somebody disagrees feel free to reopen with defining what's expected from a 'more explicit' error message in this case.

Comment 3 Dave Allan 2013-06-25 13:18:05 UTC
Is there any other reason that this codepath would fail other than lack of bridge support in the kernel?  If not, I'd say it should say:

error: Unable to create bridge virbr0: Kernel lacks bridge support

otherwise, I agree with you.

Comment 4 Michal Privoznik 2013-06-25 13:33:11 UTC
The codepath is determined at build time. So no package installation/upgrade after you've build libvirt will change the path. Nor kernel package. The decision on the path is made depending on linux-headers package. In which case the most proper error message then would be "Bridge creation disabled at build time". Do we want to do that?