159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
+
|
send_command(options.sock, "delvm " + snapshot_id)
else:
if options.snapshot or options.args:
print >>sys.stderr, ("Cannot change qemu options. " +
"VM is already running")
if options.cdrom:
options.file = options.cdrom[0]
options.id = None
cmd_cdrom(options)
if options.gui:
uri = spiceurl(options)
os.system((config.get('tools', 'viewer') + "&") % uri)
elif not options.stopped:
print >>sys.stderr, "VM already running"
|
352
353
354
355
356
357
358
359
360
361
362
363
364
365
|
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
|
+
+
+
+
+
|
answer = send_command(options.sock, "info capture")
match = re.search('\\[(\\d+)\\]: ', answer)
if not match:
print >>sys.stderr, "No sound recording in progress"
sys.exit(1)
else:
print send_command(options.sock, "stopcapture " + match.group(1))
def cmd_sendkey(options):
""" vws sendkey """
print send_command(options.sock,"sendkey "+options.keyspec);
def cmd_version(dummy_options):
""" vws cersion """
print VERSION
def cmd_snapshot(options):
""" vws snapshot - create snapshot """
|
708
709
710
711
712
713
714
715
716
717
718
719
720
721
|
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
|
+
+
|
p = new_command(cmds, 'snapshots', help='List existing snapshots')
# Screenshoits and recording
p = new_command(cmds, 'screenshot', help='take a screenshot')
p.add_argument('filename', help='PPM image filename to write screenshot to')
p = new_command(cmds, 'record', help='Record audio output from VM')
p.add_argument('filename', help='wav file to record autdio to')
new_command(cmds, 'stoprecord', help='stop recording audio')
p = new_command(cmds, 'sendkey', help='Send a keystroke to VM')
p.add_argument('keyspec',help='key specification like ctrl-alt-delete');
# Create new VM
p = new_command(cmds, 'create', help="Create new VW")
p.add_argument("--no-usb", help="Disable USB controller", action='store_const',
const=False, default=True, dest="usb")
p.add_argument("--size", metavar='size', help="Size of primary disk images",
dest="size", default=config.get('create options', 'size'))
p.add_argument("--arch", metavar='cputype', help="Emulated architecture",
|