[pve-devel] [PATCH qemu-server 1/2] rescan update_disksize: be more verbose

Dietmar Maurer dietmar at proxmox.com
Thu Jul 5 19:53:19 CEST 2018



> On July 5, 2018 at 5:00 PM Thomas Lamprecht <t.lamprecht at proxmox.com> wrote:
> 
> 
> On 7/5/18 4:43 PM, Dietmar Maurer wrote:
> > What is the purpose of the print wrapper function?
> > 
> >> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> >> index 5829e4c..90bf745 100644
> >> --- a/PVE/QemuServer.pm
> >> +++ b/PVE/QemuServer.pm
> >> @@ -5539,6 +5539,8 @@ sub update_disksize {
> >>  
> >>      my $changes;
> >>  
> >> +    my $print = sub { print "VM $vmid: $_[0]\n"; };
> 
> Initially I had a verbose flag turning print on/off, which it implemented.
> I then still left it in as it allows to not repeat "VM $vmid: "
> 
> But it could be removed, it's not called that often..
> And maybe the "VM $vmid: " prefix isn't needed either as
> rescan would now print which VM it checks currently?

Or simply define the prefix for later use?

my $prefix = "VM $vmid";




More information about the pve-devel mailing list