qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/nfs: add knob to set readahead
@ 2014-06-23 14:30 Peter Lieven
  2014-06-23 15:11 ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Lieven @ 2014-06-23 14:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, Peter Lieven, ronniesahlberg, stefanha

upcoming libnfs will feature internal readahead support.
Add a knob to pass the optional readahead value as a URL
parameter.

This patch fixes also the incorrect usage of strncmp.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block/nfs.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/block/nfs.c b/block/nfs.c
index ec43201..a5c0577 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -309,12 +309,16 @@ static int64_t nfs_client_open(NFSClient *client, const char *filename,
                        qp->p[i].name);
             goto fail;
         }
-        if (!strncmp(qp->p[i].name, "uid", 3)) {
+        if (!strcmp(qp->p[i].name, "uid")) {
             nfs_set_uid(client->context, atoi(qp->p[i].value));
-        } else if (!strncmp(qp->p[i].name, "gid", 3)) {
+        } else if (!strcmp(qp->p[i].name, "gid")) {
             nfs_set_gid(client->context, atoi(qp->p[i].value));
-        } else if (!strncmp(qp->p[i].name, "tcp-syncnt", 10)) {
+        } else if (!strcmp(qp->p[i].name, "tcp-syncnt")) {
             nfs_set_tcp_syncnt(client->context, atoi(qp->p[i].value));
+#ifdef LIBNFS_FEATURE_READAHEAD
+        } else if (!strcmp(qp->p[i].name, "readahead")) {
+            nfs_set_readahead(client->context, atoi(qp->p[i].value));
+#endif
         } else {
             error_setg(errp, "Unknown NFS parameter name: %s",
                        qp->p[i].name);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-24  8:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 14:30 [Qemu-devel] [PATCH] block/nfs: add knob to set readahead Peter Lieven
2014-06-23 15:11 ` Eric Blake
2014-06-23 20:47   ` Peter Lieven
2014-06-23 21:05     ` Eric Blake
2014-06-24  8:53       ` Peter Lieven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).