usbfuzz-afl/qemu_mode/qemu/block/nfs.c
/* Note that this will not re-establish a connection with the NFS server
 * - it is effectively a NOP.  */
Note that this will not re-establish a connection with the NFS server
- it is effectively a NOP.
Note that this will not re - establish a connection with the NFS server - it is effectively a NOP .
static int nfs_reopen_prepare(BDRVReopenState *state,
                              BlockReopenQueue *queue, Error **errp)
{
    NFSClient *client = state->bs->opaque;
    struct stat st;
    int ret = 0;
    if (state->flags & BDRV_O_RDWR && bdrv_is_read_only(state->bs)) {
        error_setg(errp, "Cannot open a read-only mount as read-write");
        return -EACCES;
    }
    if ((state->flags & BDRV_O_NOCACHE) && client->cache_used) {
        error_setg(errp, "Cannot disable cache if libnfs readahead or"
                         " pagecache is enabled");
        return -EINVAL;
    }
    if (!(state->flags & BDRV_O_RDWR)) {
        ret = nfs_fstat(client->context, client->fh, &st);
        if (ret < 0) {
            error_setg(errp, "Failed to fstat file: %s",
                       nfs_get_error(client->context));
            return ret;
        }
        client->st_blocks = st.st_blocks;
    }
    return 0;
}
static int nfs_reopen_prepare ( BDRVReopenState * state , BlockReopenQueue * queue , Error * * errp ) { NFSClient * client = state -> bs -> opaque ; struct stat st ; int ret = 0 ; if ( state -> flags & BDRV_O_RDWR && bdrv_is_read_only ( state -> bs ) ) { error_setg ( errp , " " ) ; return - EACCES ; } if ( ( state -> flags & BDRV_O_NOCACHE ) && client -> cache_used ) { error_setg ( errp , " " " " ) ; return - EINVAL ; } if ( ! ( state -> flags & BDRV_O_RDWR ) ) { ret = nfs_fstat ( client -> context , client -> fh , & st ) ; if ( ret < 0 ) { error_setg ( errp , " " , nfs_get_error ( client -> context ) ) ; return ret ; } client -> st_blocks = st . st_blocks ; } return 0 ; }
Note that this will not re-establish a connection with the NFS server
 - it is effectively a NOP.
Note that this will not re - establish a connection with the NFS server - it is effectively a NOP .
/* Update cache for read-only reopens */