static int nbd_negotiate_handle_list(NBDClient *client, uint32_t length,

                                     Error **errp)

{

    NBDExport *exp;



    if (length) {

        if (nbd_drop(client->ioc, length, errp) < 0) {

            return -EIO;

        }

        return nbd_negotiate_send_rep_err(client->ioc,

                                          NBD_REP_ERR_INVALID, NBD_OPT_LIST,

                                          errp,

                                          "OPT_LIST should not have length");

    }



    /* For each export, send a NBD_REP_SERVER reply. */

    QTAILQ_FOREACH(exp, &exports, next) {

        if (nbd_negotiate_send_rep_list(client->ioc, exp, errp)) {

            return -EINVAL;

        }

    }

    /* Finish with a NBD_REP_ACK. */

    return nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, NBD_OPT_LIST, errp);

}

static int nbd_negotiate_handle_list(NBDClient *client, uint32_t length,

                                     Error **errp)

{

    NBDExport *exp;



    if (length) {

        if (nbd_drop(client->ioc, length, errp) < 0) {

            return -EIO;

        }

        return nbd_negotiate_send_rep_err(client->ioc,

                                          NBD_REP_ERR_INVALID, NBD_OPT_LIST,

                                          errp,

                                          "OPT_LIST should not have length");

    }



    

    QTAILQ_FOREACH(exp, &exports, next) {

        if (nbd_negotiate_send_rep_list(client->ioc, exp, errp)) {

            return -EINVAL;

        }

    }

    

    return nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, NBD_OPT_LIST, errp);

}

static int FUNC_0(NBDClient *VAR_0, uint32_t VAR_1,

                                     Error **VAR_2)

{

    NBDExport *exp;



    if (VAR_1) {

        if (nbd_drop(VAR_0->ioc, VAR_1, VAR_2) < 0) {

            return -EIO;

        }

        return nbd_negotiate_send_rep_err(VAR_0->ioc,

                                          NBD_REP_ERR_INVALID, NBD_OPT_LIST,

                                          VAR_2,

                                          "OPT_LIST should not have VAR_1");

    }



    

    QTAILQ_FOREACH(exp, &exports, next) {

        if (nbd_negotiate_send_rep_list(VAR_0->ioc, exp, VAR_2)) {

            return -EINVAL;

        }

    }

    

    return nbd_negotiate_send_rep(VAR_0->ioc, NBD_REP_ACK, NBD_OPT_LIST, VAR_2);

}

static int FUNC_0(NBDClient *VAR_0, uint32_t VAR_1,
Error **VAR_2)
{ NBDExport *exp; if (VAR_1) { if (nbd_drop(VAR_0->ioc, VAR_1, VAR_2) < 0) { return -EIO; } return nbd_negotiate_send_rep_err(VAR_0->ioc,
NBD_REP_ERR_INVALID, NBD_OPT_LIST,
VAR_2,
"OPT_LIST should not have VAR_1"); } QTAILQ_FOREACH(exp, &exports, next) { if (nbd_negotiate_send_rep_list(VAR_0->ioc, exp, VAR_2)) { return -EINVAL; } } return nbd_negotiate_send_rep(VAR_0->ioc, NBD_REP_ACK, NBD_OPT_LIST, VAR_2); }