static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags,

                         Error **errp) {

    NFSClient *client = bs->opaque;

    int64_t ret;

    QemuOpts *opts;

    Error *local_err = NULL;



    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);

    qemu_opts_absorb_qdict(opts, options, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(errp, local_err);

        return -EINVAL;

    }

    ret = nfs_client_open(client, qemu_opt_get(opts, "filename"),

                          (flags & BDRV_O_RDWR) ? O_RDWR : O_RDONLY,

                          errp);

    if (ret < 0) {

        return ret;

    }

    bs->total_sectors = ret;

    return 0;

}

static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags,

                         Error **errp) {

    NFSClient *client = bs->opaque;

    int64_t ret;

    QemuOpts *opts;

    Error *local_err = NULL;



    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);

    qemu_opts_absorb_qdict(opts, options, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(errp, local_err);

        return -EINVAL;

    }

    ret = nfs_client_open(client, qemu_opt_get(opts, "filename"),

                          (flags & BDRV_O_RDWR) ? O_RDWR : O_RDONLY,

                          errp);

    if (ret < 0) {

        return ret;

    }

    bs->total_sectors = ret;

    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0, QDict *VAR_1, int VAR_2,

                         Error **VAR_3) {

    NFSClient *client = VAR_0->opaque;

    int64_t ret;

    QemuOpts *opts;

    Error *local_err = NULL;



    opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);

    qemu_opts_absorb_qdict(opts, VAR_1, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(VAR_3, local_err);

        return -EINVAL;

    }

    ret = nfs_client_open(client, qemu_opt_get(opts, "filename"),

                          (VAR_2 & BDRV_O_RDWR) ? O_RDWR : O_RDONLY,

                          VAR_3);

    if (ret < 0) {

        return ret;

    }

    VAR_0->total_sectors = ret;

    return 0;

}

static int FUNC_0(BlockDriverState *VAR_0, QDict *VAR_1, int VAR_2,
Error **VAR_3) { NFSClient *client = VAR_0->opaque; int64_t ret; QemuOpts *opts; Error *local_err = NULL; opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, VAR_1, &local_err); if (error_is_set(&local_err)) { error_propagate(VAR_3, local_err); return -EINVAL; } ret = nfs_client_open(client, qemu_opt_get(opts, "filename"),
(VAR_2 & BDRV_O_RDWR) ? O_RDWR : O_RDONLY,
VAR_3); if (ret < 0) { return ret; } VAR_0->total_sectors = ret; return 0; }