[pve-devel] [PATCH v2 qemu-server 07/18] use format_pending from GuestHelpers for 'qm pending' command
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Oct 2 11:57:40 CEST 2019
On 9/30/19 2:44 PM, Oguz Bektas wrote:
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht 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']],
>
More information about the pve-devel
mailing list