I got your point.
I made a mistake by adding the "brctl addbr $BRIDGE" command to the qemu-ifup script. Initially when I just followed the wiki and had the original qemu-ifup script given in the wiki, it threw me error as 'br0' was not added. Hence I added the command in qemu-ifup script, which I should not have done and rather fired it from command line for the first time alone.
Regarding how I build the image, I ll post my reply in the next post.
Thanks :)

On Fri, Apr 23, 2010 at 9:53 AM, SAMBUC Lionel <lionel.sambuc@heig-vd.ch> wrote:

> -----Original Message-----
> From: sreenaath vasudevan [mailto:sreenaathkv@gmail.com]
> Sent: vendredi 23 avril 2010 04:14
> To: embeddedxen-devel@lists.sourceforge.net
> Subject: Re: [Embeddedxen-devel] [XenARM] Re:xen-pxa270-qemu
>       3. Also I changed the /etc/wemu-ifup script as follows (added two
> more lines to what is givien in the wiki for adding the bridge being
> linking it with the tap0 interface.)
>              /etc/qemu-ifup
>              #!/bin/sh
>              BRIDGE=br0
>             #setup in promiscuous mode qemu's device
>             echo ifconfig $1 promisc up
>             ifconfig $1 promisc up
>             echo brctl addbr $BRIDGE
>             brctl addbr $BRIDGE
>             #add it to the bridge
>             echo brctl addif $BRIDGE $1
>             brctl addif $BRIDGE $1

While not being a show stopper, your qemu-ifup script seems wrong, please take the one from the GettingStarted guide. Based on your email, I also updated the guide this morning as some steps where incomplete.

For reference, the complete script:



 #setup in promiscuous mode qemu's device
 echo ifconfig $1 promisc up
 ifconfig $1 promisc up
 #add it to the bridge
 echo brctl addif $BRIDGE $1
 brctl addif $BRIDGE $1

The bridge device is created once (normally in /etc/network/interfaces) and then only modified with regards to the linked interfaces (brctl addif and brctl delif commands). This is also why we can see complaints about trying to create a bridge interface which already exists.

> ---------------------------------------------------------------------
>       user@ubuntu:~/embeddedxen# sudo qemu-system-arm -localtime -M
> mainstone -kernel ./xen/arch/arm/boot/uImage.mainstone -s -m 256 -pflash
> ./flash1 -pflash ./flash2 -net nic -net tap,ifname=tap0,script=/etc/qemu-ifup
>       ifconfig tap0 promisc up
>       brctl addbr br0
>       device br0 already exists; can't create bridge with the same name

This error comes from your "brctl addbr $BRIDGE" command.

>       brctl addif br0 tap0
>       map addr 0x82200a0
> --
> regards
> sreenaath

Have a nice day,