From 8e1c69c9a40924e9a19b2eb2999da756121cfe29 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 23 May 2017 18:16:19 +0200 Subject: [PATCH] + Fix hyperv nodesnapshot mode --- apps/hyperv/2012/local/mode/nodesnapshot.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/hyperv/2012/local/mode/nodesnapshot.pm b/apps/hyperv/2012/local/mode/nodesnapshot.pm index 562debc54..91dc6fde3 100644 --- a/apps/hyperv/2012/local/mode/nodesnapshot.pm +++ b/apps/hyperv/2012/local/mode/nodesnapshot.pm @@ -113,7 +113,7 @@ sub manage_selection { #[checkpointCreationTime= 1475503073.81975 ][type= backing] $self->{vm} = {}; - my $id = 1; + my ($id, $time) = (1, time()); while ($stdout =~ /^\[name=\s*(.*?)\s*\]\[state=\s*(.*?)\s*\]\[note=\s*(.*?)\s*\](.*?)(?=\[name=|\z)/msig) { my ($name, $status, $note, $content) = ($1, $2, $3, $4); my %chkpt = (backing => -1, snapshot => -1); @@ -139,8 +139,8 @@ sub manage_selection { } $self->{vm}->{$id} = { display => $name, - snapshot => $chkpt{snapshot} > 0 ? $time() - $chkpt{snapshot} : undef, - backing => $chkpt{backing} > 0 ? $time() - $chkpt{backing} : undef }; + snapshot => $chkpt{snapshot} > 0 ? $time - $chkpt{snapshot} : undef, + backing => $chkpt{backing} > 0 ? $time - $chkpt{backing} : undef }; $id++; } }