[pve-devel] [PATCH pve-manager 1/2] Nodes: wakeonlan return MAC address send via WOL packet

Thomas Lamprecht t.lamprecht at proxmox.com
Sat Jan 19 12:57:11 CET 2019


On 1/18/19 9:45 PM, Fabian Grünbichler wrote:
> On Fri, Jan 18, 2019 at 11:13:08AM +0100, Christian Ebner wrote:
>> The wake on LAN call now returns a string containing the MAC address send in the
>> WOL packet.
>>
>> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
>> ---
>>  PVE/API2/Nodes.pm | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
>> index 7f829b29..2c8bfc35 100644
>> --- a/PVE/API2/Nodes.pm
>> +++ b/PVE/API2/Nodes.pm
>> @@ -485,7 +485,7 @@ __PACKAGE__->register_method({
>>  	    }),
>>  	},
>>      },
>> -    returns => { type => "null" },
>> +    returns => { type => 'string' },
> 
> slight nit: we know that this has a specific format, so why not mention
> it? it's nicer for API users if they don't have to look into the code to
> see whaat string this endpoint returns ;)

+1

> 
> it might make sense to also unify the (now at least three) different
> definitions for MAC addresses:
> 
> pve-manager's NodeConfig.pm
> qemu-server's QemuServer.pm (as part of $net_fmt)
> pve-container's LXC/Config.pm (as part of $netconf_desc)
> 
> they all have different RE's matching the same values, and could be
> replaced with a unified version / standard option in pve-common. only
> the description would need to be overwritten for each use case.
> 
> then this same standard option can also be re-used for the return
> schema (all of the above can also be done as a follow-up series).

FYI, I've already tasked Christian with this on reviewing v2 (or was it
v3) of the wol series, off-list.





More information about the pve-devel mailing list