git.annexia.org
/
mclu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a44a718
)
mclu: Add --viewer option to mclu start, to start virt-viewer.
author
Richard W.M. Jones
<rjones@redhat.com>
Sat, 10 May 2014 14:44:39 +0000
(15:44 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Sat, 10 May 2014 14:44:39 +0000
(15:44 +0100)
mclu_start.py
patch
|
blob
|
history
diff --git
a/mclu_start.py
b/mclu_start.py
index
1187942
..
50d58c9
100644
(file)
--- a/
mclu_start.py
+++ b/
mclu_start.py
@@
-19,9
+19,11
@@
import argparse
import fnmatch
import re
import argparse
import fnmatch
import re
+import subprocess
import sys
import libvirt
import sys
import libvirt
+import config
import lib
def cmdline (subparsers):
import lib
def cmdline (subparsers):
@@
-30,6
+32,10
@@
def cmdline (subparsers):
help='start virtual machine(s)',
)
p.add_argument (
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'
)
'vms', nargs='+',
help='virtual machine(s) to be started'
)
@@
-53,6
+59,10
@@
def run (c, args, nodes):
started = []
for vm_name in inactive:
if fnmatch.fnmatch (vm_name, wc):
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)
lib.start_guest (c, node, vm_name)
started.append (vm_name)