bitkeeper revision 1.1058 (40ee95423ht4Gq0VKvBW7yu6DP8hZA)

Pass domain name down to vifctl to avoid recursion.
This commit is contained in:
mjw@wray-m-3.hpl.hp.com committed 2004-07-09 12:53:22 +00:00
1 parent ec528e4bf8
commit 8a93d3beb0
2 files changed
+5 -10

No files matched your search

+1 -1
View File
@@ -780,7 +780,7 @@ def vm_dev_vif(vm, val, index):
defer = xend.netif_dev_create(vm.dom, vif, val, recreate=vm.recreate)
def fn(id):
dev = xend.netif_dev(vm.dom, vif)
dev.vifctl('up')
dev.vifctl('up', vmname=vm.name)
vm.add_device('vif', dev)
print 'vm_dev_vif> created', dev
return id
+4 -9
View File
@@ -161,12 +161,9 @@ class NetDev(controller.Dev):
"""
return ':'.join(map(lambda x: "%x" % x, self.mac))
def vifctl_params(self):
from xen.xend import XendDomain
xd = XendDomain.instance()
def vifctl_params(self, vmname=None):
dom = self.controller.dom
dominfo = xd.domain_get(dom)
name = (dominfo and dominfo.name) or ('DOM%d' % dom)
name = vmname or ('DOM%d' % dom)
return { 'domain': name,
'vif' : self.get_vifname(),
'mac' : self.get_mac(),
@@ -174,10 +171,10 @@ class NetDev(controller.Dev):
'script': self.script,
'ipaddr': self.ipaddr, }
def vifctl(self, op):
def vifctl(self, op, vmname=None):
"""Bring the device up or down.
"""
Vifctl.vifctl(op, **self.vifctl_params())
Vifctl.vifctl(op, **self.vifctl_params(vmname=vmname))
def destroy(self):
"""Destroy the device's resources and disconnect from the back-end
@@ -186,7 +183,6 @@ class NetDev(controller.Dev):
def cb_destroy(val):
self.controller.send_be_destroy(self.vif)
self.vifctl('down')
#d = self.controller.factory.addDeferred()
d = defer.Deferred()
d.addCallback(cb_destroy)
self.controller.send_be_disconnect(self.vif, response=d)
@@ -272,7 +268,6 @@ class NetifController(controller.Controller):
def reattach_devices(self):
"""Reattach all devices when the back-end control domain has changed.
"""
#d = self.factory.addDeferred()
self.send_be_create(vif)
self.attach_fe_devices()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.