import argparse
import fnmatch
import re
+import subprocess
import sys
import libvirt
+import config
import lib
def cmdline (subparsers):
help='start virtual machine(s)',
)
p.add_argument (
+ '--viewer', action='store_const', const=True,
+ help='start virt-viewer to show the graphical console'
+ )
+ p.add_argument (
'vms', nargs='+',
help='virtual machine(s) to be started'
)
started = []
for vm_name in inactive:
if fnmatch.fnmatch (vm_name, wc):
+ if args.viewer:
+ subprocess.Popen ([config.VIRT_VIEWER, "-c",
+ node.uri, vm_name],
+ close_fds=True)
lib.start_guest (c, node, vm_name)
started.append (vm_name)