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

Re: [Xen-devel] [PATCH v5 3/8] xen: add basic hypervisor filesystem support



On 20.02.20 09:43, Jan Beulich wrote:
On 20.02.2020 08:27, Jürgen Groß wrote:
On 19.02.20 16:49, Jan Beulich wrote:
On 19.02.2020 09:11, Juergen Gross wrote:
+static inline void hypfs_string_set(struct hypfs_entry_leaf *leaf,
+                                    const char *str)
+{
+    leaf->content = str;
+    leaf->e.size = strlen(str) + 1;
+}

This looks at least risky to me, as the function name does in
no way indicate that no copy of the string will be made. Hence
its use with e.g. .init.rodata contents or a stack variable
will not produce the intended result.

Okay, what about naming it hypfs_string_set_reference() ?

Hmm, a little better because of drawing more attention to it
due to the longish name. I'd be curious what others think here,
in particular towards the alternative of actually allocating
space and copying the string. If it is to remain as it is,
while the function body is small I still think you also want to
attach a comment to call out this behavior.

Okay.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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