libxlDriverShouldLoad(bool privileged)
{
bool ret = false;
- virCommandPtr cmd;
int status;
char *output = NULL;
if (!virFileExists(HYPERVISOR_CAPABILITIES)) {
VIR_INFO("Disabling driver as " HYPERVISOR_CAPABILITIES
" does not exist");
- return false;
+ return ret;
}
/*
* Don't load if not running on a Xen control domain (dom0). It is not
}
/* Don't load if legacy xen toolstack (xend) is in use */
- cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
- if (virCommandRun(cmd, &status) == 0 && status == 0) {
- VIR_INFO("Legacy xen tool stack seems to be in use, disabling "
- "libxenlight driver.");
+ if (virFileExists("/usr/sbin/xend")) {
+ virCommandPtr cmd;
+
+ cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
+ if (virCommandRun(cmd, NULL) == 0) {
+ VIR_INFO("Legacy xen tool stack seems to be in use, disabling "
+ "libxenlight driver.");
+ } else {
+ ret = true;
+ }
+ virCommandFree(cmd);
} else {
ret = true;
}
- virCommandFree(cmd);
return ret;
}
static bool
xenUnifiedXendProbe(void)
{
- virCommandPtr cmd;
bool ret = false;
- cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
- if (virCommandRun(cmd, NULL) == 0)
- ret = true;
- virCommandFree(cmd);
+ if (virFileExists("/usr/sbin/xend")) {
+ virCommandPtr cmd;
+
+ cmd = virCommandNewArgList("/usr/sbin/xend", "status", NULL);
+ if (virCommandRun(cmd, NULL) == 0)
+ ret = true;
+ virCommandFree(cmd);
+ }
return ret;
}