On Tue, May 17, 2016 at 04:11:55PM +0200, Peter Lieven wrote: > Signed-off-by: Peter Lieven <p...@kamp.de> > --- > block/nfs.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/block/nfs.c b/block/nfs.c > index 975510f..8b73a35 100644 > --- a/block/nfs.c > +++ b/block/nfs.c > @@ -331,6 +331,11 @@ static int64_t nfs_client_open(NFSClient *client, const > char *filename, > nfs_set_tcp_syncnt(client->context, val); > #ifdef LIBNFS_FEATURE_READAHEAD > } else if (!strcmp(qp->p[i].name, "readahead")) { > + if (open_flags & BDRV_O_NOCACHE) { > + error_setg(errp, "Cannot enable NFS readahead " > + "if cache.direct = on"); > + goto fail; > + } > if (val > QEMU_NFS_MAX_READAHEAD_SIZE) { > error_report("NFS Warning: Truncating NFS readahead" > " size to %d", QEMU_NFS_MAX_READAHEAD_SIZE); > -- > 1.9.1 >
Do we to check for cache mode changes now in nfs_reopen_prepare()?