[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 09/33] tools/xenlogd: add 9pfs walk request support



On 09.01.24 20:19, Jason Andryuk wrote:
On Thu, Jan 4, 2024 at 4:10 AM Juergen Gross <jgross@xxxxxxxx> wrote:

Add the walk request of the 9pfs protocol.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>

With one minor comment.

+    path = calloc(path_len + 1, 1);
+    if ( !path )
+    {
+        p9_error(ring, hdr->tag, ENOMEM);
+        goto out;
+    }
+    strcpy(path, fidp->path);
+
+    if ( n_names )
+    {
+        qids = calloc(n_names, sizeof(*qids));
+        if ( !qids )
+        {
+            p9_error(ring, hdr->tag, ENOMEM);
+            goto out;
+        }
+        for ( i = 0; i < n_names; i++ )
+        {
+            if (strcmp(path, "/"))
+                strcat(path, "/");

strcmp() can only return 0 on the first iteration, so it seems
inefficient to have it inside this loop.  But the added complexity to
avoid calling it doesn't seem worthwhile.

With storing the relative path in fidp->path this call can be dropped.


Juergen



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.