Changeset 35675 in vbox for trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
- Timestamp:
- Jan 24, 2011 2:22:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r35569 r35675 52 52 'green':'\033[92m', 53 53 'yellow':'\033[93m', 54 'magenta':'\033[35m' 54 'magenta':'\033[35m', 55 'cyan':'\033[36m' 55 56 } 56 57 def colored(string,color): … … 204 205 def colSize(ctx,m): 205 206 return colored(m, 'red') 207 208 def colPci(ctx,vm): 209 return colored(vm, 'green') 210 211 def colDev(ctx,vm): 212 return colored(vm, 'cyan') 206 213 207 214 def colSizeM(ctx,m): … … 3075 3082 dur = float(args[3]) 3076 3083 cmdExistingVm(ctx, mach, 'guestlambda', [lambda ctx,mach,console,args: playbackDemo(ctx, console, filename, dur)]) 3084 return 0 3085 3086 3087 def pciAddr(ctx,addr): 3088 str = "%d:%d.%d" %(addr >> 8, (addr & 0xff) >> 3, addr & 7) 3089 return colPci(ctx, str) 3090 3091 def lspci(ctx, console): 3092 assigned = ctx['global'].getArray(console.machine, 'pciDeviceAssignments') 3093 for a in assigned: 3094 if a.isPhysicalDevice: 3095 print "%s: assigned host device %s" %(colDev(ctx, a.name), pciAddr(ctx, a.hostAddress)) 3096 3097 atts = ctx['global'].getArray(console, 'attachedPciDevices') 3098 for a in atts: 3099 if a.isPhysicalDevice: 3100 print "%s: physical, guest %s, host %s" %(colDev(a.name), pciAddr(ctx, a.guestAddress), pciAddr(ctx, a.hostAddress)) 3101 else: 3102 print "%s: virtual, guest %s" %(colDev(ctx, a.name), pciAddr(ctx, a.guestAddress)) 3103 return 3104 3105 3106 def lspciCmd(ctx, args): 3107 if (len(args) < 2): 3108 print "usage: lspci vm" 3109 return 0 3110 mach = argsToMach(ctx,args) 3111 if mach == None: 3112 return 0 3113 cmdExistingVm(ctx, mach, 'guestlambda', [lambda ctx,mach,console,args: lspci(ctx, console)]) 3077 3114 return 0 3078 3115 … … 3158 3195 'nat':['NAT (network address translation engine) manipulation, nat help for more info', natCmd, 0], 3159 3196 'nic' : ['Network adapter management', nicCmd, 0], 3160 'prompt' : ['Control prompt', promptCmd, 0],3197 'prompt' : ['Control shell prompt', promptCmd, 0], 3161 3198 'foreachvm' : ['Perform command for each VM', foreachvmCmd, 0], 3162 3199 'foreach' : ['Generic "for each" construction, using XPath-like notation: foreach //vms/vm[@OSTypeId=\'MacOS\'] "print obj.name"', foreachCmd, 0], 3163 3200 'recordDemo':['Record demo: recordDemo Win32 file.dmo 10', recordDemoCmd, 0], 3164 'playbackDemo':['Playback demo: playbackDemo Win32 file.dmo 10', playbackDemoCmd, 0] 3201 'playbackDemo':['Playback demo: playbackDemo Win32 file.dmo 10', playbackDemoCmd, 0], 3202 'lspci': ['List PCI devices attached to the VM: lspci Win32', lspciCmd] 3165 3203 } 3166 3204
Note:
See TracChangeset
for help on using the changeset viewer.