[pve-devel] [PATCH #1752 pve-manager 1/1] [PATCH #1752 pve-manager] Impl basic wake on LAN

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jan 15 10:56:17 CET 2019


On 1/15/19 9:24 AM, Fabian Grünbichler wrote:
> On Mon, Jan 14, 2019 at 04:24:55PM +0100, Thomas Lamprecht wrote:
>>> +	send($sock, $packet, 0, $to) or die "Unable to send wake on LAN magic packet!\n";
>>> +	close($sock);
>>> +
>>> +	return undef;
>>> +    }});
>>>  
>>>  __PACKAGE__->register_method({
>>>      name => 'rrd', 
>>> diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
>>> index af1c782b..3cc8ba48 100644
>>> --- a/PVE/NodeConfig.pm
>>> +++ b/PVE/NodeConfig.pm
>>> @@ -61,6 +61,12 @@ my $confdesc = {
>>>  	description => 'Node description/comment.',
>>>  	optional => 1,
>>>      },
>>> +    mac => {
>>
>> I'd prefer something like 'wol-mac' as mac is just to general. But currently
>> this config parser does not supports a - separator (only _) so either we settle
>> for wol-mac or allow '-'.
> 
> I'd prefer "wol" or even "wakeonlan", with the MAC as value. that way,
> it is easy to upgrade to a property string if we want to in the future,
> with the MAC as default key inside the property string.

yeah, had that in mind too, but wondered what else could come up here.
Lets do wakeonlan then, leaves no ambiguity.

> 
>> I'd to the latter, if there isn't any reason against it (@Fabian, I guess that
>> there wasn't?)
> 
> none of the existing keys needed a '-' (but then again, neither is there
> a '_' anywhere in sight so far ;)). '_' is a bit nicer as it doesn't
> need to be quoted when accessing hashes in perl, but in PVE the general
> tendency is to avoid either in config keys and just use alphanumeric
> wherever reasonably possible.
> 

OK, in short, there wasn't any reason ;) But if we stick with 'wakeonlan' we
do not need changes here, but I'd like to see those parsers which are almost
identical with the base JSONSchema parse_config, besides comment to
description mapping, unified. But that's probably best to do for another patch
(series) :)





More information about the pve-devel mailing list