Message ID | 20220624165151.940-1-julien@xen.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | public/io: xs_wire: Allow Xenstore to report EPERM | expand |
On 24.06.2022 18:51, Julien Grall wrote: > --- a/xen/include/public/io/xs_wire.h > +++ b/xen/include/public/io/xs_wire.h > @@ -76,6 +76,7 @@ static struct xsd_errors xsd_errors[] > __attribute__((unused)) > #endif > = { > + XSD_ERROR(EPERM), > XSD_ERROR(EINVAL), > XSD_ERROR(EACCES), > XSD_ERROR(EEXIST), Inserting ahead of EINVAL looks to break xenstored_core.c:send_error(), which - legitimately or not - assumes EINVAL to be first. Jan
Hi Jan, On 27/06/2022 07:57, Jan Beulich wrote: > On 24.06.2022 18:51, Julien Grall wrote: >> --- a/xen/include/public/io/xs_wire.h >> +++ b/xen/include/public/io/xs_wire.h >> @@ -76,6 +76,7 @@ static struct xsd_errors xsd_errors[] >> __attribute__((unused)) >> #endif >> = { >> + XSD_ERROR(EPERM), >> XSD_ERROR(EINVAL), >> XSD_ERROR(EACCES), >> XSD_ERROR(EEXIST), > > Inserting ahead of EINVAL looks to break xenstored_core.c:send_error(), :(. > which - legitimately or not - assumes EINVAL to be first. I am not sure who else is relying on this. So I would consider this to be bake in the ABI. I think the minimum is to add a BUILD_BUG_ON() in send_error(). I will also move EPERM towards the end (I added first because EPERM is 1). Cheers,
On 27.06.22 12:00, Julien Grall wrote: > Hi Jan, > > On 27/06/2022 07:57, Jan Beulich wrote: >> On 24.06.2022 18:51, Julien Grall wrote: >>> --- a/xen/include/public/io/xs_wire.h >>> +++ b/xen/include/public/io/xs_wire.h >>> @@ -76,6 +76,7 @@ static struct xsd_errors xsd_errors[] >>> __attribute__((unused)) >>> #endif >>> = { >>> + XSD_ERROR(EPERM), >>> XSD_ERROR(EINVAL), >>> XSD_ERROR(EACCES), >>> XSD_ERROR(EEXIST), >> >> Inserting ahead of EINVAL looks to break xenstored_core.c:send_error(), > > :(. > >> which - legitimately or not - assumes EINVAL to be first. > > I am not sure who else is relying on this. So I would consider this to be bake > in the ABI. I think the minimum is to add a BUILD_BUG_ON() in send_error(). > > I will also move EPERM towards the end (I added first because EPERM is 1). I agree to both plans. Juergen
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h index c1ec7c73e3b1..c23b63cdfeaf 100644 --- a/xen/include/public/io/xs_wire.h +++ b/xen/include/public/io/xs_wire.h @@ -76,6 +76,7 @@ static struct xsd_errors xsd_errors[] __attribute__((unused)) #endif = { + XSD_ERROR(EPERM), XSD_ERROR(EINVAL), XSD_ERROR(EACCES), XSD_ERROR(EEXIST),