Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-11 Thread Luyao Huang
On 03/10/2015 06:50 PM, John Ferlan wrote: On 03/10/2015 06:03 AM, lhuang wrote: ...snip... Interesting idea, but you'd be just throwing things away. I could perhaps having some code periodically cache addresses... or cache addresses, subscribe to some event to let you know when a new

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-10 Thread lhuang
On 03/10/2015 07:50 AM, John Ferlan wrote: On 03/09/2015 11:37 AM, Luyao Huang wrote: On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-10 Thread John Ferlan
On 03/10/2015 06:03 AM, lhuang wrote: ...snip... Interesting idea, but you'd be just throwing things away. I could perhaps having some code periodically cache addresses... or cache addresses, subscribe to some event to let you know when a new address is generated so you can add it to your

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread Luyao Huang
On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and virNetDevGetIPv4Address to get IP address.

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread John Ferlan
On 03/09/2015 03:35 AM, lhuang wrote: ...snip... I think once you have an address you just return the first one found and document it that way avoiding this path completely. You could also note that if you want a specific address use the type='address' Hmm, yes, I agree it is not a

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread John Ferlan
On 03/09/2015 11:37 AM, Luyao Huang wrote: On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread lhuang
On 03/10/2015 07:44 AM, John Ferlan wrote: On 03/09/2015 03:35 AM, lhuang wrote: ...snip... I think once you have an address you just return the first one found and document it that way avoiding this path completely. You could also note that if you want a specific address use the

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-09 Thread lhuang
On 03/09/2015 07:50 AM, John Ferlan wrote: On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and virNetDevGetIPv4Address to get IP address.

Re: [libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-03-08 Thread John Ferlan
On 02/28/2015 04:08 AM, Luyao Huang wrote: Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and virNetDevGetIPv4Address to get IP address. Signed-off-by: Luyao Huang lhu...@redhat.com

[libvirt] [PATCHv2 1/4] util: introduce 2 new helpers for get interface IPv6 address

2015-02-28 Thread Luyao Huang
Introduce virNetDevGetIfaddrsAddress to help to get interface IPv6 and IPv4 address. Introduce virNetDevGetIPAddress to use virNetDevGetIfaddrsAddress and virNetDevGetIPv4Address to get IP address. Signed-off-by: Luyao Huang lhu...@redhat.com --- v2: add a new function virNetDevGetIPAddress to