qm: move disk related commands to own group

set aliases for the previous ones for backward compat.

There's still cleanup potential, e.g., for snapshots, but to do that
nicely we may need (or want) to extend CLIHandler to accept commands
without fixed params also on the command group itself.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-11-07 14:43:25 +01:00
parent 10ff4fe745
commit e79cf17d8d

View File

@ -903,10 +903,6 @@ our $cmddef = {
set => [ "PVE::API2::Qemu", 'update_vm', ['vmid'], { %node } ], set => [ "PVE::API2::Qemu", 'update_vm', ['vmid'], { %node } ],
resize => [ "PVE::API2::Qemu", 'resize_vm', ['vmid', 'disk', 'size'], { %node } ],
'move-disk' => [ "PVE::API2::Qemu", 'move_vm_disk', ['vmid', 'disk', 'storage'], { %node }, $upid_exit ],
move_disk => { alias => 'move-disk' },
unlink => [ "PVE::API2::Qemu", 'unlink', ['vmid'], { %node } ], unlink => [ "PVE::API2::Qemu", 'unlink', ['vmid'], { %node } ],
config => [ "PVE::API2::Qemu", 'vm_config', ['vmid'], { %node }, sub { config => [ "PVE::API2::Qemu", 'vm_config', ['vmid'], { %node }, sub {
@ -954,8 +950,19 @@ our $cmddef = {
unlock => [ __PACKAGE__, 'unlock', ['vmid']], unlock => [ __PACKAGE__, 'unlock', ['vmid']],
# FIXME: should this be in a 'disk' command group with move and resize and import? # TODO: evluate dropping below aliases for 8.0, if no usage is left
rescan => [ __PACKAGE__, 'rescan', []], importdisk => { alias => 'disk import' },
'move-disk' => { alias => 'disk move' },
move_disk => { alias => 'disk move' },
rescan => { alias => 'disk rescan' },
resize => { alias => 'disk resize' },
disk => {
import => [ __PACKAGE__, 'importdisk', ['vmid', 'source', 'storage']],
'move' => [ "PVE::API2::Qemu", 'move_vm_disk', ['vmid', 'disk', 'storage'], { %node }, $upid_exit ],
rescan => [ __PACKAGE__, 'rescan', []],
resize => [ "PVE::API2::Qemu", 'resize_vm', ['vmid', 'disk', 'size'], { %node } ],
},
monitor => [ __PACKAGE__, 'monitor', ['vmid']], monitor => [ __PACKAGE__, 'monitor', ['vmid']],
@ -974,8 +981,6 @@ our $cmddef = {
terminal => [ __PACKAGE__, 'terminal', ['vmid']], terminal => [ __PACKAGE__, 'terminal', ['vmid']],
importdisk => [ __PACKAGE__, 'importdisk', ['vmid', 'source', 'storage']],
importovf => [ __PACKAGE__, 'importovf', ['vmid', 'manifest', 'storage']], importovf => [ __PACKAGE__, 'importovf', ['vmid', 'manifest', 'storage']],
cleanup => [ __PACKAGE__, 'cleanup', ['vmid', 'clean-shutdown', 'guest-requested'], { %node }], cleanup => [ __PACKAGE__, 'cleanup', ['vmid', 'clean-shutdown', 'guest-requested'], { %node }],