dom0/qvm-start: starting with drive connected temporarily
This commit is contained in:
parent
724c032005
commit
8f27fd49c7
@ -37,6 +37,8 @@ def main():
|
|||||||
help="Do not start the GUId (ignored)")
|
help="Do not start the GUId (ignored)")
|
||||||
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
|
||||||
help="Attach debugging console to the newly started VM")
|
help="Attach debugging console to the newly started VM")
|
||||||
|
parser.add_option ("--drive", dest="drive", default=None,
|
||||||
|
help="Temporarily attach specified drive as CD/DVD")
|
||||||
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
|
||||||
help="Do actions necessary when preparing DVM image")
|
help="Do actions necessary when preparing DVM image")
|
||||||
|
|
||||||
@ -55,6 +57,13 @@ def main():
|
|||||||
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if options.drive:
|
||||||
|
if hasattr(vm, 'drive'):
|
||||||
|
vm.drive = options.drive
|
||||||
|
else:
|
||||||
|
print >> sys.stderr, "This VM does not support attaching drives"
|
||||||
|
exit (1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vm.verify_files()
|
vm.verify_files()
|
||||||
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)
|
xid = vm.start(debug_console=options.debug_console, verbose=options.verbose, preparing_dvm=options.preparing_dvm)
|
||||||
|
Loading…
Reference in New Issue
Block a user