X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=xenserver%2Fopt_xensource_libexec_InterfaceReconfigure.py;h=2b709ad03194270b9a46ad5d43245e3004c73592;hb=9794e806040d4643e376ae7a5cdf5e7cdcfc3c16;hp=570ebccbe73cb454c53b627244d0034060a97f83;hpb=5f55c39b21e69025045437ffbd3bb98fe6ce2e89;p=openvswitch diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py index 570ebccb..2b709ad0 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py @@ -803,6 +803,12 @@ class Datapath(object): def __init__(self, pif): self._pif = pif + @classmethod + def rewrite(cls): + """Class method called when write action is called. Can be used + to update any backend specific configuration.""" + pass + def configure_ipdev(self, cfg): """Write ifcfg TYPE field for an IPdev, plus any type specific fields to cfg @@ -850,7 +856,7 @@ class Datapath(object): """ raise NotImplementedError -def DatapathFactory(pif): +def DatapathFactory(): # XXX Need a datapath object for bridgeless PIFs try: @@ -862,9 +868,9 @@ def DatapathFactory(pif): if network_backend == "bridge": from InterfaceReconfigureBridge import DatapathBridge - return DatapathBridge(pif) - elif network_backend == "vswitch": + return DatapathBridge + elif network_backend in ["openvswitch", "vswitch"]: from InterfaceReconfigureVswitch import DatapathVswitch - return DatapathVswitch(pif) + return DatapathVswitch else: raise Error("unknown network backend %s" % network_backend)