[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] use a special value of -2 for virtual devices to report indeterminate speed?



On 11/18/2011 10:46 AM, Jeremy Fitzhardinge wrote:
On 11/18/2011 10:44 AM, Rick Jones wrote:
  It could I suppose, decide
based on the physical NIC to which it is attached, so long as folks
using the virtual NIC don't expect its attributes to be the same from
system to system.

And assuming there's a physical NIC at all.

It sounds like we need a way to specify "Indeterminate" for link speed? Or some verbiage to that effect. Right now 0 and -1 cause ethtool to report "Unknown!"

        if (speed == 0 || speed == (u16)(-1) || speed == (u32)(-1))
                fprintf(stdout, "Unknown!\n");
        else
                fprintf(stdout, "%uMb/s\n", speed);


How about -2 for the u32 cast value of speed returning "Indeterminate" or something like that? Not in "proper" patch format:

        if (speed == 0 || speed == (u16)(-1) || speed == (u32)(-1))
                fprintf(stdout, "Unknown!\n");
        else if (speed == (u32)(-2))
                fprintf(stdout, "Indeterminate.");
        else
                fprintf(stdout, "%uMb/s\n", speed);

Signed-off-by: Rick Jones <rick.jones2@xxxxxx>    

rick jones

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.