[XEND] Keep track of attached vbds and vifs for XenAPI

Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
Alastair Tse committed 2006-10-06 12:30:46 +01:00
1 parent 5b9963f11b
commit 41bd30a5b4
2 files changed
+11 -2

No files matched your search

+3 -1
View File
@@ -833,7 +833,9 @@ class XendAPI:
def vm_get_by_label(self, session, label):
xendom = XendDomain.instance()
dom = xendom.domain_lookup_nr(label)
return xen_api_success(dom.get_uuid())
if dom:
return xen_api_success(dom.get_uuid())
return xen_api_error(XEND_ERROR_VM_INVALID)
def vm_create(self, session, vm_struct):
xendom = XendDomain.instance()
domuuid = xendom.create_domain(vm_struct)
+8 -1
View File
@@ -726,7 +726,10 @@ class XendConfig(dict):
raise XendConfigError("XendConfig: device_add requires some "
"config.")
log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
if cfg_sxp:
log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
if cfg_xenapi:
log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
if cfg_sxp:
config = sxp.child0(cfg_sxp)
@@ -743,6 +746,8 @@ class XendConfig(dict):
dev_uuid = dev_info.get('uuid', uuid.createString())
dev_info['uuid'] = dev_uuid
self['device'][dev_uuid] = (dev_type, dev_info)
if dev_type in ('vif', 'vbd'):
self['%s_refs' % dev_type].append(dev_uuid)
return dev_uuid
if cfg_xenapi:
@@ -761,6 +766,7 @@ class XendConfig(dict):
dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
dev_info['uuid'] = dev_uuid
self['device'][dev_uuid] = (dev_type, dev_info)
self['vif_refs'].append(dev_uuid)
return dev_uuid
elif dev_type == 'vbd':
@@ -774,6 +780,7 @@ class XendConfig(dict):
dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
dev_info['uuid'] = dev_uuid
self['device'][dev_uuid] = (dev_type, dev_info)
self['vbd_refs'].append(dev_uuid)
return dev_uuid
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.