Bug 745248

Summary: Attaching external bridge to a guest in libvirt segfaults
Product: Red Hat Enterprise Linux 6 Reporter: Niklas Andersson <nianbig>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: acathrow, amit.shah, dallan, mkenneth, qzhang, shuang, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-12 11:56:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
libvirt configuration file for guest none

Description Niklas Andersson 2011-10-11 18:59:23 UTC
Created attachment 527525 [details]
libvirt configuration file for guest

Description of problem:
I tried to attach a guest VM in libvirt to an external bridge using the virtio driver, which results in the guest VM crashing (segfaults, see logs below).
It seems to be isolated to the virtio driver, as other drivers such as e1000 and rtl8139 works perfectly. The guest VM I'm using has the necessary virtio drivers and it works with internal libvirt created bridges.
Also, this works seamlessly in RHEL 6.0 - so I guess there's some bug coming in between these versions.

Version-Release number of selected component (if applicable):
RHEL 6.1
libvirt - 0.8.7

How reproducible:
every time

Steps to Reproduce:
1. Bring up an external bridge with brctl and attach it to an em, e.g.:
# brctl addbr br0
# brctl addif br0 em2
2. Define a new domain (guest VM) according to the attached configuration file which attaches one interface to the external bridge created in step 1.
3. Start the VM with # virsh start vm1
  
Actual results:
The VM crashes, after about 10-15s.

libvirt log at /var/log/libvirt/qemu/vm1.log says:
================================================================
2011-10-11 11:19:00.343: starting up
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.1.0 -no-kvm -m 125 -smp 1,sockets=1,cores=1,threads=1 -name vm1 -uuid 21dffb59-aa01-43f5-8a9b-daea4f410bc6 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -boot c -drive file=/vms/images/vm1.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=22,id=hostnet0,vhost=on,vhostfd=23 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:23:20:d8:70:2e,bus=pci.0,addr=0x3 -usb -vnc 127.0.0.1:0 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
Using CPU model "cpu64-rhel6"
2011-10-11 11:19:20.575: shutting down
================================================================

OS messages log at /var/log/messages says:
================================================================
Oct 11 11:18:50 kvm1 libvirtd: 11:18:50.016: 5949: warning : lxcStartup:2128 : Unable to create cgroup for driver: No such device or address
Oct 11 11:19:00 kvm1 kernel: device vnet0 entered promiscuous mode
Oct 11 11:19:00 kvm1 libvirtd: 11:19:00.344: 5953: warning : qemudStartVMDaemon:3336 : Executing /usr/libexec/qemu-kvm
Oct 11 11:19:00 kvm1 libvirtd: 11:19:00.348: 5953: warning : qemudStartVMDaemon:3346 : Executing done /usr/libexec/qemu-kvm
Oct 11 11:19:00 kvm1 qemu-kvm: Could not find keytab file: /etc/qemu/krb5.tab: No such file or directory
Oct 11 11:19:20 kvm1 kernel: qemu-kvm[6071]: segfault at 30 ip 0000000000422906 sp 00007fffb51cb790 error 4 in qemu-kvm[400000+2c2000]
Oct 11 11:19:20 kvm1 abrt[6097]: can't read /proc/6071/exe link
Oct 11 11:19:20 kvm1 kernel: device vnet0 left promiscuous mode
Oct 11 11:19:20 kvm1 kernel: br0: port 2(vnet0) entering disabled state
================================================================


Expected results:
Running VM that doesn't crash

Comment 2 Dave Allan 2011-10-11 19:22:25 UTC
Changing component to qemu-kvm since this is a segfault in qemu-kvm.

Comment 3 Qunfang Zhang 2011-10-12 08:10:58 UTC
Hi, Niklas 

Notice that there's "no-kvm" parameter in the command line. So could you change the <domain type="qemu"> to <domain type="kvm">  to enable kvm?

Also the guest's memory is 125M, what's your guest os? Could you give more memory to have a try?

Comment 6 Qunfang Zhang 2011-10-12 08:55:53 UTC
(In reply to comment #5)
> rhel6 doesn't support -no-kvm 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=590626#c5
> https://bugzilla.redhat.com/show_bug.cgi?id=620141#c3

Thanks shuang, clear the needinfo.

Comment 8 Dor Laor 2011-10-12 11:56:20 UTC
Closing the bug since we do not support -no-kvm (meaning pure emulation in qemu).
Please try again with kvm enabled and report if it fails

Comment 9 Niklas Andersson 2011-10-12 16:22:16 UTC
Works! Thanks!!