Changeset 348

Show
Ignore:
Timestamp:
09/04/06 17:35:49 (2 years ago)
Author:
bonbons
Message:

Update to use code from lucid lib
Update to new kernel-API changes

(especially related to context privacy)

Fixed some compilation issues regarding bool type

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.4/README

    r12 r348  
    11See http://dev.croup.de/proj/vserver-utils for details 
     2 
     3Dependencies: 
     4        lucid 
     5        libvserver 
     6        libowfat 
  • branches/1.0.4/scripts/lib/vps.sh

    r314 r348  
    105105                        [ ! -z "${VX_CCAPS}" ] && VCTX_ARGS="${VCTX_ARGS} -c $(util.array_to_list ${VX_CCAPS[@]})" 
    106106                        if [ ! -z "${VX_FLAGS}" ]; then 
    107                                 VCTX_ARGS="${VCTX_ARGS} -f $(util.array_to_list ${VX_FLAGS[@]}),PERSISTENT,STATE_SETUP
     107                                VCTX_ARGS="${VCTX_ARGS} -f $(util.array_to_list ${VX_FLAGS[@]}),PERSISTENT,STATE_SETUP,STATE_ADMIN
    108108                        else 
    109                                 VCTX_ARGS="${VCTX_ARGS} -f PERSISTENT,STATE_SETUP
     109                                VCTX_ARGS="${VCTX_ARGS} -f PERSISTENT,STATE_SETUP,STATE_ADMIN
    110110                        fi 
    111                         ${_VNCONTEXT} -C -n ${VX_XID} -f PERSISTENT,STATE_SETUP 
     111                        ${_VNCONTEXT} -C -n ${VX_XID} -f PERSISTENT,STATE_SETUP,STATE_ADMIN 
    112112                        ${_VCONTEXT} -C ${VCTX_ARGS} 
    113113                        ;; 
     
    254254                 
    255255                run) 
    256                         ${_VFLAGS} -S -f "~PERSISTENT,~STATE_SETUP" -x ${VX_XID} 
    257                         ${_VNFLAGS} -S -f "~PERSISTENT,~STATE_SETUP" -n ${VX_XID} 
     256                        ${_VFLAGS} -S -f "~PERSISTENT,~STATE_SETUP,~STATE_ADMIN" -x ${VX_XID} 
     257                        ${_VNFLAGS} -S -f "~PERSISTENT,~STATE_SETUP,~STATE_ADMIN" -n ${VX_XID} 
    258258                        ;; 
    259259                *) 
  • branches/1.0.4/src/libinternal/Makefile.am

    r129 r348  
    2020           -I$(top_builddir)/src 
    2121 
    22 noinst_HEADERS = printf.h vlist.h syscall.h sys.h 
     22noinst_HEADERS = vlist.h  
    2323 
    2424noinst_LIBRARIES = libinternal.a 
    2525 
    26 libinternal_a_SOURCES = printf.c list.c sys_clone.c \ 
     26libinternal_a_SOURCES = list.c \ 
    2727        bcaps-list.c cflags-list.c nflags-list.c \ 
    2828        sched-list.c ccaps-list.c iattr-list.c \ 
  • branches/1.0.4/src/libinternal/bcaps-list.c

    r129 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         bcaps_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *bcaps_list_init(void) 
    4242{ 
    4343        list_t *p = list_alloc(33); 
    44          
     44 
    4545        int i = 0; 
    4646        LIST_ADD_BCAP(1 << CAP, CHOWN) 
  • branches/1.0.4/src/libinternal/ccaps-list.c

    r129 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         ccaps_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *ccaps_list_init(void) 
    4242{ 
    43         list_t *p = list_alloc(8); 
    44          
     43        list_t *p = list_alloc(10); 
     44 
    4545        int i = 0; 
    4646        LIST_ADD_CCAP(VXC, SET_UTSNAME) 
     
    5252        LIST_ADD_CCAP(VXC, BINARY_MOUNT) 
    5353        LIST_ADD_CCAP(VXC, QUOTA_CTL) 
    54          
     54        LIST_ADD_CCAP(VXC, ADMIN_MAPPER) 
     55        LIST_ADD_CCAP(VXC, ADMIN_CLOOP) 
     56 
    5557        return p; 
    5658} 
  • branches/1.0.4/src/libinternal/cflags-list.c

    r208 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         cflags_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *cflags_list_init(void) 
    4242{ 
    43         list_t *p = list_alloc(25); 
    44          
     43        list_t *p = list_alloc(27); 
     44 
    4545        int i = 0; 
    4646        LIST_ADD_CFLAG(VXF, INFO_LOCK) 
     
    4848        LIST_ADD_CFLAG(VXF, INFO_NPROC) 
    4949        LIST_ADD_CFLAG(VXF, INFO_PRIVATE) 
    50          
     50 
    5151        LIST_ADD_CFLAG(VXF, INFO_INIT) 
    5252        LIST_ADD_CFLAG(VXF, INFO_HIDE) 
    5353        LIST_ADD_CFLAG(VXF, INFO_ULIMIT) 
    5454        LIST_ADD_CFLAG(VXF, INFO_NSPACE) 
    55          
     55 
    5656        LIST_ADD_CFLAG(VXF, SCHED_HARD) 
    5757        LIST_ADD_CFLAG(VXF, SCHED_PRIO) 
    5858        LIST_ADD_CFLAG(VXF, SCHED_PAUSE) 
    59          
     59 
    6060        LIST_ADD_CFLAG(VXF, VIRT_MEM) 
    6161        LIST_ADD_CFLAG(VXF, VIRT_UPTIME) 
    6262        LIST_ADD_CFLAG(VXF, VIRT_CPU) 
    6363        LIST_ADD_CFLAG(VXF, VIRT_LOAD) 
    64          
     64        LIST_ADD_CFLAG(VXF, VIRT_TIME) 
     65 
    6566        LIST_ADD_CFLAG(VXF, HIDE_MOUNT) 
    6667        LIST_ADD_CFLAG(VXF, HIDE_NETIF) 
    67          
     68 
    6869        LIST_ADD_CFLAG(VXF, STATE_SETUP) 
    6970        LIST_ADD_CFLAG(VXF, STATE_INIT) 
    70          
     71        LIST_ADD_CFLAG(VXF, STATE_ADMIN) 
     72 
    7173        LIST_ADD_CFLAG(VXF, SC_HELPER) 
    7274        LIST_ADD_CFLAG(VXF, REBOOT_KILL) 
    7375        LIST_ADD_CFLAG(VXF, PERSISTENT) 
    74          
     76 
    7577        LIST_ADD_CFLAG(VXF, FORK_RSS) 
    7678        LIST_ADD_CFLAG(VXF, PROLIFIC) 
    77          
     79 
    7880        LIST_ADD_CFLAG(VXF, IGNEG_NICE) 
    79          
    80 /*      LIST_ADD_CFLAG(VXF, ONE_TIME) */ 
    81          
    82 /*      LIST_ADD_CFLAG(VXF, INIT_SET) */ 
    83          
     81 
    8482        return p; 
    8583} 
  • branches/1.0.4/src/libinternal/iattr-list.c

    r129 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         iattr_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *iattr_list_init(void) 
    4242{ 
    4343        list_t *p = list_alloc(8); 
    44          
     44 
    4545        int i = 0; 
    4646        LIST_ADD_IATTR(IATTR, TAG) 
     
    5252        LIST_ADD_IATTR(IATTR, IUNLINK) 
    5353        LIST_ADD_IATTR(IATTR, IMMUTABLE) 
    54          
     54 
    5555        return p; 
    5656} 
  • branches/1.0.4/src/libinternal/mflags-list.c

    r129 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         cflags_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *mflags_list_init(void) 
    4242{ 
    4343        list_t *p = list_alloc(2); 
    44          
     44 
    4545        int i = 0; 
    4646        LIST_ADD_CFLAG(VXM, SET_INIT) 
    4747        LIST_ADD_CFLAG(VXM, SET_REAPER) 
    48          
     48 
    4949        return p; 
    5050} 
  • branches/1.0.4/src/libinternal/nflags-list.c

    r208 r348  
    3838         list_key_alloc(#VALUE), \ 
    3939         nflags_list_data_alloc(TYPE ## _ ## VALUE)); 
    40          
     40 
    4141list_t *nflags_list_init(void) 
    4242{ 
    43         list_t *p = list_alloc(3); 
    44          
     43        list_t *p = list_alloc(5); 
     44 
    4545        int i = 0; 
     46        LIST_ADD_NFLAG(NXF, INFO_LOCK) 
    4647        LIST_ADD_NFLAG(NXF, STATE_SETUP) 
     48        LIST_ADD_NFLAG(NXF, STATE_ADMIN) 
    4749        LIST_ADD_NFLAG(NXF, SC_HELPER) 
    4850        LIST_ADD_NFLAG(NXF, PERSISTENT) 
    49 /*      LIST_ADD_NFLAG(NXF, ONE_TIME) 
    50         LIST_ADD_NFLAG(NXF, INIT_SET) */ 
    51          
     51 
    5252        return p; 
    5353} 
  • branches/1.0.4/src/libinternal/rlimit-list.c

    r129 r348  
    3939         list_key_alloc(#VALUE), \ 
    4040         rlimit_list_data_alloc(TYPE ## _ ## VALUE)); 
    41          
     41 
    4242list_t *rlimit_list_init(void) 
    4343{ 
    44         list_t *p = list_alloc(9); 
    45          
     44        list_t *p = list_alloc(12); 
     45 
    4646        int i = 0; 
    4747        /* TODO: check if we miss sth */ 
     
    5151        LIST_ADD_RLIMIT(RLIMIT, MEMLOCK) 
    5252        LIST_ADD_RLIMIT(RLIMIT, AS) 
    53          
     53 
    5454        LIST_ADD_RLIMIT(VLIMIT, NSOCK) 
    5555        LIST_ADD_RLIMIT(VLIMIT, OPENFD) 
    5656        LIST_ADD_RLIMIT(VLIMIT, ANON) 
    5757        LIST_ADD_RLIMIT(VLIMIT, SHMEM) 
    58          
     58        LIST_ADD_RLIMIT(VLIMIT, SEMARY) 
     59        LIST_ADD_RLIMIT(VLIMIT, NSEMS) 
     60        LIST_ADD_RLIMIT(VLIMIT, DENTRY) 
     61 
    5962        return p; 
    6063} 
  • branches/1.0.4/src/libinternal/sched-list.c

    r129 r348  
    4141list_t *sched_list_init(void) 
    4242{ 
    43         list_t *p = list_alloc(6); 
     43        list_t *p = list_alloc(12); 
    4444         
    4545        int i = 0; 
    4646        LIST_ADD_SCHED(VXSM, FILL_RATE) 
    4747        LIST_ADD_SCHED(VXSM, INTERVAL) 
     48        LIST_ADD_SCHED(VXSM, FILL_RATE2) 
     49        LIST_ADD_SCHED(VXSM, INTERVAL2) 
    4850        LIST_ADD_SCHED(VXSM, TOKENS) 
    4951        LIST_ADD_SCHED(VXSM, TOKENS_MIN) 
    5052        LIST_ADD_SCHED(VXSM, TOKENS_MAX) 
    5153        LIST_ADD_SCHED(VXSM, PRIO_BIAS) 
    52          
     54 
     55        LIST_ADD_SCHED(VXSM, IDLE_TIME) 
     56        LIST_ADD_SCHED(VXSM, FORCE) 
     57        LIST_ADD_SCHED(VXSM, CPU_ID) 
     58        LIST_ADD_SCHED(VXSM, BUCKET_ID) 
     59 
    5360        return p; 
    5461} 
  • branches/1.0.4/src/libvconfig/main.c

    r129 r348  
    2727#include <stdio.h> 
    2828 
    29 #include "printf.h" 
     29#include <lucid/printf.h> 
    3030#include "node.h" 
    3131#include "map.h" 
     
    101101         
    102102        for (i = 0; i < NR_MAP_ENTRIES; i++) { 
    103                 vu_printf("%s\n", vconfig_map[i].key); 
     103                _lucid_printf("%s\n", vconfig_map[i].key); 
    104104        } 
    105105} 
  • branches/1.0.4/src/libvconfig/single.c

    r82 r348  
    3636#include <libowfat/str.h> 
    3737 
    38 #include "printf.h" 
     38#include <lucid/printf.h> 
    3939#include "pathconfig.h" 
    4040#include "vconfig.h" 
     
    104104         
    105105        char path[PATH_MAX]; 
    106         vu_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 
     106        _lucid_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 
    107107         
    108108        unsigned long len; 
     
    127127         
    128128        char path[PATH_MAX]; 
    129         vu_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 
     129        _lucid_snprintf(path, PATH_MAX, "%s/%s/%s", __PKGCONFDIR, name, res->path); 
    130130         
    131131        char *buf; 
     
    181181         
    182182        if (value == 1) 
    183                 vu_asprintf(&buf, "true\n"); 
     183                _lucid_asprintf(&buf, "true\n"); 
    184184        else if (value == 0) 
    185                 vu_asprintf(&buf, "false\n"); 
     185                _lucid_asprintf(&buf, "false\n"); 
    186186        else 
    187187                return -1; 
     
    218218        char *buf; 
    219219         
    220         vu_asprintf(&buf, "%d\n", value); 
     220        _lucid_asprintf(&buf, "%d\n", value); 
    221221         
    222222        rc = _single_writekey(name, key, buf); 
     
    251251        char *buf; 
    252252         
    253         vu_asprintf(&buf, "%s\n", value); 
     253        _lucid_asprintf(&buf, "%s\n", value); 
    254254         
    255255        rc = _single_writekey(name, key, buf); 
     
    297297        char *buf; 
    298298         
    299         vu_asprintf(&buf, "%s\n", value); 
     299        _lucid_asprintf(&buf, "%s\n", value); 
    300300         
    301301        rc = _single_writekey(name, key, buf); 
  • branches/1.0.4/src/tools/Makefile.am

    r208 r348  
    2525        $(top_builddir)/src/libvconfig/libvconfig.a \ 
    2626        -lowfat \ 
    27         -lvserver 
     27        -lvserver \ 
     28        -lucid 
    2829 
    2930noinst_HEADERS = tools.h 
  • branches/1.0.4/src/tools/cowcp.c

    r314 r348  
    3737#include <vserver.h> 
    3838 
    39 #include "printf.h" 
     39#include <lucid/printf.h> 
    4040#include "tools.h" 
    4141#include "vlist.h" 
     
    6262void cmd_help() 
    6363{ 
    64         vu_printf("Usage: %s <opts>* <src> <dst>\n" 
     64        _lucid_printf("Usage: %s <opts>* <src> <dst>\n" 
    6565               "\n" 
    6666               "Available options:\n" 
     
    7878        bool r = false; 
    7979        if (S_ISDIR(st_mode)) { 
    80                 vu_printf("Remove directory %s? [N/y]: ", dst); 
     80                _lucid_printf("Remove directory %s? [N/y]: ", dst); 
    8181        } else if (S_ISREG(st_mode)) { 
    82                 vu_printf("Remove regular file %s? [N/y]: ", dst); 
     82                _lucid_printf("Remove regular file %s? [N/y]: ", dst); 
    8383        } else if (S_ISBLK(st_mode)) { 
    84                 vu_printf("Remove block dev %s? [N/y]: ", dst); 
     84                _lucid_printf("Remove block dev %s? [N/y]: ", dst); 
    8585        } else if (S_ISCHR(st_mode)) { 
    86                 vu_printf("Remove char dev %s? [N/y]: ", dst); 
     86                _lucid_printf("Remove char dev %s? [N/y]: ", dst); 
    8787        } else if (S_ISLNK(st_mode)) { 
    88                 vu_printf("Remove symlink %s? [N/y]: ", dst); 
     88                _lucid_printf("Remove symlink %s? [N/y]: ", dst); 
    8989        } else if (S_ISFIFO(st_mode)) { 
    90                 vu_printf("Remove fifo %s? [N/y]: ", dst); 
     90                _lucid_printf("Remove fifo %s? [N/y]: ", dst); 
    9191        } else if (S_ISSOCK(st_mode)) { 
    92                 vu_printf("Remove socket %s? [N/y]: ", dst); 
     92                _lucid_printf("Remove socket %s? [N/y]: ", dst); 
    9393        } else 
    9494                return false; 
     
    117117        int r = errno = 0; 
    118118        if (mkdir(dst, 0) == -1) { 
    119                 vu_printf("mkdir(%s): %s\n", dst, strerror(r = errno)); 
     119                _lucid_printf("mkdir(%s): %s\n", dst, strerror(r = errno)); 
    120120                goto out; 
    121121        } 
    122122        if (chown(dst, s_st->st_uid, s_st->st_gid) == -1) { 
    123                 vu_printf("chown(%s): %s\n", dst, strerror(r = errno)); 
     123                _lucid_printf("chown(%s): %s\n", dst, strerror(r = errno)); 
    124124                goto out; 
    125125        } 
    126126        if (chmod(dst, s_st->st_mode) == -1) { 
    127                 vu_printf("chmod(%s): %s\n", dst, strerror(r = errno)); 
     127                _lucid_printf("chmod(%s): %s\n", dst, strerror(r = errno)); 
    128128                goto out; 
    129129        } 
     
    148148                                goto ok; 
    149149                } 
    150                 vu_printf("link(%s, %s): %s\n", src, dst, strerror(errno)); 
     150                _lucid_printf("link(%s, %s): %s\n", src, dst, strerror(errno)); 
    151151                return -1; 
    152152        } 
     
    154154        iattr.filename = dst; 
    155155        if (vx_set_iattr(&iattr) == -1) { 
    156                 vu_printf("iattr(%s): %s\n", dst, strerror(errno)); 
     156                _lucid_printf("iattr(%s): %s\n", dst, strerror(errno)); 
    157157                return -1; 
    158158        } 
     
    166166        struct stat d_st; 
    167167        if (lstat(src, &s_st) == -1) { 
    168                 vu_printf("lstat(%s): %s\n", src, strerror(errno)); 
     168                _lucid_printf("lstat(%s): %s\n", src, strerror(errno)); 
    169169                return -1; 
    170170        } 
     
    173173        if (lstat(dst, &d_st) == -1) { 
    174174                if (errno != ENOENT) { 
    175                         vu_printf("lstat(%s): %s\n", dst, strerror(errno)); 
     175                        _lucid_printf("lstat(%s): %s\n", dst, strerror(errno)); 
    176176                        return -1; 
    177177                } 
     
    183183                        if (opts.force || confirm_del(d_st.st_mode, dst)) { 
    184184                                if (unlink(dst) == -1) { 
    185                                         vu_printf("unlink(%s): %s\n", dst, strerror(errno)); 
     185                                        _lucid_printf("unlink(%s): %s\n", dst, strerror(errno)); 
    186186                                        return -1; 
    187187                                } 
    188188                        } else { 
    189                                 vu_printf("cp(%s): target untouched\n", dst); 
     189                                _lucid_printf("cp(%s): target untouched\n", dst); 
    190190                                return -1; 
    191191                        } 
     
    202202                return cp_cow(src, dst); 
    203203        } else if (S_ISBLK(s_st.st_mode)) { 
    204                 vu_printf("cp(%s): block devices not supported\n", src); 
     204                _lucid_printf("cp(%s): block devices not supported\n", src); 
    205205        } else if (S_ISCHR(s_st.st_mode)) { 
    206                 vu_printf("cp(%s): char devices not supported\n", src); 
     206                _lucid_printf("cp(%s): char devices not supported\n", src); 
    207207        } else if (S_ISLNK(s_st.st_mode)) { 
    208                 vu_printf("cp(%s): symbolic links not supported\n", src); 
     208                _lucid_printf("cp(%s): symbolic links not supported\n", src); 
    209209        } else if (S_ISFIFO(s_st.st_mode)) { 
    210                 vu_printf("cp(%s): fifos not supported\n", src); 
     210                _lucid_printf("cp(%s): fifos not supported\n", src); 
    211211        } else if (S_ISSOCK(s_st.st_mode)) { 
    212                 vu_printf("cp(%s): sockets not supported\n", src); 
     212                _lucid_printf("cp(%s): sockets not supported\n", src); 
    213213        } 
    214214        return -1; 
     
    289289        /* check file argument */ 
    290290        if (argc != optind + 2) { 
    291                 vu_printf("Expecting exactly 1 source and 2 target\n"); 
     291                _lucid_printf("Expecting exactly 1 source and 2 target\n"); 
    292292                errcnt = 1; 
    293293        } else 
  • branches/1.0.4/src/tools/lockfile.c

    r129 r348  
    3535#include <string.h> 
    3636 
    37 #include "printf.h" 
     37#include <lucid/printf.h> 
    3838#include "tools.h" 
    3939 
     
    6464void cmd_help() 
    6565{ 
    66         vu_printf("Usage: %s <opts>*\n" 
     66        _lucid_printf("Usage: %s <opts>*\n" 
    6767               "\n" 
    6868               "Available options:\n" 
     
    172172                 
    173173                char buf[7]; 
    174                 vu_snprintf(buf, 7, "%d\n", getpid()); 
     174                _lucid_snprintf(buf, 7, "%d\n", getpid()); 
    175175                 
    176176                if (write(lockfd, buf, 7) == -1) { 
  • branches/1.0.4/src/tools/nidof.c

    r115 r348  
    2727#include <vserver.h> 
    2828 
    29 #include "printf.h" 
     29#include <lucid/printf.h> 
    3030#include "tools.h" 
    3131 
     
    4040                exit(EXIT_COMMAND); 
    4141         
    42         vu_printf("%d\n", pid); 
     42        _lucid_printf("%d\n", pid); 
    4343                 
    4444        exit(EXIT_SUCCESS); 
  • branches/1.0.4/src/tools/tools.h

    r129 r348  
    4444#define DEFAULT_GETOPT \ 
    4545default: \ 
    46         vu_printf("Try '%s -h' for more information\n", argv[0]); \ 
     46        _lucid_printf("Try '%s -h' for more information\n", argv[0]); \ 
    4747        exit(EXIT_USAGE); \ 
    4848        break; \ 
     
    5050 
    5151#define CMD_VERSION(name, desc) do { \ 
    52         vu_printf("%s -- %s\n", name, desc); \ 
    53         vu_printf("This program is part of %s\n\n", PACKAGE_STRING); \ 
    54         vu_printf("Copyright (c) 2005 The vserver-utils Team\n"); \ 
    55         vu_printf("This program is free software; you can redistribute it and/or\n"); \ 
    56         vu_printf("modify it under the terms of the GNU General Public License\n"); \ 
     52        _lucid_printf("%s -- %s\n", name, desc); \ 
     53        _lucid_printf("This program is part of %s\n\n", PACKAGE_STRING); \ 
     54        _lucid_printf("Copyright (c) 2005 The vserver-utils Team\n"); \ 
     55        _lucid_printf("This program is free software; you can redistribute it and/or\n"); \ 
     56        _lucid_printf("modify it under the terms of the GNU General Public License\n"); \ 
    5757        exit(0); \ 
    5858}       while(0) 
     
    7171#define EXIT_OPTS    3 
    7272 
    73 #define VPRINTF(opts, fmt, ...) if ((opts)->verbose) vu_printf(fmt , __VA_ARGS__ ) 
     73#define VPRINTF(opts, fmt, ...) if ((opts)->verbose) _lucid_printf(fmt , __VA_ARGS__ ) 
    7474#ifdef DEBUG 
    75 #define DEBUGF(fmt, ...) vu_printf("DEBUG: " fmt , __VA_ARGS__ ) 
     75#define DEBUGF(fmt, ...) _lucid_printf("DEBUG: " fmt , __VA_ARGS__ ) 
    7676#else 
    7777#define DEBUGF(fmt, ...) 
     
    7979 
    8080#define EXIT(MSG,RC) { \ 
    81         vu_printf(MSG"; try '%s -h' for more information\n", argv[0]); \ 
     81        _lucid_printf(MSG"; try '%s -h' for more information\n", argv[0]); \ 
    8282        exit(RC); \ 
    8383} 
    8484 
    8585#define SEXIT(MSG,RC) { \ 
    86         vu_printf(MSG"\n"); \ 
     86        _lucid_printf(MSG"\n"); \ 
    8787        exit(RC); \ 
    8888} 
  • branches/1.0.4/src/tools/vattr.c

    r129 r348  
    3737#include <vserver.h> 
    3838 
    39 #include "printf.h" 
     39#include <lucid/printf.h> 
    4040#include "tools.h" 
    4141#include "vlist.h" 
     
    8080void cmd_help() 
    8181{ 
    82         vu_printf("Usage: %s <opts>* <file>*\n" 
     82        _lucid_printf("Usage: %s <opts>* <file>*\n" 
    8383               "\n" 
    8484               "Available commands:\n" 
     
    158158                /* syscall */ 
    159159                if (vx_set_iattr(&iattr) == -1) { 
    160                         vu_printf("vx_set_iattr(%s): %s\n", iattr.filename, strerror(errno)); 
     160                        _lucid_printf("vx_set_iattr(%s): %s\n", iattr.filename, strerror(errno)); 
    161161                        return 1; 
    162162                } 
     
    207207                 
    208208                if (iattr.mask & IATTR_TAG) 
    209                         vu_snprintf(ptr, 7, " %5d", iattr.xid); 
     209                        _lucid_snprintf(ptr, 7, " %5d", iattr.xid); 
    210210                else 
    211                         vu_snprintf(ptr, 7, " noxid"); 
    212                  
    213                 vu_printf("%s", buf); 
     211                        _lucid_snprintf(ptr, 7, " noxid"); 
     212                 
     213                _lucid_printf("%s", buf); 
    214214                 
    215215                if (src != 0) 
    216                         vu_printf(" %s ->", src); 
     216                        _lucid_printf(" %s ->", src); 
    217217                 
    218218                if (display != 0) 
    219                         vu_printf(" %s\n", display); 
     219                        _lucid_printf(" %s\n", display); 
    220220                else 
    221                         vu_printf(" %s\n", file); 
     221                        _lucid_printf(" %s\n", file); 
    222222        } 
    223223         
     
    237237         
    238238        if (lstat(file, &sb) == -1) { 
    239                 vu_printf("lstat(%s): %s\n", file, strerror(errno)); 
     239                _lucid_printf("lstat(%s): %s\n", file, strerror(errno)); 
    240240                return 1; 
    241241        } 
     
    254254                                return 0; 
    255255                         
    256                         vu_printf("readlink(%s): %s\n", display, strerror(errno)); 
     256                        _lucid_printf("readlink(%s): %s\n", display, strerror(errno)); 
    257257                        return 1; 
    258258                } 
     
    262262                if (opts.follow) { 
    263263                        if (stat(link_buf, &sb) == -1) { 
    264                                 vu_printf("stat(%s): %s\n", link_buf, strerror(errno)); 
     264                                _lucid_printf("stat(%s): %s\n", link_buf, strerror(errno)); 
    265265                                return 1; 
    266266                        } 
     
    286286         
    287287        if (dir == 0) { 
    288                 vu_printf("opendir(%s): %s\n", path, strerror(errno)); 
     288                _lucid_printf("opendir(%s): %s\n", path, strerror(errno)); 
    289289                return 1; 
    290290        } 
     
    306306        while ((ent = readdir(dir)) != 0) { 
    307307                if (lstat(ent->d_name, &sb) == -1) { 
    308                         vu_printf("lstat(%s): %s\n", ent->d_name, strerror(errno)); 
     308                        _lucid_printf("lstat(%s): %s\n", ent->d_name, strerror(errno)); 
    309309                        return errcnt + 1; 
    310310                } 
     
    356356         
    357357        if (lstat(path, &st) == -1) { 
    358                 vu_printf("lstat(%s): %s\n", path, strerror(errno)); 
     358                _lucid_printf("lstat(%s): %s\n", path, strerror(errno)); 
    359359                return 1; 
    360360        } 
  • branches/1.0.4/src/tools/vconfig.c

    r129 r348  
    3030#include <vserver.h> 
    3131 
    32 #include "printf.h" 
     32#include <lucid/printf.h> 
    3333#include "tools.h" 
    3434#include "vconfig.h" 
     
    5151void cmd_help() 
    5252{ 
    53         vu_printf("Usage: %s <command> <opts>*\n" 
     53        _lucid_printf("Usage: %s <command> <opts>*\n" 
    5454               "\n" 
    5555               "Available commands:\n" 
     
    134134                                if (buf != -1) { 
    135135                                        if (buf == 1) 
    136                                                 vu_printf("true\n"); 
     136                                                _lucid_printf("true\n"); 
    137137                                        else 
    138                                                 vu_printf("false\n"); 
     138                                                _lucid_printf("false\n"); 
    139139                                } 
    140140                        } 
     
    143143                                int buf = vconfig_get_int(opts.name, opts.key); 
    144144                                if (buf != -1) 
    145                                         vu_printf("%d\n", buf); 
     145                                        _lucid_printf("%d\n", buf); 
    146146                        } 
    147147                 
     
    150150                         
    151151                                if (buf != NULL) { 
    152                                         vu_printf("%s\n", buf); 
     152                                        _lucid_printf("%s\n", buf); 
    153153                                        free(buf); 
    154154                                } 
     
    159159                         
    160160                                if (buf != NULL) { 
    161                                         vu_printf("%s\n", buf); 
     161                                        _lucid_printf("%s\n", buf); 
    162162                                        free(buf); 
    163163                                } 
     
    170170                } 
    171171                case VCFG_SET: { 
    172                         vu_printf("SET command not implemented\n"); 
     172                        _lucid_printf("SET command not implemented\n"); 
    173173                        return -1; 
    174174                        break; 
  • branches/1.0.4/src/tools/vcontext.c

    r134 r348  
    3030#include <vserver.h> 
    3131 
    32 #include "printf.h" 
     32#include <lucid/printf.h> 
    3333#include "tools.h" 
    3434#include "vlist.h" 
     
    5858void cmd_help() 
    5959{ 
    60         vu_printf("Usage: %s <command> <opts>* -- <program> <args>*\n" 
     60        _lucid_printf("Usage: %s <command> <opts>* -- <program> <args>*\n" 
    6161               "\n" 
    6262               "Available commands:\n" 
     
    188188                case VCTX_CREATE: { 
    189189                        struct vx_create_flags create_flags = { 
    190                                 .flags = VXF_STATE_SETUP | opts.flags, 
    191                         }; 
    192                          
     190                                .flags = VXF_STATE_SETUP | VXF_STATE_ADMIN | opts.flags, 
     191                        }; 
     192 
    193193                        /* syscall */ 
    194194                        if (vx_create(opts.xid, &create_flags) == -1) 
    195195                                PEXIT("Failed to create context", EXIT_COMMAND);