• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python log.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中xen.xend.XendLogging.log.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: delete

 def delete(self):
     log.info("Deleting vnet %s", self.id)
     Brctl.vif_bridge_rem({'bridge': self.bridge, 'vif': self.vnetif})
     Brctl.bridge_del(self.bridge)
     val = vnet_cmd(['vnet.del', self.id])
     xstransact.Remove(self.dbpath)
     return val
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:7,代码来源:XendVnet.py


示例2: __init__

    def __init__(self, maxpolicies):
        """ Create a management class for managing the system's
            policies.

            @param maxpolicies: The max. number of policies allowed
                                on the system (currently '1')
        """
        self.maxpolicies = maxpolicies
        self.policies = {}
        self.xsobjs = {}

        act_pol_name = self.get_hv_loaded_policy_name()
        initialize()

        ref = uuid.createString()
        try:
            self.xsobjs[ref] = ACMPolicy(name=act_pol_name, ref=ref)
            self.policies[ref] = (act_pol_name, xsconstants.ACM_POLICY_ID)
        except Exception, e:
            log.error("Could not find XML representation of policy '%s': "
                      "%s" % (act_pol_name,e))
            rc, errors, acmpol_def = ACMPolicy.force_default_policy()
            if rc == xsconstants.XSERR_SUCCESS:
                self.xsobjs[ref] = acmpol_def
                self.policies[ref] = (acmpol_def.get_name(),
                                      xsconstants.ACM_POLICY_ID)
                log.info("Switched to DEFAULT policy.")
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:27,代码来源:XendXSPolicyAdmin.py


示例3: _sentinel_watch

 def _sentinel_watch(self):
     log.info("waiting for sentinel_fifo")
     try: self.sentinel_fifo.read(1)
     except OSError, e: pass
     self.sentinel_lock.acquire()
     if self.pid:
         try:
             (p,st) = os.waitpid(self.pid, os.WNOHANG)
             if p == self.pid:
                 message = oshelp.waitstatus_description(st)
             else:
                 # obviously it is malfunctioning, kill it now
                 try:
                     os.kill(self.pid, signal.SIGKILL)
                     message = "malfunctioning (closed sentinel), killed"
                 except:
                     message = "malfunctioning or died ?"
             message = "pid %d: %s" % (self.pid, message)
         except Exception, e:
             message = "waitpid failed: %s" % utils.exception_string(e)
         message = "device model failure: %s" % message
         try: message += "; see %s " % self.logfile
         except: pass
         self._dmfailed(message)
         self.pid = None
开发者ID:changliwei,项目名称:suse_xen,代码行数:25,代码来源:image.py


示例4: signalDeviceModel

    def signalDeviceModel(self, cmd, ret, par = None):
        if self.device_model is None:
            return
        # Signal the device model to for action
        if cmd is '' or ret is '':
            raise VmError('need valid command and result when signal device model')

        orig_state = xstransact.Read("/local/domain/0/device-model/%i/state"
                                % self.vm.getDomid())

        if par is not None:
            xstransact.Store("/local/domain/0/device-model/%i"
                             % self.vm.getDomid(), ('parameter', par))

        xstransact.Store("/local/domain/0/device-model/%i"
                         % self.vm.getDomid(), ('command', cmd))
        # Wait for confirmation.  Could do this with a watch but we'd
        # still end up spinning here waiting for the watch to fire. 
        state = ''
        count = 0
        while state != ret:
            state = xstransact.Read("/local/domain/0/device-model/%i/state"
                                    % self.vm.getDomid())
            time.sleep(0.1)
            count += 1
            if count > 100:
                raise VmError('Timed out waiting for device model action')

        #resotre orig state
        xstransact.Store("/local/domain/0/device-model/%i"
                         % self.vm.getDomid(), ('state', orig_state))
        log.info("signalDeviceModel:restore dm state to %s", orig_state)
开发者ID:amodj,项目名称:Utopia,代码行数:32,代码来源:image.py


示例5: getDeviceDetails

    def getDeviceDetails(self, config):
        """@see DevController.getDeviceDetails"""

        devid = self.allocateDeviceID()
        inst = int(config.get("pref_instance", -1))
        if inst == -1:
            inst = int(config.get("instance", 0))

        typ = config.get("type")
        uuid = config.get("uuid")

        log.info("The domain has a TPM with pref. instance %d and devid %d.", inst, devid)
        back = {"pref_instance": "%i" % inst, "resume": "%s" % (self.vm.getResume())}
        if typ:
            back["type"] = typ
        if uuid:
            back["uuid"] = uuid

            data = self.vm.info["devices"].get(uuid)
            if data:
                other = data[1].get("other_config")
                if type(other) == dict:
                    for key, item in other.items():
                        back["oc_" + key] = item

        front = {"handle": "%i" % devid}

        return (devid, back, front)
开发者ID:Hearen,项目名称:OnceServer,代码行数:28,代码来源:tpmif.py


示例6: _loadConfig

def _loadConfig(servers, root, reload):
    if xoptions.get_xend_http_server():
        servers.add(HttpServer(root,
                               xoptions.get_xend_address(),
                               xoptions.get_xend_port()))
    if  xoptions.get_xend_unix_server():
        path = xoptions.get_xend_unix_path()
        log.info('unix path=' + path)
        servers.add(UnixHttpServer(root, path))

    api_cfg = xoptions.get_xen_api_server()
    if api_cfg:
        try:
            for server_cfg in api_cfg:
                # Parse the xen-api-server config
                
                ssl_key_file = None
                ssl_cert_file = None
                auth_method = XendAPI.AUTH_NONE
                hosts_allowed = None
                
                host_addr = server_cfg[0].split(':', 1)
                if len(host_addr) == 1:
                    if host_addr[0].lower() == 'unix':
                        use_tcp = False
                        host = 'localhost'
                        port = 0
                    else:
                        use_tcp = True
                        host = ''
                        port = int(host_addr[0])
                else:
                    use_tcp = True
                    host = str(host_addr[0])
                    port = int(host_addr[1])

                if len(server_cfg) > 1:
                    if server_cfg[1] in [XendAPI.AUTH_PAM, XendAPI.AUTH_NONE]:
                        auth_method = server_cfg[1]

                if len(server_cfg) > 2 and len(server_cfg[2]):
                    hosts_allowed = map(re.compile, server_cfg[2].split(' '))

                if len(server_cfg) > 4:
                    # SSL key and cert file
                    ssl_key_file = server_cfg[3]
                    ssl_cert_file = server_cfg[4]


                servers.add(XMLRPCServer(auth_method, True, use_tcp = use_tcp,
                                         ssl_key_file = ssl_key_file,
                                         ssl_cert_file = ssl_cert_file,
                                         host = host, port = port,
                                         path = XEN_API_SOCKET,
                                         hosts_allowed = hosts_allowed))

        except (ValueError, TypeError), exn:
            log.exception('Xen API Server init failed')
            log.error('Xen-API server configuration %s is invalid.', api_cfg)
开发者ID:a2k2,项目名称:xen-unstable,代码行数:59,代码来源:SrvServer.py


示例7: recover_migrate

 def recover_migrate(self, deviceConfig, network, dst, step, domName):
     """@see DevContoller.recover_migrate"""
     if network:
         tool = xoptions.get_external_migration_tool()
         if tool != "":
             log.info("Request to recover network-migrated device. last good step=%d.", step)
             fd = os.popen("%s -type vtpm -step %d -host %s -domname %s -recover" % (tool, step, dst, domName), "r")
     return 0
开发者ID:Hearen,项目名称:OnceServer,代码行数:8,代码来源:tpmif.py


示例8: getDeviceDetails

    def getDeviceDetails(self,config):
        """@see DevController.getDeviceDetails"""

        back = {}
        front = {}
        devid = 1
        log.info('fb back :%s',back)
	log.info('fb front:%s',front)
        return (devid, back, front)
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:9,代码来源:fbif.py


示例9: getDeviceDetails

    def getDeviceDetails(self, config):
        """@see DevController.getDeviceDetails"""

        back = {"ssa": "%i" % ssa_default}
        devid = 1
        front = {"virtual-device": "%i" % devid}
        log.info("kpp back :%s", back)
        log.info("kpp front:%s", front)
        return (devid, back, front)
开发者ID:ryos36,项目名称:xen-arm,代码行数:9,代码来源:kppif.py


示例10: getDeviceDetails

    def getDeviceDetails(self,config):

        back = {}
        front = {}
        devid = 977
        front = { 'virtual-device' : "%i" % devid }
        log.info('sback :%s',back)
        log.info('sfront:%s',front)
        return (devid, back, front)
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:9,代码来源:sif.py


示例11: domain_pause

 def domain_pause(self, domid):
     """Pause domain execution."""
     try:
         dominfo = self.domain_lookup_by_name_or_id_nr(domid)
         if not dominfo:
             raise XendInvalidDomain(str(domid))
         log.info("Domain %s (%d) paused.", dominfo.getName(),
                  dominfo.getDomid())
         return dominfo.pause()
     except Exception, ex:
         raise XendError(str(ex))
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:11,代码来源:XendDomain.py


示例12: slurp

def slurp(infile):
    while 1:
        line = infile.readline()
        if line == "":
            break
        else:
            line = line.strip()
            m = re.match(r"^ERROR: (.*)", line)
            if m is None:
                log.info('%s', line)
            else:
                log.error('%s', m.group(1))
开发者ID:Angel666,项目名称:android_hardware_intel,代码行数:12,代码来源:XendCheckpoint.py


示例13: signalDeviceModel

    def signalDeviceModel(self, cmd, ret, par = None, timeout = True):
        if self.device_model is None:
            return
        # Signal the device model to for action
        if cmd is '' or ret is '':
            raise VmError('need valid command and result when signal device model')

        count = 0
        while True:
            orig_state = xstransact.Read("/local/domain/0/device-model/%i/state"
                                % self.vm.getDomid())
            # This can occur right after start-up
            if orig_state != None:
                break

            log.debug('signalDeviceModel: orig_state is None, retrying')

            time.sleep(0.1)
            count += 1
            if count < 100:
                continue

            raise VmError('Device model isn\'t ready for commands')

        if par is not None:
            xstransact.Store("/local/domain/0/device-model/%i"
                             % self.vm.getDomid(), ('parameter', par))

        xstransact.Store("/local/domain/0/device-model/%i"
                         % self.vm.getDomid(), ('command', cmd))
        # Wait for confirmation.  Could do this with a watch but we'd
        # still end up spinning here waiting for the watch to fire. 
        state = ''
        count = 0
        while state != ret:
            state = xstransact.Read("/local/domain/0/device-model/%i/state"
                                    % self.vm.getDomid())
            if state == 'error':
                msg = ("The device model returned an error: %s"
                      % xstransact.Read("/local/domain/0/device-model/%i/error"
                                        % self.vm.getDomid()))
                raise VmError(msg)

            time.sleep(0.1)
            if timeout:
                count += 1
                if count > 100:
                    raise VmError('Timed out waiting for device model action')

        #resotre orig state
        xstransact.Store("/local/domain/0/device-model/%i"
                         % self.vm.getDomid(), ('state', orig_state))
        log.info("signalDeviceModel:restore dm state to %s", orig_state)
开发者ID:changliwei,项目名称:suse_xen,代码行数:53,代码来源:image.py


示例14: run

    def run(self):
        authmsg = (self.auth == XendAPI.AUTH_NONE and 
                   "; authentication has been disabled for this server." or
                   ".")

        try:
            if self.use_tcp:
                using_ssl = self.ssl_key_file and self.ssl_cert_file

                log.info("Opening %s XML-RPC server on %s%d%s",
                         using_ssl and 'HTTPS' or 'TCP',
                         self.host and '%s:' % self.host or
                         'all interfaces, port ',
                         self.port, authmsg)
#                 #sync vms and hosts' status send message
#                 from xen.xend import RunSend
#                 RunSend.main()
#                 
#                 #the follow file was import by shixisheng_cxx
#                 from xen.xend import P_DataCollect
#                 P_DataCollect.main()
                

                if using_ssl:
                    if not ssl_enabled:
                        raise ValueError("pyOpenSSL not installed. "
                                         "Unable to start HTTPS XML-RPC server")
                    self.server = SSLXMLRPCServer(
                        (self.host, self.port),
                        self.hosts_allowed,
                        self.xenapi is not None,
                        logRequests = False,
                        ssl_key_file = self.ssl_key_file,
                        ssl_cert_file = self.ssl_cert_file)
                else:
                    self.server = TCPXMLRPCServer(
                        (self.host, self.port),
                        self.hosts_allowed,
                        self.xenapi is not None,
                        logRequests = False)

            else:
                log.info("Opening Unix domain socket XML-RPC server on %s%s",
                         self.path, authmsg)
                self.server = UnixXMLRPCServer(self.path, self.hosts_allowed,
                                               self.xenapi is not None,
                                               logRequests = False)
        except socket.error, exn:
            log.error('Cannot start server: %s!', exn.args[1])
            ready = True
            running = False
            return
开发者ID:Hearen,项目名称:OnceServer,代码行数:52,代码来源:XMLRPCServer.py


示例15: getDeviceDetails

 def getDeviceDetails(self, config):
     log.debug("vbfs config=" + sxp.to_string(config))
     luns = sxp.child_value(config, "luns")
     if not luns:
         log.debug("vbfs: luns param not set")
         raise VmError("luns param not set")
     back = {"luns": luns}
     #        devid = self.allocateDeviceID()
     devid = 1
     front = {"virtual-device": "%i" % devid}
     log.info("bfsback :%s", back)
     log.info("bfsfront:%s", front)
     return (devid, back, front)
开发者ID:ryos36,项目名称:xen-arm,代码行数:13,代码来源:bfsif.py


示例16: run

    def run(self, status):
        try:
            log.info("Xend Daemon started")

            xc = xen.lowlevel.xc.xc()
            xinfo = xc.xeninfo()
            log.info("Xend changeset: %s.", xinfo['xen_changeset'])
            del xc

            try:
                from xen import VERSION
                log.info("Xend version: %s", VERSION)
            except ImportError:
                log.info("Xend version: Unknown.")

            relocate.listenRelocation()
            servers = SrvServer.create()
            servers.start(status)
            del servers
            
        except Exception, ex:
            print >>sys.stderr, 'Exception starting xend:', ex
            if XEND_DEBUG:
                traceback.print_exc()
            log.exception("Exception starting xend (%s)" % ex)
            if status:
                status.write('1')
                status.close()
            sys.exit(1)
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:29,代码来源:SrvDaemon.py


示例17: recover_migrate

 def recover_migrate(self, deviceConfig, network, dst, step, domName):
     """ Recover from device migration. The given step was the
         last one that was successfully executed.
     """
     tool = xoptions.get_external_migration_tool()
     if tool:
         log.info("Calling external migration tool")
         fd = os.popen("%s -type %s -step %d -host %s -domname %s -recover" %
                       (tool, self.deviceClass, step, dst, domName))
         for line in fd:
             log.info(line.rstrip())
         rc = fd.close()
         if rc:
             raise VmError('Migration tool returned %d' % (rc >> 8))
     return 0
开发者ID:mikesun,项目名称:xen-cow-checkpointing,代码行数:15,代码来源:DevController.py


示例18: getDeviceDetails

    def getDeviceDetails(self, config):
        """@see DevController.getDeviceDetails"""

        devid = self.allocateDeviceID()
        inst = int(sxp.child_value(config, 'pref_instance', '-1'))
        if inst == -1:
            inst = int(sxp.child_value(config, 'instance' , '0'))

        log.info("The domain has a TPM with instance %d and devid %d.",
                 inst, devid)
        back  = { 'pref_instance' : "%i" % inst,
                  'resume'        : "%s" % (self.vm.getResume()) }
        front = { 'handle' : "%i" % devid }

        return (devid, back, front)
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:15,代码来源:tpmif.py


示例19: configure

    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig['platform'].get('loader')

        info = xc.xeninfo()
        if 'hvm' not in info['xen_caps']:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig['platform'].get('xen_platform_pci',1))
        rtc_timeoffset = vmConfig['platform'].get('rtc_timeoffset')

        if not self.display :
            self.display = ''

        store_dmargs = [ x for x in self.dmargs
                         if x not in ['-sdl', '-disable-opengl'] ]
        try :
            midx = store_dmargs.index('-monitor')
            store_dmargs[midx + 1] = 'pty'
        except ValueError :
            pass
        self.vm.storeVm(("image/dmargs", " ".join(store_dmargs)),
                        ("image/device-model", self.device_model),
                        ("image/display", self.display))
        self.vm.permissionsVm("image/dmargs", { 'dom': self.vm.getDomid(), 'read': True } )

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())

        xstransact.Store("/local/domain/0/device-model/%i"%self.vm.getDomid(),
                                      ('disable_pf', disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", { 'dom': self.vm.getDomid(), 'read': True } )

        self.apic = int(vmConfig['platform'].get('apic', 0))
        self.acpi = int(vmConfig['platform'].get('acpi', 0))
        self.extid = int(vmConfig['platform'].get('extid', 0))
        self.guest_os_type = vmConfig['platform'].get('guest_os_type')
        self.memory_sharing = int(vmConfig['memory_sharing'])
        try:
            xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
        except:
            pass
开发者ID:changliwei,项目名称:suse_xen,代码行数:48,代码来源:image.py


示例20: configure

    def configure(self, vmConfig):
        ImageHandler.configure(self, vmConfig)

        self.loader = vmConfig["platform"].get("loader")

        info = xc.xeninfo()
        if "hvm" not in info["xen_caps"]:
            raise HVMRequired()

        xen_platform_pci = int(vmConfig["platform"].get("xen_platform_pci", 1))
        rtc_timeoffset = vmConfig["platform"].get("rtc_timeoffset")

        if not self.display:
            self.display = ""

        store_dmargs = [x for x in self.dmargs if x not in ["-sdl", "-disable-opengl"]]
        try:
            midx = store_dmargs.index("-monitor")
            store_dmargs[midx + 1] = "pty"
        except ValueError:
            pass
        self.vm.storeVm(
            ("image/dmargs", " ".join(store_dmargs)),
            ("image/device-model", self.device_model),
            ("image/display", self.display),
        )
        self.vm.permissionsVm("image/dmargs", {"dom": self.vm.getDomid(), "read": True})

        if xen_platform_pci == 0:
            disable_pf = 1
            log.info("No need to create platform device.[domid:%d]", self.vm.getDomid())
        else:
            disable_pf = 0
            log.info("Need to create platform device.[domid:%d]", self.vm.getDomid())

        xstransact.Store("/local/domain/0/device-model/%i" % self.vm.getDomid(), ("disable_pf", disable_pf))
        self.vm.storeVm(("rtc/timeoffset", rtc_timeoffset))
        self.vm.permissionsVm("rtc/timeoffset", {"dom": self.vm.getDomid(), "read": True})

        self.apic = int(vmConfig["platform"].get("apic", 0))
        self.acpi = int(vmConfig["platform"].get("acpi", 0))
        self.guest_os_type = vmConfig["platform"].get("guest_os_type")
        self.memory_sharing = int(vmConfig["memory_sharing"])
        try:
            xc.dom_set_memshr(self.vm.getDomid(), self.memory_sharing)
        except:
            pass
开发者ID:raininja,项目名称:android_hardware_intel,代码行数:47,代码来源:image.py



注:本文中的xen.xend.XendLogging.log.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python DevController.DevController类代码示例发布时间:2022-05-26
下一篇:
Python log.exception函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap