VirtualBox

Changeset 19602 in vbox


Ignore:
Timestamp:
May 12, 2009 10:33:51 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47175
Message:

Python Shell: update remove command with HDD detach code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/shellcommon.py

    r19320 r19602  
    154154    print "created machine with UUID",mach.id
    155155    vb.registerMachine(mach)
     156    session.close()
    156157
    157158def removeVm(ctx,mach):
    158159    mgr = ctx['mgr']
    159160    vb = ctx['vb']
    160     print "removing machine ",mach.name,"with UUID",mach.id
    161     mach = vb.unregisterMachine(mach.id)
     161    id = mach.id
     162    print "removing machine ",mach.name,"with UUID",id
     163    session = ctx['mgr'].getSessionObject(vb)
     164    vb.openSession(session, id)
     165    mach=session.machine
     166    for d in mach.getHardDiskAttachments():
     167        mach.detachHardDisk(d.controller, d.port, d.device)
     168    session.close()
     169    mach = vb.unregisterMachine(id)
    162170    if mach:
    163171         mach.deleteSettings()
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette