[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
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Jürgen Groß <jgross@xxxxxxxx>
- Date: Thu, 20 Feb 2020 10:07:06 +0100
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 20 Feb 2020 09:07:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|