示例#1
0
/**
 * bd_md_check_deps:
 *
 * Returns: whether the plugin's runtime dependencies are satisfied or not
 *
 * Function checking plugin's runtime dependencies.
 *
 */
gboolean bd_md_check_deps () {
    GError *error = NULL;
    gboolean ret = bd_utils_check_util_version ("mdadm", MDADM_MIN_VERSION, NULL, "mdadm - v([\\d\\.]+)", &error);

    if (!ret && error) {
        g_warning("Cannot load the MDRAID plugin: %s" , error->message);
        g_clear_error (&error);
    }
    return ret;
}
示例#2
0
/**
 * bd_mpath_check_deps:
 *
 * Returns: whether the plugin's runtime dependencies are satisfied or not
 *
 * Function checking plugin's runtime dependencies.
 *
 */
gboolean bd_mpath_check_deps () {
    GError *error = NULL;
    gboolean ret = bd_utils_check_util_version ("multipath", MULTIPATH_MIN_VERSION, NULL, "multipath-tools v([\\d\\.]+)", &error);

    if (!ret && error) {
        g_warning("Cannot load the mpath plugin: %s" , error->message);
        g_clear_error (&error);
    }

    if (!ret)
        return FALSE;

    /* mpathconf doesn't report its version */
    ret = bd_utils_check_util_version ("mpathconf", NULL, NULL, NULL, &error);
    if (!ret && error) {
        g_warning("Cannot load the mpath plugin: %s" , error->message);
        g_clear_error (&error);
    }
    return ret;
}
示例#3
0
/**
 * bd_s390_check_deps:
 *
 * Returns: whether the plugin's runtime dependencies are satisfied or not
 *
 * Function checking plugin's runtime dependencies.
 *
 */
gboolean bd_s390_check_deps () {
    GError *error = NULL;
    guint i = 0;
    gboolean status = FALSE;
    gboolean ret = TRUE;

    for (i=0; i < DEPS_LAST; i++) {
        status = bd_utils_check_util_version (deps[i].name, deps[i].version,
                                              deps[i].ver_arg, deps[i].ver_regexp, &error);
        if (!status)
            g_warning ("%s", error->message);
        else
            g_atomic_int_or (&avail_deps, 1 << i);
        g_clear_error (&error);
        ret = ret && status;
    }

    if (!ret)
        g_warning("Cannot load the s390 plugin");

    return ret;
}