[libvirt] [with libvirt/qemu git] invoking 'qemu-system-x86_64' fails w/: -netdev bridge, br=virbr0, id=hostnet0 Device 'bridge' could not be initialized"

Kashyap Chamarthy kchamart at redhat.com
Sat Oct 6 12:43:06 UTC 2012


On 10/06/2012 06:08 PM, Kashyap Chamarthy wrote:
> Hi,
> 
> I'm on latest master, w/ Eric's block-commit patches applied
> ===========================================================
> [kashyap at moon libvirt-k]$ git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 2 commits.
> #
> nothing to commit (working directory clean)
> [kashyap at moon libvirt-k]$
> ===========================================================
> [kashyap at moon libvirt-k]$ # ./autogen.sh ; make -j5 ; make check
> ===========================================================
> 
> 
> Now, then define an xml [see complete xml at the bottom]
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ ./run ./tools/virsh define /var/tmp/f17-base.xml
> Domain f17-base defined from /var/tmp/f17-base.xml
> #-----------------------------------------------------------#
> 
> Try to start the guest now:
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ ./run ./tools/virsh start f17-base
> error: Failed to start domain f17-base
> error: internal error Process exited while reading console log output: char device
> redirected to /dev/pts/6
> failed to launch bridge helper
> qemu-system-x86_64: -netdev bridge,br=virbr0,id=hostnet0: Device 'bridge' could not be
> initialized
> 
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> 
> The emulator is pointed to latest qemu-system-x86_64 compiled from latest qemu-git
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ egrep -i 'emulator|bridge' /var/tmp/f17-base.xml
>     <emulator>/home/kashyap/projects/qemu/x86_64-softmmu/qemu-system-x86_64</emulator>
>     <interface type='bridge'>
>       <source bridge='virbr0'/>
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ brctl show
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.00215e6fb9f4       no              eth0
> virbr0          8000.525400573710       yes             virbr0-nic
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ ./run ./tools/virsh version
> Compiled against library: libvirt 0.10.2
> Using library: libvirt 0.10.2
> Using API: QEMU 0.10.2
> Cannot extract running QEMU hypervisor version
> 
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ ps -ef | grep libvirtd
> kashyap   2277     1  2 17:07 ?        00:00:00
> /home/kashyap/projects/libvirt-k/daemon/.libs/lt-libvirtd --timeout=30
> kashyap   2392 11303  0 17:07 pts/15   00:00:00 grep --color=auto libvirtd
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> 
> 
> That's what I see in the local log file:
> #-----------------------------------------------------------#
> [kashyap at moon libvirt-k]$ cat ~/.cache/libvirt/qemu/log/f17-base.log
> 2012-10-06 11:37:41.155+0000: starting up
> LC_ALL=C LD_LIBRARY_PATH=/home/kashyap/projects/libvirt-k/src/.libs
> PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/kashyap/.local/bin:/home/kashyap/bin:/home/kashyap/.local/bin:/home/kashyap/bin
> HOME=/home/kashyap USER=kashyap LOGNAME=kashyap
> /home/kashyap/projects/qemu/x86_64-softmmu/qemu-system-x86_64 -name f17-base -S -M pc-1.2
> -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -uuid
> 8d54ced1-2662-bcae-0804-d4a3e65e9ff6 -nographic -no-user-config -nodefaults -chardev
> socket,id=charmonitor,path=/home/kashyap/.config/libvirt/qemu/lib/f17-base.monitor,server,nowait
> -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device
> piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive
> file=/var/lib/libvirt/images/f17-base.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none
> -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
> -netdev bridge,br=virbr0,id=hostnet0 -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:51:00:a9:f1:7f,bus=pci.0,addr=0x3 -chardev
> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device
> usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
> char device redirected to /dev/pts/6
> failed to launch bridge helper
> qemu-system-x86_64: -netdev bridge,br=virbr0,id=hostnet0: Device 'bridge' could not be
> initialized
> 2012-10-06 11:37:41.281+0000: shutting down
> [kashyap at moon libvirt-k]$
> #-----------------------------------------------------------#
> 
> 
> And that's the xml file:
> #-----------------------------------------------------------#
> 
> <domain type='kvm'>
>   <name>f17-base</name>
>   <uuid>8d54ced1-2662-bcae-0804-d4a3e65e9ff6</uuid>
>   <memory unit='KiB'>2097152</memory>
>   <currentMemory unit='KiB'>2097152</currentMemory>
>   <vcpu placement='static'>2</vcpu>
>   <os>
>     <type arch='x86_64' machine='pc-1.2'>hvm</type>
>     <boot dev='hd'/>
>   </os>
>   <features>
>     <acpi/>
>     <apic/>
>     <pae/>
>   </features>
>   <clock offset='utc'/>
>   <on_poweroff>destroy</on_poweroff>
>   <on_reboot>restart</on_reboot>
>   <on_crash>restart</on_crash>
>   <devices>
>     <emulator>/home/kashyap/projects/qemu/x86_64-softmmu/qemu-system-x86_64</emulator>
>     <disk type='file' device='disk'>
>       <driver name='qemu' type='qcow2' cache='none'/>
>       <source file='/var/lib/libvirt/images/f17-base.qcow2'/>
>       <target dev='vda' bus='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
>     </disk>
>     <controller type='usb' index='0'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
>     </controller>
>     <interface type='bridge'>
>       <mac address='52:51:00:a9:f1:7f'/>
>       <source bridge='br0'/>

(that's a typo there -- it's 'virbr0'  (but I tried with both 'virbr0' and an actual
bridge on the system 'br0', to no avail)

>       <model type='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
>     </interface>
>     <serial type='pty'>
>       <target port='0'/>
>     </serial>
>     <console type='pty'>
>       <target type='serial' port='0'/>
>     </console>
>     <input type='tablet' bus='usb'/>
>     <memballoon model='virtio'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
>     </memballoon>
>   </devices>
> </domain>
> #-----------------------------------------------------------#
> 
> 
> Other notes: Rich Jones suggested me to do a build dep for qemu & re-try
> [kashyap at moon qemu]$ yum-builddep qemu
> [kashyap at moon qemu]$  ./configure --target-list=x86_64-softmmu --disable-werror ; make -j5
>  and re-configure qemu.
> 
> And still no dice, I see the same 'bridge' could not be initialized
> 
> Any hints here?
> 


-- 
/kashyap




More information about the libvir-list mailing list