[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 19/02/2020 16:26, Julien Grall wrote:

On 19/02/2020 08:11, Juergen Gross wrote:
+int hypfs_write_bool(struct hypfs_entry_leaf *leaf,
+                     XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen)
+    union {
+        char buf[8];
+        uint8_t u8;
+        uint16_t u16;
+        uint32_t u32;
+        uint64_t u64;
+    } u;
+    ASSERT(leaf->e.type == XEN_HYPFS_TYPE_UINT && leaf->e.size <= 8);

Shouldn't this be XEN_HYPFSW_TYPE_BOOL? But then, why are we allowing a boolean parameter to be held in a 64-bit value?

IHMO, a boolean should really be hold in a bool and nothing else.

After sending my e-mail, I realized the size of the bool is implementation defined. However, I think my point stands, it would be better to have a fixed size for bool (i.e 1) and deny all the other use.


Julien Grall

Xen-devel mailing list



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