def listenRelocation(): xroot = XendRoot.instance() if xroot.get_xend_unix_server(): path = '/var/lib/xend/relocation-socket' unix.UnixListener(path, RelocationProtocol) if xroot.get_xend_relocation_server(): port = xroot.get_xend_relocation_port() interface = xroot.get_xend_relocation_address() hosts_allow = xroot.get_xend_relocation_hosts_allow() if hosts_allow == '': hosts_allow = None else: hosts_allow = map(re.compile, hosts_allow.split(" ")) tcp.TCPListener(RelocationProtocol, port, interface = interface, hosts_allow = hosts_allow)
"""Support for virtual network interfaces. """ import os import random import re from xen.xend import sxp from xen.xend import XendRoot from xen.xend.server.DevController import DevController xroot = XendRoot.instance() def randomMAC(): """Generate a random MAC address. Uses OUI (Organizationally Unique Identifier) 00-16-3E, allocated to Xensource, Inc. The OUI list is available at http://standards.ieee.org/regauth/oui/oui.txt. The remaining 3 fields are random, with the first bit of the first random field set 0. @return: MAC address string """ mac = [ 0x00, 0x16, 0x3e,
# Copyright (C) 2004, 2005 Mike Wray <*****@*****.**> # Copyright (C) 2005 XenSource Ltd #============================================================================ """Support for virtual network interfaces. """ import os import random import re from xen.xend import sxp from xen.xend import XendRoot from xen.xend.server.DevController import DevController xroot = XendRoot.instance() def randomMAC(): """Generate a random MAC address. Uses OUI (Organizationally Unique Identifier) 00-16-3E, allocated to Xensource, Inc. The OUI list is available at http://standards.ieee.org/regauth/oui/oui.txt. The remaining 3 fields are random, with the first bit of the first random field set 0. @return: MAC address string """ mac = [