Commit 749a2b90 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Add instance communication for Xen

* add path to the 'xen-ifup-os' script that configures interfaces
* fix if-elif construct
* generate names of the form '' for instance communication TAP interfaces
* add 'vifname' property to the 'vif' field of the configuration of a domain
Signed-off-by: default avatarJose A. Lopes <>
Reviewed-by: default avatarHrvoje Ribicic <>
parent aa21546b
......@@ -365,6 +365,24 @@ def _QuoteCpuidField(data):
return "'%s'" % data if data.startswith("host") else data
def _ConfigureNIC(instance, seq, nic, tap):
"""Run the network configuration script for a specified NIC
See L{hv_base.ConfigureNIC}.
@type instance: instance object
@param instance: instance we're acting on
@type seq: int
@param seq: nic sequence number
@type nic: nic object
@param nic: nic we're acting on
@type tap: str
@param tap: the host's tap interface this NIC corresponds to
hv_base.ConfigureNIC(pathutils.XEN_IFUP_OS, instance, seq, nic, tap)
class XenHypervisor(hv_base.BaseHypervisor):
"""Xen generic hypervisor interface
......@@ -547,6 +565,12 @@ class XenHypervisor(hv_base.BaseHypervisor):
if nic.nicparams[constants.NIC_VLAN]:
nic_str += "%s" % nic.nicparams[constants.NIC_VLAN]
if and \
tap = hv_base.GenerateTapName()
nic_str += ", vifname=%s" % tap = tap
if hvp[constants.HV_VIF_SCRIPT]:
nic_str += ", script=%s" % hvp[constants.HV_VIF_SCRIPT]
......@@ -692,6 +716,10 @@ class XenHypervisor(hv_base.BaseHypervisor):
(, result.fail_reason,
result.output, stashed_config))
for nic_seq, nic in enumerate(instance.nics):
if and""):
_ConfigureNIC(instance, nic_seq, nic,
def StopInstance(self, instance, force=False, retry=False, name=None,
"""Stop an instance.
......@@ -100,6 +100,7 @@ RAPI_USERS_FILE = DATA_DIR + "/rapi/users"
QUEUE_DIR = DATA_DIR + "/queue"
INTENT_TO_UPGRADE = DATA_DIR + "/intent-to-upgrade"
XEN_IFUP_OS = CONF_DIR + "/xen-ifup-os"
VNC_PASSWORD_FILE = CONF_DIR + "/vnc-cluster-password"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment