connection: Only fetch interface object in tick when needed

We don't need to look up the interface object ahead of time, only do it
if we appear to have a new interface.
This commit is contained in:
Cole Robinson 2009-11-25 14:56:35 -05:00
parent 22a2a4b57c
commit d0873210a0

View File

@ -897,10 +897,10 @@ class vmmConnection(gobject.GObject):
logging.exception("Unable to list inactive interfaces")
def check_obj(name, is_active):
obj = self.vmm.interfaceLookupByName(name)
key = obj.name()
key = name
if not orig.has_key(key):
obj = self.vmm.interfaceLookupByName(name)
# Object is brand new this tick period
current[key] = vmmInterface(self.config, self, obj, key,
is_active)