All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Scharrenberg <pittipatti@web.de>
To: xen-devel@lists.xensource.com
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces
Date: Wed, 9 Feb 2011 20:29:58 +0100	[thread overview]
Message-ID: <201102092029.58873.pittipatti@web.de> (raw)
In-Reply-To: <19793.28820.280929.667983@mariner.uk.xensource.com>

Consistently use "dev" variable for virtual interfaces in vif-network scripts.

Signed-off-by: Patrick Scharrenberg <pittipatti@web.de>

---

resend this patch due to line wrapping problems and missing signed-off line


diff -r e7b31cc0093c tools/hotplug/Linux/vif-route
--- a/tools/hotplug/Linux/vif-route     Mon Jan 31 17:46:55 2011 +0000
+++ b/tools/hotplug/Linux/vif-route     Wed Feb 09 20:20:51 2011 +0100
@@ -12,7 +12,7 @@
 # vif-route (add|remove|online|offline)
 #
 # Environment vars:
-# vif         vif interface name (required).
+# dev         vif interface name (required).
 # XENBUS_PATH path to this device's details in the XenStore (required).
 #
 # Read from the store:
@@ -21,19 +21,19 @@
 #============================================================================

 dir=$(dirname "$0")
-. "$dir/vif-common.sh"
+. "${dir}/vif-common.sh"

 main_ip=$(dom0_ip)

-case "$command" in
+case "${command}" in
     online)
-        ifconfig ${vif} ${main_ip} netmask 255.255.255.255 up
-        echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
+        ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up
+        echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
         ipcmd='add'
         cmdprefix=''
         ;;
     offline)
-        do_without_error ifdown ${vif}
+        do_without_error ifdown ${dev}
         ipcmd='del'
         cmdprefix='do_without_error'
         ;;
@@ -43,14 +43,14 @@
     # If we've been given a list of IP addresses, then add routes from dom0 to
     # the guest using those addresses.
     for addr in ${ip} ; do
-      ${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} src ${main_ip}
+      ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip}
     done
 fi

 handle_iptable

-log debug "Successful vif-route $command for $vif."
-if [ "$command" = "online" ]
+log debug "Successful vif-route ${command} for ${dev}."
+if [ "${command}" = "online" ]
 then
   success
 fi
diff -r e7b31cc0093c tools/hotplug/Linux/vif-nat
--- a/tools/hotplug/Linux/vif-nat       Mon Jan 31 17:46:55 2011 +0000
+++ b/tools/hotplug/Linux/vif-nat       Wed Feb 09 20:23:38 2011 +0100
@@ -12,7 +12,7 @@
 # vif-nat (add|remove|online|offline)
 #
 # Environment vars:
-# vif         vif interface name (required).
+# dev         vif interface name (required).
 # XENBUS_PATH path to this device's details in the XenStore (required).
 #
 # Parameters:
@@ -98,7 +98,7 @@
 dhcparg_remove_entry()
 { 
   local tmpfile=$(mktemp)
-  sed -e "s/$vif //" "$dhcpd_arg_file" >"$tmpfile"
+  sed -e "s/${dev} //" "$dhcpd_arg_file" >"$tmpfile"
   if diff "$tmpfile" "$dhcpd_arg_file" >/dev/null
   then
     rm "$tmpfile"
@@ -112,11 +112,11 @@
   dhcparg_remove_entry
   local tmpfile=$(mktemp)
   # handle Red Hat, SUSE, and Debian styles, with or without quotes
-  sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"$vif "'"/' \
+  sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"${dev} "'"/' \
      "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
-  sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"$vif "'"/' \
+  sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"${dev} "'"/' \
      "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
-  sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"$vif "'"/' \
+  sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"${dev} "'"/' \
      "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
   rm -f "$tmpfile"
 }
@@ -164,28 +164,28 @@

 case "$command" in
     online)
-        if ip route | grep -q "dev $vif"
+        if ip route | grep -q "dev ${dev}"
         then
-          log debug "$vif already up"
+          log debug "${dev} already up"
           exit 0
         fi

-        do_or_die ip link set "$vif" up arp on
-        do_or_die ip addr add "$router_ip" dev "$vif"
-        do_or_die ip route add "$vif_ip" dev "$vif" src "$router_ip"
-        echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
+        do_or_die ip link set "${dev}" up arp on
+        do_or_die ip addr add "$router_ip" dev "${dev}"
+        do_or_die ip route add "$vif_ip" dev "${dev}" src "$router_ip"
+        echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
         [ "$dhcp" != 'no' ] && dhcp_up
         ;;
     offline)
         [ "$dhcp" != 'no' ] && dhcp_down
-        do_without_error ifconfig "$vif" down
+        do_without_error ifconfig "${dev}" down
         ;;
 esac


 handle_iptable

-log debug "Successful vif-nat $command for $vif."
+log debug "Successful vif-nat $command for ${dev}."
 if [ "$command" = "online" ]
 then
   success

  reply	other threads:[~2011-02-09 19:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05 16:26 [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces Patrick Scharrenberg
2011-02-07 16:11 ` Ian Jackson
2011-02-07 17:23   ` Stefano Stabellini
2011-02-07 21:59     ` Patrick Scharrenberg
2011-02-08 11:44       ` Stefano Stabellini
2011-02-08 16:34       ` Ian Jackson
2011-02-09 19:29         ` Patrick Scharrenberg [this message]
2011-02-11 18:22           ` [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces [and 1 more messages] Ian Jackson
  -- strict thread matches above, loose matches on Subject: below --
2011-02-05 13:39 [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces Patrick Scharrenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102092029.58873.pittipatti@web.de \
    --to=pittipatti@web.de \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.