Bug 239273 - bridged networking with qemu doesn't work
Summary: bridged networking with qemu doesn't work
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-07 11:03 UTC by Gerd Hoffmann
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Fixed In Version: libvirt-0.3.0-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-13 14:28:57 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
xml config file (824 bytes, text/plain)
2007-05-07 11:03 UTC, Gerd Hoffmann
no flags Details
lv.log (61.63 KB, text/plain)
2007-05-11 07:24 UTC, Gerd Hoffmann
no flags Details

Description Gerd Hoffmann 2007-05-07 11:03:11 UTC
Description of problem:
bridged networking with qemu doesn't work

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

zweiblum root ~# rpm -q libvirt qemu
libvirt-0.2.2-3.FCr6
qemu-0.9.0-2.FCr6
(rawhide versions rebuild from source on fc6)

How reproducible:
Configure a virtual machine with bridged network, try to boot it.

Actual results:
VM doesn't boot, error message:
virsh # start fc6
libvir: QEMU error : internal error Failed to add tap interface 'fc6' to bridge
'br0' : Invalid argument

Expected results:
VM boots

Additional info:
When using an "user" interface type it works just fine.

Comment 1 Gerd Hoffmann 2007-05-07 11:03:11 UTC
Created attachment 154251 [details]
xml config file

Comment 2 Daniel Berrange 2007-05-10 15:16:25 UTC
Could you clarify a couple of things

 - What  --connect arg did you give to virsh & what user is it running as
 - Does it work if you remove the <target> element from the <interface> tag
 - brctl show & ifconfig output


Comment 3 Gerd Hoffmann 2007-05-10 15:28:50 UTC
virsh args (used as root):

zweiblum root ~# set | grep VIRSH
VIRSH_DEFAULT_CONNECT_URI=qemu:///system

network configuration:

zweiblum root ~# brctl show 
bridge name     bridge id               STP enabled     interfaces
br0             8000.000000000000       no
zweiblum root ~# ip addr ls
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:41:e1:3d:40 brd ff:ff:ff:ff:ff:ff
3: irda0: <NOARP> mtu 2048 qdisc noop qlen 8
    link/irda 00:00:00:00 brd ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 172.31.6.1/24 brd 172.31.6.255 scope global br0
    inet6 fe80::200:ff:fe00:0/64 scope link 
       valid_lft forever preferred_lft forever
5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:19:d2:98:eb:8c brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.103/24 brd 192.168.2.255 scope global eth1
    inet6 fe80::219:d2ff:fe98:eb8c/64 scope link 
       valid_lft forever preferred_lft forever
7: vpn0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1412 qdisc pfifo_fast qle
n 500
    link/[65534] 
    inet 10.32.4.27/32 brd 10.32.4.27 scope global vpn0
zweiblum root ~# cat /etc/sysconfig/networking/devices/ifcfg-br0 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
DEVICE=br0
TYPE=Bridge
#MACADDR=00:00:11:22:33:44
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=172.31.6.1
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
zweiblum root ~# 

deleting <target> gives a slightly different error message:

zweiblum root ~# virsh start fc6
libvir: QEMU error : internal error Failed to add tap interface 'vnet%d' to
bridge 'br0' : Invalid argument
error: Failed to start domain fc6



Comment 4 Daniel Berrange 2007-05-10 19:30:11 UTC
This is puzzelling, based on the bridge & network config you show above,
everything should be operating as required. Could you try & collect the output
of     

strace -s 32000 -f -o lv.log -p `pgrep libvirt_qemud`

Starting it just before running  virsh start should be sufficient.


Comment 5 Gerd Hoffmann 2007-05-11 07:24:25 UTC
Created attachment 154522 [details]
lv.log

Comment 6 Daniel Berrange 2007-05-11 11:49:04 UTC
Ah I think I might know what's going on now. It appears the brCtrl() object will
never get initialized unless there is at least one virtual network defined. This
is wrong because we need the brCtrl() object even for setting up bridged
networking. Can you do 'virsh net-list' - I think its quite likely it won't show
any networks. If so, then just defining a default virtual network

virsh net-define /usr/share/libvirt/networks/default.xml
virsh net-autostart default
virsh net-start default

Should make it possible to starts VMs.


Comment 7 Gerd Hoffmann 2007-05-11 13:00:54 UTC
Yep, there is no libvirt-managed network.
Creating one makes bridged network work indeed.


Comment 8 Daniel Veillard 2007-07-13 14:28:57 UTC
Should be fixed in current releases:
<danpb> DV: yeah fixed that a long time ago
<danpb> DV: you can close it :-)

Daniel



Note You need to log in before you can comment on or make changes to this bug.