Ok, based on some other feedback from Stuart, here is a new diff to test
that should work better ;-)
--- emulators/qemu/files/qemu-ifup
+++ emulators/qemu/files/qemu-ifup
@@ -16,16 +16,19 @@ echo -n " {$1 ($BRIDGE <-> $ETHER)"
# Set the tun device into layer2 mode
$SUDO ifconfig $1 link0 up
+# setup up $ETHER incase it wasn't created before
+if ! ifconfig $ETHER > /dev/null 2>&1; then
+ if ! $SUDO ifconfig $ETHER create > /dev/null 2>&1; then
+ echo "$ETHER creation failed, errors will follow"
+ else
+ $SUDO ifconfig $ETHER up
+ fi
+fi
+
# Set up our bridge
$SUDO ifconfig $1 group tun > /dev/null 2>&1
-$SUDO ifconfig $BRIDGE create > /dev/null 2>&1 && {
- # Only add rules if the bridge creation succeeds; otherwise
- # duplicate rules get loaded each time qemu starts
- # The following two block carp packets from wasting cpu cycles inside the
- # qemu sessions, remove if testing carp inside qemu
- $SUDO brconfig $BRIDGE rule block in on $ETHER dst 33:33:0:0:0:12
- $SUDO brconfig $BRIDGE rule block in on $ETHER dst 01:00:5e:00:00:12
-}
+# Creation only happens once; if it was created before .. this will fail
+$SUDO ifconfig $BRIDGE create > /dev/null 2>&1 && create=1
# Since we can specify ETHER and BRIDGE above, its possible that
# this tun interface or this physical interface was setup as part of
# a different bridge earlier, and that is never cleaned up, so we have
@@ -39,4 +42,13 @@ do
done
$SUDO brconfig $BRIDGE add $ETHER up
$SUDO brconfig $BRIDGE add $1 up || true
+# can not add rules until $ETHER is part of the $BRIDGE
+[ -n "$created" ] && {
+ # Only add rules if the bridge creation succeeds; otherwise
+ # duplicate rules get loaded each time qemu starts
+ # The following two block carp packets from wasting cpu cycles inside the
+ # qemu sessions, remove if testing carp inside qemu
+ $SUDO brconfig $BRIDGE rule block in on $ETHER dst 33:33:0:0:0:12
+ $SUDO brconfig $BRIDGE rule block in on $ETHER dst 01:00:5e:00:00:12
+}
echo "}"
--
Todd Fries .. [EMAIL PROTECTED]
_____________________________________________
| \ 1.636.410.0632 (voice)
| Free Daemon Consulting, LLC \ 1.405.227.9094 (voice)
| http://FreeDaemonConsulting.com \ 1.866.792.3418 (FAX)
| "..in support of free software solutions." \ 250797 (FWD)
| \
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
37E7 D3EB 74D0 8D66 A68D B866 0326 204E 3F42 004A
http://todd.fries.net/pgp.txt
Penned by Frank Bax on 20081203 22:31.57, we have:
> Hi Todd:
>
> You asked for feedback. Most of the time; qemu produces:
>
> {tun0 (bridge0 <-> em0)}
>
> But sometimes it produces:
>
> {tun0 (bridge0 <-> em0)brconfig: bridge0: No such process
> brconfig: bridge0: No such process
> }
>
> Network access still works, despite the error message.
>
> Frank
>
>
> On 2008-Nov-04, Todd T. Fries wrote:
>> Just out of curiosity, humor me, run qemu as root with the following added
>> options:
>>
>> -net nic,vlan=0 -net tap,vlan=0
>>
>> I've observed that at some point user mode networking has started segv'ed on
>> amd64 when running any qemu guest, and am sorry to report I have not yet
>> tracked down the source of the issue..
>>
>> Please let me know if you have other experiences.
>>
>> Thanks,