int diskutil_dd(const char *in, const char *out, const int bs, const long long count)
{
    char *output = NULL;

    if (in && out) {
        LOGINFO("copying data from '%s'\n", in);
        LOGINFO("               to '%s' (blocks=%lld)\n", out, count);

        char if_str[MAX_PATH]; snprintf(if_str, sizeof(if_str), "if=%s", in);
        char of_str[MAX_PATH]; snprintf(of_str, sizeof(of_str), "of=%s", out);
        char bs_str[64]; snprintf(bs_str, sizeof(bs_str), "bs=%d", bs);
        char count_str[64]; snprintf(count_str, sizeof(count_str), "count=%lld", count);
        output = execlp_output(TRUE, helpers_path[ROOTWRAP], helpers_path[DD], if_str, of_str, bs_str, count_str, NULL);
        if (!output) {
            LOGERROR("cannot copy '%s'\n", in);
            LOGERROR("                to '%s'\n", out);
            return (EUCA_ERROR);
        }

        EUCA_FREE(output);
        return (EUCA_OK);
    }

    LOGWARN("bad params: in=%s, out=%s\n", SP(in), SP(out));
    return (EUCA_INVALID_ERROR);
}
int diskutil_dd(const char *in, const char *out, const int bs, const long long count)
{
    char *output = NULL;

    if (in && out) {
        LOGINFO("copying data from '%s'\n", in);
        LOGINFO("               to '%s' (blocks=%lld)\n", out, count);

        char if_str[MAX_PATH]; snprintf(if_str, sizeof(if_str), "if=%s", in);
        char of_str[MAX_PATH]; snprintf(of_str, sizeof(of_str), "of=%s", out);
        char bs_str[64]; snprintf(bs_str, sizeof(bs_str), "bs=%d", bs);
        char count_str[64]; snprintf(count_str, sizeof(count_str), "count=%lld", count);
        output = execlp_output(TRUE, helpers_path[ROOTWRAP], helpers_path[DD], if_str, of_str, bs_str, count_str, NULL);
        if (!output) {
            LOGERROR("cannot copy '%s'\n", in);
            LOGERROR("                to '%s'\n", out);
            return (EUCA_ERROR);
        }

        EUCA_FREE(output);
        return (EUCA_OK);
    }

    LOGWARN("bad params: in=%s, out=%s\n", SP(in), SP(out));
    return (EUCA_INVALID_ERROR);
}