Changeset 597

Show
Ignore:
Timestamp:
05/15/07 17:50:05 (2 years ago)
Author:
chtekk
Message:

Align names in vcc netstatus/limstatus output.
In addition to alphanum, permit - and _ in vserver names.
Update TODO.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/TODO

    r586 r597  
    88NEEDED FEATURES: 
    99- debian/ dir, RPM .spec file, init scripts (done for Gentoo!), distrib make targets, pathprog probably 
    10 - support _ and - in vserver names (needs a new string checking function in Lucid) 
    1110 
    1211WANTED FEATURES: 
    13 - add vx.limits and vx.netload methods to get more info 
    1412- vx.move method to also move the VServer around on the disk 
     13- cpuset support 
    1514- sysctl support 
    16 - cpuset support 
  • trunk/src/vcc/vcc/limstatus.c

    r595 r597  
    5858                xmlrpc_DECREF(result); 
    5959 
    60                 printf("%s - cur: %d, min: %d, max: %d\n", type, cur, min, max); 
     60                printf("%-12s - cur: %d, min: %d, max: %d\n", type, cur, min, max); 
    6161        } 
    6262 
  • trunk/src/vcc/vcc/netstatus.c

    r595 r597  
    6161                xmlrpc_DECREF(result); 
    6262 
    63                 printf("%s - received: %d/%d, sent: %d/%d, failed: %d/%d\n", 
     63                printf("%-10s - received: %d/%d, sent: %d/%d, failed: %d/%d\n", 
    6464                                type, recvp, recvb, sendp, sendb, failp, failb); 
    6565        } 
  • trunk/src/vcd/validate.c

    r556 r597  
    2525#include <lucid/str.h> 
    2626 
     27static 
     28int str_isalnumextended(const char *str) 
     29{ 
     30        int i, n; 
     31 
     32        if (!str) 
     33                return 1; 
     34 
     35        n = str_len(str); 
     36 
     37        for (i = 0; i < n; i++) { 
     38                if ((unsigned int)(str[i] - 'a') < 26u || (unsigned int)(str[i] - 'A') < 26u || (unsigned int)(str[i] - '0') < 10u 
     39                        || str[i] == '-' || str[i] == '_') continue; 
     40                return 0; 
     41        } 
     42 
     43        return 1; 
     44} 
     45 
     46 
    2747int validate_name(const char *name) 
    2848{ 
    2949        LOG_TRACEME 
    3050        return !(str_isempty(name) || str_len(name) < 3 || 
    31                         str_len(name) > 32 || !str_isalnum(name)); 
     51                        str_len(name) > 32 || !str_isalnumextended(name)); 
    3252} 
    3353