aboutsummaryrefslogtreecommitdiffstats
path: root/tools/flask/utils
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:30:19 +0100
commit5cc436c1d2b3b0be3f42104582f53eec3969b43a (patch)
tree1e30ade146ee7287c486d1309b5d3d2c69a2d9b9 /tools/flask/utils
parent7f9a888af4b65cb8c22cea3c8295d30d0fedd623 (diff)
downloadxen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.gz
xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.tar.bz2
xen-5cc436c1d2b3b0be3f42104582f53eec3969b43a.zip
libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/flask/utils')
-rw-r--r--tools/flask/utils/getenforce.c6
-rw-r--r--tools/flask/utils/loadpolicy.c6
-rw-r--r--tools/flask/utils/setenforce.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/tools/flask/utils/getenforce.c b/tools/flask/utils/getenforce.c
index 1706f6a2e2..281fc814e6 100644
--- a/tools/flask/utils/getenforce.c
+++ b/tools/flask/utils/getenforce.c
@@ -27,13 +27,13 @@ static void usage (int argCnt, const char *args[])
int main (int argCnt, const char *args[])
{
int ret;
- int xch = 0;
+ xc_interface *xch = 0;
if (argCnt != 1)
usage(argCnt, args);
- xch = xc_interface_open();
- if ( xch < 0 )
+ xch = xc_interface_open(0,0,0);
+ if ( !xch )
{
fprintf(stderr, "Unable to create interface to xenctrl: %s\n",
strerror(errno));
diff --git a/tools/flask/utils/loadpolicy.c b/tools/flask/utils/loadpolicy.c
index 13e4cb2c32..4e99c71e2a 100644
--- a/tools/flask/utils/loadpolicy.c
+++ b/tools/flask/utils/loadpolicy.c
@@ -35,7 +35,7 @@ int main (int argCnt, const char *args[])
void *polMemCp = NULL;
struct stat info;
int ret;
- int xch = 0;
+ xc_interface *xch = 0;
if (argCnt != 2)
usage(argCnt, args);
@@ -70,8 +70,8 @@ int main (int argCnt, const char *args[])
goto cleanup;
}
- xch = xc_interface_open();
- if ( xch < 0 )
+ xch = xc_interface_open(0,0,0);
+ if ( !xch )
{
fprintf(stderr, "Unable to create interface to xenctrl: %s\n",
strerror(errno));
diff --git a/tools/flask/utils/setenforce.c b/tools/flask/utils/setenforce.c
index 60e8eb086f..63928bdd3a 100644
--- a/tools/flask/utils/setenforce.c
+++ b/tools/flask/utils/setenforce.c
@@ -27,15 +27,15 @@ static void usage (int argCnt, const char *args[])
int main (int argCnt, const char *args[])
{
int ret = 0;
- int xch = 0;
+ xc_interface *xch = 0;
long mode = 0;
char *end;
if (argCnt != 2)
usage(argCnt, args);
- xch = xc_interface_open();
- if ( xch < 0 )
+ xch = xc_interface_open(0,0,0);
+ if ( !xch )
{
fprintf(stderr, "Unable to create interface to xenctrl: %s\n",
strerror(errno));