static int nbd_reject_length(NBDClient *client, bool fatal, Error **errp)

{

    int ret;



    assert(client->optlen);

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

        return -EIO;

    }

    ret = nbd_negotiate_send_rep_err(client, NBD_REP_ERR_INVALID, errp,

                                     "option '%s' should have zero length",

                                     nbd_opt_lookup(client->opt));

    if (fatal && !ret) {

        error_setg(errp, "option '%s' should have zero length",

                   nbd_opt_lookup(client->opt));

        return -EINVAL;

    }

    return ret;

}

static int nbd_reject_length(NBDClient *client, bool fatal, Error **errp)

{

    int ret;



    assert(client->optlen);

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

        return -EIO;

    }

    ret = nbd_negotiate_send_rep_err(client, NBD_REP_ERR_INVALID, errp,

                                     "option '%s' should have zero length",

                                     nbd_opt_lookup(client->opt));

    if (fatal && !ret) {

        error_setg(errp, "option '%s' should have zero length",

                   nbd_opt_lookup(client->opt));

        return -EINVAL;

    }

    return ret;

}

    if (nbd_drop(client->ioc, client->optlen, errp) < 0) {         return -EIO;     ret = nbd_negotiate_send_rep_err(client, NBD_REP_ERR_INVALID, errp,                                      "option '%s' should have zero length",                                      nbd_opt_lookup(client->opt));         error_setg(errp, "option '%s' should have zero length",         return -EIO;         return -EIO;         return -EIO;     if (nbd_drop(client->ioc, client->optlen, errp) < 0) {         return -EIO;
static int FUNC_0(NBDClient *VAR_0, bool VAR_1, Error **VAR_2)

{

    int VAR_3;



    assert(VAR_0->optlen);

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

        return -EIO;

    }

    VAR_3 = nbd_negotiate_send_rep_err(VAR_0, NBD_REP_ERR_INVALID, VAR_2,

                                     "option '%s' should have zero length",

                                     nbd_opt_lookup(VAR_0->opt));

    if (VAR_1 && !VAR_3) {

        error_setg(VAR_2, "option '%s' should have zero length",

                   nbd_opt_lookup(VAR_0->opt));

        return -EINVAL;

    }

    return VAR_3;

}

static int FUNC_0(NBDClient *VAR_0, bool VAR_1, Error **VAR_2)
{ int VAR_3; assert(VAR_0->optlen); if (nbd_drop(VAR_0->ioc, VAR_0->optlen, VAR_2) < 0) { return -EIO; } VAR_3 = nbd_negotiate_send_rep_err(VAR_0, NBD_REP_ERR_INVALID, VAR_2,
"option '%s' should have zero length",
nbd_opt_lookup(VAR_0->opt)); if (VAR_1 && !VAR_3) { error_setg(VAR_2, "option '%s' should have zero length",
nbd_opt_lookup(VAR_0->opt)); return -EINVAL; } return VAR_3; }