[pve-devel] [PATCH v3 qemu-server 07/19] cli: use guesthelper for pending
Oguz Bektas
o.bektas at proxmox.com
Mon Oct 14 10:28:39 CEST 2019
use the shared format_pending method from guesthelpers
Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
PVE/CLI/qm.pm | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index 17935d0..2f1969a 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -898,33 +898,7 @@ our $cmddef = {
}
}],
- pending => [ "PVE::API2::Qemu", 'vm_pending', ['vmid'],
- { node => $nodename }, sub {
- my $data = shift;
- foreach my $item (sort { $a->{key} cmp $b->{key}} @$data) {
- my $k = $item->{key};
- next if $k eq 'digest';
- my $v = $item->{value};
- my $p = $item->{pending};
- if ($k eq 'description') {
- $v = PVE::Tools::encode_text($v) if defined($v);
- $p = PVE::Tools::encode_text($p) if defined($p);
- }
- if (defined($v)) {
- if ($item->{delete}) {
- print "del $k: $v\n";
- } elsif (defined($p)) {
- print "cur $k: $v\n";
- print "new $k: $p\n";
- } else {
- print "cur $k: $v\n";
- }
- } elsif (defined($p)) {
- print "new $k: $p\n";
- }
- }
- }],
-
+ pending => [ "PVE::API2::Qemu", 'vm_pending', ['vmid'], { node => $nodename }, \&PVE::GuestHelpers::format_pending ],
showcmd => [ __PACKAGE__, 'showcmd', ['vmid']],
status => [ __PACKAGE__, 'status', ['vmid']],
--
2.20.1
More information about the pve-devel
mailing list