Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-13 Thread Michal Privoznik
On 12.06.2014 15:13, Laine Stump wrote: On 06/05/2014 06:39 PM, Michal Privoznik wrote: + +/* Workaround broken kernel API. If the link is unplugged then + * depending on the NIC driver, link speed can be reported as -1. + * However, the value is printed out as unsigned i

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-12 Thread Laine Stump
On 06/05/2014 06:39 PM, Michal Privoznik wrote: > + > +/* Workaround broken kernel API. If the link is unplugged then > + * depending on the NIC driver, link speed can be reported as -1. > + * However, the value is printed out as unsigned integer instead of > + * sig

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-11 Thread Eric Blake
On 06/11/2014 03:19 AM, Michal Privoznik wrote: >>> +{ >>> +int ret = -1; >>> +char *path = NULL; >>> +char *buf = NULL; >>> +char *tmp; >>> +int tmp_state; >> >> s/int/virInterfaceState/ >> > > In fact this is intentional. Remember Eric's TypeFromString() patches? > The probl

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-11 Thread Daniel P. Berrange
On Wed, Jun 11, 2014 at 05:41:11PM +0200, Michal Privoznik wrote: > On 11.06.2014 11:19, Michal Privoznik wrote: > >> > >>Seems we should be able to set up a dummy /sys/class/net environment in > >>order to test the new API's... Something I attempted with my recently > >>posted scsi_host changes.

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-11 Thread Michal Privoznik
On 11.06.2014 11:19, Michal Privoznik wrote: Seems we should be able to set up a dummy /sys/class/net environment in order to test the new API's... Something I attempted with my recently posted scsi_host changes. Yeah, unit testing is certainly in place. But honestly, I thought it would blow

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-11 Thread Michal Privoznik
On 11.06.2014 03:13, John Ferlan wrote: On 06/05/2014 11:39 AM, Michal Privoznik wrote: The purpose of this function is to fetch link state and link speed for given NIC name from the SYSFS. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virnetdev.c | 10

Re: [libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-10 Thread John Ferlan
On 06/05/2014 11:39 AM, Michal Privoznik wrote: > The purpose of this function is to fetch link state > and link speed for given NIC name from the SYSFS. > > Signed-off-by: Michal Privoznik > --- > src/libvirt_private.syms | 1 + > src/util/virnetdev.c | 104 > ++

[libvirt] [PATCH v2 2/4] virnetdev: Introduce virNetDevGetLinkInfo

2014-06-05 Thread Michal Privoznik
The purpose of this function is to fetch link state and link speed for given NIC name from the SYSFS. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virnetdev.c | 104 +++ src/util/virnetdev.h | 6 +++ 3 files