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

[xen staging] public/io: xs_wire: Allow Xenstore to report EPERM



commit 8d578128393b9ee144b2c2deb4e0369556443686
Author:     Julien Grall <jgrall@xxxxxxxxxx>
AuthorDate: Thu Jun 30 19:37:34 2022 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Jun 30 19:37:54 2022 +0100

    public/io: xs_wire: Allow Xenstore to report EPERM
    
    C Xenstored is using EPERM when the client is not allowed to change
    the owner (see GET_PERMS). However, the xenstore protocol doesn't
    describe EPERM so EINVAL will be sent to the client.
    
    When writing test, it would be useful to differentiate between EINVAL
    (e.g. parsing error) and EPERM (i.e. no permission). So extend
    xsd_errors[] to support return EPERM.
    
    Looking at previous time xsd_errors was extended (8b2c441a1b), it was
    considered to be safe to add a new error because at least Linux driver
    and libxenstore treat an unknown error code as EINVAL.
    
    This statement doesn't cover other possible OSes, however I am not
    aware of any breakage.
    
    Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/include/public/io/xs_wire.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index c1ec7c73e3..b477bd0cd2 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -90,7 +90,8 @@ __attribute__((unused))
     XSD_ERROR(EBUSY),
     XSD_ERROR(EAGAIN),
     XSD_ERROR(EISCONN),
-    XSD_ERROR(E2BIG)
+    XSD_ERROR(E2BIG),
+    XSD_ERROR(EPERM),
 };
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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