mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
[XEND] XendVDI saves configuration on change.
Added a base class called AutoSaveObject that will attempt to call save_config() if any attribute in the object changes. It isn't particularly efficient, but we do not expect VDI to change much. Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
1 parent
76b24ff4e2
commit
5d179b7561
2 files changed
+35
-3
No files matched your search
@@ -37,6 +37,7 @@ COMMANDS = {
|
||||
'sr-list': ('', 'List all SRs'),
|
||||
'vbd-create': ('<domname> <pycfg>', 'Create VBD attached to domname'),
|
||||
'vdi-list' : ('', 'List all VDI'),
|
||||
'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
|
||||
'vdi-delete': ('<vdi_uuid>', 'Delete VDI'),
|
||||
'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
|
||||
|
||||
@@ -303,6 +304,17 @@ def xapi_vdi_delete(*args):
|
||||
print 'Deleting VDI %s' % vdi_uuid
|
||||
result = execute(server.VDI.destroy, session, vdi_uuid)
|
||||
print 'Done.'
|
||||
|
||||
def xapi_vdi_rename(*args):
|
||||
server, session = _connect()
|
||||
if len(args) < 2:
|
||||
raise OptionError('Not enough arguments')
|
||||
|
||||
vdi_uuid = args[0]
|
||||
vdi_name = args[1]
|
||||
print 'Renaming VDI %s to %s' % (vdi_uuid, vdi_name)
|
||||
result = execute(server.VDI.set_name_label, session, vdi_uuid, vdi_name)
|
||||
print 'Done.'
|
||||
|
||||
|
||||
#
|
||||
|
||||