Skip to content

Commit

Permalink
qvm-template*: Add option to specify pool to store created VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyPillow committed Jul 29, 2020
1 parent ef59a65 commit 90e4f65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions qubesadmin/tools/qvm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def qubes_release():
help='Disable signature checks.')
parser.add_argument('--allow-pv', action='store_true',
help='Allow setting virt_mode to pv in configuration file.')
parser.add_argument('--pool',
help='Specify pool to store created VMs in.')
# qvm-template download
parser.add_argument('--downloaddir', default='.',
help='Override download directory.')
Expand Down Expand Up @@ -228,6 +230,8 @@ def install(args, app, version_selector=VersionSelector.LATEST,
]
if args.allow_pv:
cmdline.append('--allow-pv')
if args.pool:
cmdline += ['--pool', args.pool]
subprocess.check_call(cmdline + [
'post-install',
name,
Expand Down
5 changes: 4 additions & 1 deletion qubesadmin/tools/qvm_template_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
help='Do not set installed_by_rpm')
parser.add_argument('--allow-pv', action='store_true',
help='Allow setting virt_mode to pv in configuration file.')
parser.add_argument('--pool',
help='Specify pool to store created VMs in.')
parser.add_argument('action', choices=['post-install', 'pre-remove'],
help='Action to perform')
parser.add_argument('name', action='store',
Expand Down Expand Up @@ -259,7 +261,8 @@ def post_install(args):

vm = app.add_new_vm('TemplateVM',
name=args.name,
label=qubesadmin.config.defaults['template_label'])
label=qubesadmin.config.defaults['template_label'],
pool=args.pool)
vm_created = True

vm.log.info('Importing data')
Expand Down

0 comments on commit 90e4f65

Please sign in to comment.