WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] HELP:) vif-common.sh call on xm shutdown / xm destroy

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] HELP:) vif-common.sh call on xm shutdown / xm destroy
From: Sébastien RICCIO <sr@xxxxxxxxxxxxxxx>
Date: Fri, 23 May 2008 12:04:39 +0200
Delivery-date: Fri, 23 May 2008 03:05:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: OpenBusiness SA / SwissCenter
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Dear list,

I'm currently modifying the vif-common.sh script in order to be able
to implement custom iptables rules for different guests.

As I can see, when a guest is created with xm create, vif-common.sh is
called with the "online" command. Perfect.

When the guest shutdown itself, vif-common.sh is not called, neither
when I shut down the guest with "xm shutdown" command.

But if I kill the guest with "xm destroy", the vif-common.sh is called
with command "offline".

Is it right that xm shutdown doesn't call vif-common.sh ?

I was expecting it to be executed when a shutdown is issued, in order
to clean the iptables rules for this particular guest.

Any ideas ?

btw: here is my custom vif-common.sh code:

frob_iptable()
{
if [ "$command" == "online" ]
then
  # Adding custom chain
  iptables -N "$vif"
  if [ -e /etc/xen/fw/$vif.rules ]
  then
    source /etc/xen/fw/$vif.rules
  else
    if [ -e /etc/xen/fw/default.rules ]
    then
      source /etc/xen/fw/default.rules
    else
      iptables -A "$vif" -j ACCEPT
    fi
  fi
   # Forwarding the packets to the right chain
  iptables -A FORWARD -m physdev --physdev-in "$vif" "$@" -j "$vif"
 else
  echo "debug" >>/tmp/debug.log
  # Removing the chain forward
  iptables -D FORWARD -m physdev --physdev-in "$vif" "$@" -j "$vif"
  # Flushing the custom chain
  iptables -F "$vif"
  # Removing the custom chain
  iptables -X "$vif"
fi
}




--
Sébastien Riccio
SwissCenter / OpenBusiness SA
sr@xxxxxxxxxxxxxxxx
________________________________________________

OpenBusiness S.A.
World Trade Center
Av Gratta-Paille 1-2        Tel: +41 21 641 1010
CH-1000 Lausanne 30         FAX: +41 21 641 1011
Switzerland                  www.openbusiness.ch
__________________________________________________________________________
Disclaimer

This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
OpenBusiness Group.
If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding,
printing, or copy-ing of this email is strictly prohibited.

If you have received this email in error please notify the OpenBusiness
help-desk by telephone on +41 21 641 10 10.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel




--
Sébastien Riccio
SwissCenter / OpenBusiness SA
sr@xxxxxxxxxxxxxxxx
________________________________________________

OpenBusiness S.A.
World Trade Center
Av Gratta-Paille 1-2        Tel: +41 21 641 1010
CH-1000 Lausanne 30         FAX: +41 21 641 1011
Switzerland                  www.openbusiness.ch
__________________________________________________________________________
Disclaimer

This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of the
OpenBusiness Group.
If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding,
printing, or copy-ing of this email is strictly prohibited.

If you have received this email in error please notify the OpenBusiness
help-desk by telephone on +41 21 641 10 10.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>