[pve-devel] applied: [PATCH pve-network 0/2] improvments

Alexandre DERUMIER aderumier at odiso.com
Tue Jun 11 09:46:21 CEST 2019


>>I have send patches, but I don't have look at PMG currently. (I never have used it to be honest)
>>(I have only move the network configuration part, and was only used in Network API)

I have looked in PMG,

seem that it shouldn't break it (maybe simply need to add a depend on pve-network)

PVE::INotify::read_file('interfaces') is used here, in network api
https://git.proxmox.com/?p=pmg-api.git;a=blob;f=PMG/API2/Network.pm;h=b6a58da73a4752c2cba2398028a14e366343de39;hb=HEAD

adding "use PVE::NetworkConfig"  to register interfaces file should be enough.


Maybe this Network.pm api could be common too, but they are a difference on" use PMG::RESTEnvironment"


----- Mail original -----
De: "aderumier" <aderumier at odiso.com>
À: "Thomas Lamprecht" <t.lamprecht at proxmox.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Vendredi 7 Juin 2019 15:19:48
Objet: Re: [pve-devel] applied: [PATCH pve-network 0/2] improvments

>>seems OK, as said, only thing is that PMG also uses INotify so we need to 
>>ensure it still can without to much hassle... 

I have send patches, but I don't have look at PMG currently. (I never have used it to be honest) 
(I have only move the network configuration part, and was only used in Network API) 


----- Mail original ----- 
De: "Thomas Lamprecht" <t.lamprecht at proxmox.com> 
À: "pve-devel" <pve-devel at pve.proxmox.com>, "aderumier" <aderumier at odiso.com> 
Envoyé: Vendredi 7 Juin 2019 12:13:39 
Objet: Re: [pve-devel] applied: [PATCH pve-network 0/2] improvments 

On 6/7/19 7:11 AM, Alexandre DERUMIER wrote: 
>>> 
>>> As long as we have a clear dependency releationship between the 
>>> packages this could be OK. I.e., probably: 
>>> 
>>> common <- network <----------------- manager 
>>> ^ 
>>> `- qemu-server/container <-/ 
> 
> 
> Hi, 
> I have checked in the code, and they are a lot of small sub in Network.pm 
> called in differents modules 
> 
> ex: 
> 
> Cluster.pm: return PVE::Network::get_ip_from_hostname($nodename, $noerr); 
> LXC/Setup/Base.pm: if ($has_ipv4 && !PVE::Network::is_ip_in_cidr($gw, $d->{ip}, 4)) { 
> Storage/ISCSIPlugin.pm: return PVE::Network::tcp_ping($server, $port || 3260, 2); 
> Firewall.pm:use PVE::Network; 
> Firewall.pm: $mask = $PVE::Network::ipv4_mask_hash_localnet->{$entry->{mask}}; 
> 
> 
> 
> 
> subs in Network.pm are mostly helpers and tools, so I think it's better to keep them in common package. 
> (to avoid cycling depend later). 

Yes, those should be pretty independent too, most do some calls an 
parsing to "ip" only, Wolfgang once though replacing those with using 
the netlink protocol to talk directly with the kernel, but his 
perl-netlink wrapper never went public, yet, so we may want to keep it 
and think about this later, it shouldn't hurt here. 


> 
> Code in Inotify.pm is more related to /etc/network/interfaces generation, so it's better to move that 
> in pve-network. 
> 
> Same for API2/Network.pm, it's only related to config management, can be move to pve-network. 
> 
> what do you think about this ? 
> 

seems OK, as said, only thing is that PMG also uses INotify so we need to 
ensure it still can without to much hassle... 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 




More information about the pve-devel mailing list