direct-io.hg

changeset 5545:76f16636bbb5

bitkeeper revision 1.1726.2.5 (42ba7c68cP1Z3SmHyVl4grEnN-Yf8g)

minor xense tool updates

Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Thu Jun 23 09:10:00 2005 +0000 (2005-06-23)
parents 6446c0567c5c
children 76346519b28e
files BitKeeper/etc/ignore tools/policy/policy_tool.c tools/python/xen/xm/create.py
line diff
     1.1 --- a/BitKeeper/etc/ignore	Thu Jun 23 08:48:36 2005 +0000
     1.2 +++ b/BitKeeper/etc/ignore	Thu Jun 23 09:10:00 2005 +0000
     1.3 @@ -124,6 +124,8 @@ tools/misc/miniterm/miniterm
     1.4  tools/misc/xc_shadow
     1.5  tools/misc/xen_cpuperf
     1.6  tools/misc/xenperf
     1.7 +tools/policy/policy_tool
     1.8 +tools/policy/xen/*
     1.9  tools/pygrub/build/*
    1.10  tools/python/build/*
    1.11  tools/tests/test_x86_emulator
     2.1 --- a/tools/policy/policy_tool.c	Thu Jun 23 08:48:36 2005 +0000
     2.2 +++ b/tools/policy/policy_tool.c	Thu Jun 23 09:10:00 2005 +0000
     2.3 @@ -14,7 +14,7 @@
     2.4   *
     2.5   * sHype policy management tool. This code runs in a domain and
     2.6   *     manages the Xen security policy by interacting with the
     2.7 - *     Xen access control module via a /proc/xen/policycmd proc-ioctl, 
     2.8 + *     Xen access control module via a /proc/xen/privcmd proc-ioctl, 
     2.9   *     which is translated into a policy_op hypercall into Xen.
    2.10   * 
    2.11   * todo: implement setpolicy to dynamically set a policy cache.
    2.12 @@ -229,7 +229,6 @@ void acm_dump_policy_buffer(void *buf, i
    2.13  	default:
    2.14  		printf("UNKNOWN POLICY!\n");
    2.15  	}
    2.16 -	printf("\nPolicy dump End.\n\n");
    2.17  }
    2.18  
    2.19  /*************************** set policy ****************************/
    2.20 @@ -519,39 +518,35 @@ usage(char *progname){
    2.21  int
    2.22  main(int argc, char **argv) {
    2.23  
    2.24 -	int policycmd_fd;
    2.25 +	int policycmd_fd, ret;
    2.26  
    2.27 -	if (argc < 2)
    2.28 +	if (argc < 2) 
    2.29  		usage(argv[0]);
    2.30  		
    2.31  	if ((policycmd_fd = open("/proc/xen/privcmd", O_RDONLY)) <= 0) {
    2.32 -		    printf("ERROR: Could not open xen policycmd device!\n");
    2.33 +		    printf("ERROR: Could not open xen privcmd device!\n");
    2.34  		    exit(-1);
    2.35  	}
    2.36  	    
    2.37  	if (!strcmp(argv[1], "setpolicy")) {
    2.38  		if (argc != 2)
    2.39  			usage(argv[0]);
    2.40 -		acm_domain_setpolicy(policycmd_fd);
    2.41 -
    2.42 +		ret = acm_domain_setpolicy(policycmd_fd);
    2.43  	} else if (!strcmp(argv[1], "getpolicy")) {
    2.44  		if (argc != 2)
    2.45  			usage(argv[0]);
    2.46 -		acm_domain_getpolicy(policycmd_fd);
    2.47 -
    2.48 +		ret = acm_domain_getpolicy(policycmd_fd);
    2.49  	} else if (!strcmp(argv[1], "loadpolicy")) {
    2.50  		if (argc != 3) 
    2.51  			usage(argv[0]);
    2.52 -		acm_domain_loadpolicy(policycmd_fd, argv[2]);
    2.53 -
    2.54 +		ret = acm_domain_loadpolicy(policycmd_fd, argv[2]);
    2.55  	} else if (!strcmp(argv[1], "dumpstats")) {
    2.56  		if (argc != 2) 
    2.57  			usage(argv[0]);
    2.58 -		acm_domain_dumpstats(policycmd_fd);
    2.59 -
    2.60 +		ret = acm_domain_dumpstats(policycmd_fd);
    2.61  	} else
    2.62  		usage(argv[0]);
    2.63  
    2.64  	close(policycmd_fd);
    2.65 -	return 0;
    2.66 +	return ret;
    2.67  }
     3.1 --- a/tools/python/xen/xm/create.py	Thu Jun 23 08:48:36 2005 +0000
     3.2 +++ b/tools/python/xen/xm/create.py	Thu Jun 23 09:10:00 2005 +0000
     3.3 @@ -121,7 +121,7 @@ gopts.var('memory', val='MEMORY',
     3.4            use="Domain memory in MB.")
     3.5  
     3.6  gopts.var('ssidref', val='SSIDREF',
     3.7 -          fn=set_u32, default=0xffffffff,
     3.8 +          fn=set_u32, default=-1, 
     3.9            use="Security Identifier.")
    3.10  
    3.11  gopts.var('maxmem', val='MEMORY',