Index: package_branches/invirt-xen-config/hvirt/debian/changelog
===================================================================
--- package_branches/invirt-xen-config/hvirt/debian/changelog	(revision 2816)
+++ package_branches/invirt-xen-config/hvirt/debian/changelog	(revision 2817)
@@ -1,2 +1,8 @@
+invirt-xen-config (0.0.27) unstable; urgency=low
+
+  * Make the internal IP into a parameter
+
+ -- Greg Brockman <gdb@mit.edu>  Thu, 31 Dec 2009 02:22:43 -0500
+
 invirt-xen-config (0.0.26) unstable; urgency=low
 
Index: package_branches/invirt-xen-config/hvirt/debian/transform_xend-config.sxp.invirt.mako
===================================================================
--- package_branches/invirt-xen-config/hvirt/debian/transform_xend-config.sxp.invirt.mako	(revision 2816)
+++ package_branches/invirt-xen-config/hvirt/debian/transform_xend-config.sxp.invirt.mako	(revision 2817)
@@ -4,9 +4,19 @@
 from invirt.config import structs as cfg
 import os
-hostname = os.uname()[1].split('.')[0]
+fqdn = os.uname()[1]
+internal_ip = None
+# This hack is necessary because cfg.hosts is an array rather than a dict.
+for host in cfg.hosts:
+  if host.hostname == fqdn:
+    internal_ip = host.internal_ip
+    break
+
+class xend_template_exception(Exception): pass
+if internal_ip is None:
+  raise xend_template_exception('Could not find an internal IP in the configuration for host %s' % fqdn)
 %>
 EOF
 
-s/^\#?\(xend-relocation-address ''\)/(xend-relocation-address '\${hostname}-internal')/m or die;
+s/^\#?\(xend-relocation-address ''\)/(xend-relocation-address '\${internal_ip}.')/m or die;
 s/^\(xend-relocation-hosts-allow '[^']*'\)/(xend-relocation-hosts-allow '')/m or die;
 s/^\(dom0-min-mem [0-9]*\)/(dom0-min-mem 1536)/m or die;
