From e79cf17d8de23cc9aff6407c51b8672286dceb3e Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 7 Nov 2022 14:43:25 +0100 Subject: [PATCH] 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 --- PVE/CLI/qm.pm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index dc629b1e..240e87f8 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -903,10 +903,6 @@ our $cmddef = { 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 } ], config => [ "PVE::API2::Qemu", 'vm_config', ['vmid'], { %node }, sub { @@ -954,8 +950,19 @@ our $cmddef = { unlock => [ __PACKAGE__, 'unlock', ['vmid']], - # FIXME: should this be in a 'disk' command group with move and resize and import? - rescan => [ __PACKAGE__, 'rescan', []], + # TODO: evluate dropping below aliases for 8.0, if no usage is left + 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']], @@ -974,8 +981,6 @@ our $cmddef = { terminal => [ __PACKAGE__, 'terminal', ['vmid']], - importdisk => [ __PACKAGE__, 'importdisk', ['vmid', 'source', 'storage']], - importovf => [ __PACKAGE__, 'importovf', ['vmid', 'manifest', 'storage']], cleanup => [ __PACKAGE__, 'cleanup', ['vmid', 'clean-shutdown', 'guest-requested'], { %node }],