int unix_connect_opts(QemuOpts *opts)

{

    struct sockaddr_un un;

    const char *path = qemu_opt_get(opts, "path");

    int sock;



    if (NULL == path) {

        fprintf(stderr, "unix connect: no path specified\n");

        return -1;

    }



    sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);

    if (sock < 0) {

        perror("socket(unix)");

        return -1;

    }



    memset(&un, 0, sizeof(un));

    un.sun_family = AF_UNIX;

    snprintf(un.sun_path, sizeof(un.sun_path), "%s", path);

    if (connect(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {

        fprintf(stderr, "connect(unix:%s): %s\n", path, strerror(errno));


	return -1;

    }



    if (sockets_debug)

        fprintf(stderr, "connect(unix:%s): OK\n", path);

    return sock;

}
int unix_connect_opts(QemuOpts *opts)

{

    struct sockaddr_un un;

    const char *path = qemu_opt_get(opts, "path");

    int sock;



    if (NULL == path) {

        fprintf(stderr, "unix connect: no path specified\n");

        return -1;

    }



    sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);

    if (sock < 0) {

        perror("socket(unix)");

        return -1;

    }



    memset(&un, 0, sizeof(un));

    un.sun_family = AF_UNIX;

    snprintf(un.sun_path, sizeof(un.sun_path), "%s", path);

    if (connect(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {

        fprintf(stderr, "connect(unix:%s): %s\n", path, strerror(errno));


	return -1;

    }



    if (sockets_debug)

        fprintf(stderr, "connect(unix:%s): OK\n", path);

    return sock;

}
int FUNC_0(QemuOpts *VAR_0)

{

    struct sockaddr_un VAR_1;

    const char *VAR_2 = qemu_opt_get(VAR_0, "VAR_2");

    int VAR_3;



    if (NULL == VAR_2) {

        fprintf(stderr, "unix connect: no VAR_2 specified\n");

        return -1;

    }



    VAR_3 = qemu_socket(PF_UNIX, SOCK_STREAM, 0);

    if (VAR_3 < 0) {

        perror("socket(unix)");

        return -1;

    }



    memset(&VAR_1, 0, sizeof(VAR_1));

    VAR_1.sun_family = AF_UNIX;

    snprintf(VAR_1.sun_path, sizeof(VAR_1.sun_path), "%s", VAR_2);

    if (connect(VAR_3, (struct sockaddr*) &VAR_1, sizeof(VAR_1)) < 0) {

        fprintf(stderr, "connect(unix:%s): %s\n", VAR_2, strerror(errno));


	return -1;

    }



    if (sockets_debug)

        fprintf(stderr, "connect(unix:%s): OK\n", VAR_2);

    return VAR_3;

}
int FUNC_0(QemuOpts *VAR_0)
{ struct sockaddr_un VAR_1; const char *VAR_2 = qemu_opt_get(VAR_0, "VAR_2"); int VAR_3; if (NULL == VAR_2) { fprintf(stderr, "unix connect: no VAR_2 specified\n"); return -1; } VAR_3 = qemu_socket(PF_UNIX, SOCK_STREAM, 0); if (VAR_3 < 0) { perror("socket(unix)"); return -1; } memset(&VAR_1, 0, sizeof(VAR_1)); VAR_1.sun_family = AF_UNIX; snprintf(VAR_1.sun_path, sizeof(VAR_1.sun_path), "%s", VAR_2); if (connect(VAR_3, (struct sockaddr*) &VAR_1, sizeof(VAR_1)) < 0) { fprintf(stderr, "connect(unix:%s): %s\n", VAR_2, strerror(errno)); return -1; } if (sockets_debug)
fprintf(stderr, "connect(unix:%s): OK\n", VAR_2); return VAR_3; }