Message ID | 1462272910-41200-4-git-send-email-roger.pau@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > Avoid using system errno values when comparing with Xen errno values. > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> > --- > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > Cc: Ross Lagerwall <ross.lagerwall@citrix.com> > Cc: Ian Jackson <ian.jackson@eu.citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > --- > Using errno values inside of hypercall structs is not right IMHO, but there > are already several occurrences of this. Although I'm adding the correct XEN_ > prefixes here, it's very likely that new additions/modifications to this > file will not take this into account, breaking it for OSes != Linux. > --- > tools/misc/xen-xsplice.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c > index 598e492..81e422e 100644 > --- a/tools/misc/xen-xsplice.c > +++ b/tools/misc/xen-xsplice.c > @@ -13,6 +13,8 @@ > #include <xenctrl.h> > #include <xenstore.h> > > +#include <xen/errno.h> > + > static xc_interface *xch; > > void show_help(void) > @@ -233,7 +235,7 @@ struct { > .function = xc_xsplice_revert, > }, > { .allow = XSPLICE_STATE_CHECKED, > - .expected = -ENOENT, > + .expected = -XEN_ENOENT, > .name = "unload", > .function = xc_xsplice_unload, > }, > @@ -276,7 +278,7 @@ int action_func(int argc, char *argv[], unsigned int idx) > name, errno, strerror(errno)); > return -1; > } > - if ( status.rc == -EAGAIN ) > + if ( status.rc == -XEN_EAGAIN ) > { > fprintf(stderr, "%s failed. Operation already in progress\n", name); > return -1; > @@ -319,7 +321,7 @@ int action_func(int argc, char *argv[], unsigned int idx) > > if ( status.state != original_state ) > break; > - if ( status.rc && status.rc != -EAGAIN ) > + if ( status.rc && status.rc != -XEN_EAGAIN ) > { > rc = status.rc; > break; > -- > 2.6.4 (Apple Git-63) >
On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > Avoid using system errno values when comparing with Xen errno values. > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> And since Wei acked it I may as well put it in now after some tests. > --- > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > Cc: Ross Lagerwall <ross.lagerwall@citrix.com> > Cc: Ian Jackson <ian.jackson@eu.citrix.com> > Cc: Wei Liu <wei.liu2@citrix.com> > --- > Using errno values inside of hypercall structs is not right IMHO, but there > are already several occurrences of this. Although I'm adding the correct XEN_ > prefixes here, it's very likely that new additions/modifications to this > file will not take this into account, breaking it for OSes != Linux. > --- > tools/misc/xen-xsplice.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c > index 598e492..81e422e 100644 > --- a/tools/misc/xen-xsplice.c > +++ b/tools/misc/xen-xsplice.c > @@ -13,6 +13,8 @@ > #include <xenctrl.h> > #include <xenstore.h> > > +#include <xen/errno.h> > + > static xc_interface *xch; > > void show_help(void) > @@ -233,7 +235,7 @@ struct { > .function = xc_xsplice_revert, > }, > { .allow = XSPLICE_STATE_CHECKED, > - .expected = -ENOENT, > + .expected = -XEN_ENOENT, > .name = "unload", > .function = xc_xsplice_unload, > }, > @@ -276,7 +278,7 @@ int action_func(int argc, char *argv[], unsigned int idx) > name, errno, strerror(errno)); > return -1; > } > - if ( status.rc == -EAGAIN ) > + if ( status.rc == -XEN_EAGAIN ) > { > fprintf(stderr, "%s failed. Operation already in progress\n", name); > return -1; > @@ -319,7 +321,7 @@ int action_func(int argc, char *argv[], unsigned int idx) > > if ( status.state != original_state ) > break; > - if ( status.rc && status.rc != -EAGAIN ) > + if ( status.rc && status.rc != -XEN_EAGAIN ) > { > rc = status.rc; > break; > -- > 2.6.4 (Apple Git-63) >
On Tue, May 03, 2016 at 09:27:23AM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > > Avoid using system errno values when comparing with Xen errno values. > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > And since Wei acked it I may as well put it in now after some tests. > I don't expect it would make a difference on Linux, but more testing wouldn't hurt. Wei.
On Tue, May 03, 2016 at 02:29:20PM +0100, Wei Liu wrote: > On Tue, May 03, 2016 at 09:27:23AM -0400, Konrad Rzeszutek Wilk wrote: > > On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > > > Avoid using system errno values when comparing with Xen errno values. > > > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > > > > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > > > And since Wei acked it I may as well put it in now after some tests. > > > > I don't expect it would make a difference on Linux, but more testing > wouldn't hurt. Right. I stuck 'Reviewed-by' on all of them except the "libxl: fix usage of XEN_EOPNOTSUPP" And they are ready to be checked in (after I test them)- so just give me the heads up when you would like that. > > Wei.
On Tue, May 03, 2016 at 09:37:01AM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, May 03, 2016 at 02:29:20PM +0100, Wei Liu wrote: > > On Tue, May 03, 2016 at 09:27:23AM -0400, Konrad Rzeszutek Wilk wrote: > > > On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > > > > Avoid using system errno values when comparing with Xen errno values. > > > > > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > > > > > > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > > > > > And since Wei acked it I may as well put it in now after some tests. > > > > > > > I don't expect it would make a difference on Linux, but more testing > > wouldn't hurt. > > Right. I stuck 'Reviewed-by' on all of them except the > "libxl: fix usage of XEN_EOPNOTSUPP" > I stuck your reviewed-by to the 3 xsplice patches in my branch and queued up all 4 patches for committing. Wei.
On Wed, May 04, 2016 at 04:26:31PM +0100, Wei Liu wrote: > On Tue, May 03, 2016 at 09:37:01AM -0400, Konrad Rzeszutek Wilk wrote: > > On Tue, May 03, 2016 at 02:29:20PM +0100, Wei Liu wrote: > > > On Tue, May 03, 2016 at 09:27:23AM -0400, Konrad Rzeszutek Wilk wrote: > > > > On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > > > > > Avoid using system errno values when comparing with Xen errno values. > > > > > > > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > > > > > > > > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > > > > > > > And since Wei acked it I may as well put it in now after some tests. > > > > > > > > > > I don't expect it would make a difference on Linux, but more testing > > > wouldn't hurt. > > > > Right. I stuck 'Reviewed-by' on all of them except the > > "libxl: fix usage of XEN_EOPNOTSUPP" > > > > I stuck your reviewed-by to the 3 xsplice patches in my branch and > queued up all 4 patches for committing. Thanks. They are all tested from me as well. > > Wei.
On Tue, May 03, 2016 at 09:37:01AM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, May 03, 2016 at 02:29:20PM +0100, Wei Liu wrote: > > On Tue, May 03, 2016 at 09:27:23AM -0400, Konrad Rzeszutek Wilk wrote: > > > On Tue, May 03, 2016 at 12:55:07PM +0200, Roger Pau Monne wrote: > > > > Avoid using system errno values when comparing with Xen errno values. > > > > > > > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > > > > > > Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > > > > > And since Wei acked it I may as well put it in now after some tests. > > > > > > > I don't expect it would make a difference on Linux, but more testing > > wouldn't hurt. > > Right. I stuck 'Reviewed-by' on all of them except the > "libxl: fix usage of XEN_EOPNOTSUPP" I think you missed patch 5/6 (xen/xsplice: add ELFOSABI_FREEBSD as a supported OSABI for payloads), which also needs you reviewed-by. Thanks, Roger.
diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c index 598e492..81e422e 100644 --- a/tools/misc/xen-xsplice.c +++ b/tools/misc/xen-xsplice.c @@ -13,6 +13,8 @@ #include <xenctrl.h> #include <xenstore.h> +#include <xen/errno.h> + static xc_interface *xch; void show_help(void) @@ -233,7 +235,7 @@ struct { .function = xc_xsplice_revert, }, { .allow = XSPLICE_STATE_CHECKED, - .expected = -ENOENT, + .expected = -XEN_ENOENT, .name = "unload", .function = xc_xsplice_unload, }, @@ -276,7 +278,7 @@ int action_func(int argc, char *argv[], unsigned int idx) name, errno, strerror(errno)); return -1; } - if ( status.rc == -EAGAIN ) + if ( status.rc == -XEN_EAGAIN ) { fprintf(stderr, "%s failed. Operation already in progress\n", name); return -1; @@ -319,7 +321,7 @@ int action_func(int argc, char *argv[], unsigned int idx) if ( status.state != original_state ) break; - if ( status.rc && status.rc != -EAGAIN ) + if ( status.rc && status.rc != -XEN_EAGAIN ) { rc = status.rc; break;
Avoid using system errno values when comparing with Xen errno values. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Ross Lagerwall <ross.lagerwall@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> --- Using errno values inside of hypercall structs is not right IMHO, but there are already several occurrences of this. Although I'm adding the correct XEN_ prefixes here, it's very likely that new additions/modifications to this file will not take this into account, breaking it for OSes != Linux. --- tools/misc/xen-xsplice.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)