hvmloader: Use xen/errno.h rather than the host systems errno.h
PATCH 1/1 hvmloader: Use xen/errno.h rather than the host systems errno.h
---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>
--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/firmware/hvmloader/xenbus.c +1 -1
@@ -27,7 +27,7 @@#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h> #include <xen/sched.h> #include <xen/event_channel.h> #include <xen/hvm/params.h>
Signature · 1 line
2.1.4
Quoted 8 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>
---
https://travis-ci.org/cardoe/xen/jobs/110249618 shows the patch in action getting past the previous problem.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 1 line · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>
Quoted 31 lines
---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/hvmloader/xenbus.c +1
-1@@ -27,7 +27,7 @@#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h> #include <xen/sched.h> #include <xen/event_channel.h> #include <xen/hvm/params.h> Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 16 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/hvmloader/xenbus.c +0
-0
tools/firmware/hvmloader/xenbus.c line 30
Quoted 5 lines
tools/firmware/hvmloader/xenbus.c +1
-1@@ -27,7 +27,7 @@#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h>
This doesn't seem to compile for me. Xen's error numbers live in a different name space.
Wei.
Quoted 6 lines
tools/firmware/hvmloader/xenbus.c +0
-0#include <xen/sched.h> #include <xen/event_channel.h> #include <xen/hvm/params.h> Signature · 1 line
2.1.4
Quoted 18 lines · Wei Liu
Quoted 17 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@
Quoted 6 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 4 lines
tools/firmware/hvmloader/xenbus.c +1
-1#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
It compiled fine for me. HVMLoader should use __XEN_TOOLS__.
Let me double check after a fully clean build.
~Andrew
Quoted 26 lines · Andrew Cooper
Quoted 18 lines · Wei Liu
Quoted 17 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@Quoted 6 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 4 lines
tools/firmware/hvmloader/xenbus.c +1
-1#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
Quoted 4 lines
It compiled fine for me. HVMLoader should use
__XEN_TOOLS__.Let me double check after a fully clean build.
On staging:
make[1]: Entering directory '/local/scratch/xen.git/tools/firmware/hvmloader'
gcc -O1 -fno-omit-frame-pointer -m32 -march=i686 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs -O0 -g3 -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .xenbus.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls -mno-tls-direct-seg-refs -Werror -fno-stack-protector -fno-exceptions -fno-builtin -msoft-float -I/local/scratch/xen.git/tools/firmware/hvmloader/../../../tools/include -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -DENABLE_ROMBIOS -DENABLE_SEABIOS -c -o xenbus.o xenbus.cxenbus.c: In function ‘xenbus_recv’:
xenbus.c:235:35: error: ‘xsd_errors’ undeclared (first use in this function)
for ( i = 0; i < ((sizeof xsd_errors) / (sizeof xsd_errors[0])); i++ )
^
xenbus.c:235:35: note: each undeclared identifier is reported only once for each function it appears in
xenbus.c:239:16: error: ‘EIO’ undeclared (first use in this function)
return EIO;
^
xenbus.c: In function ‘xenstore_write’:
xenbus.c:295:15: error: ‘EIO’ undeclared (first use in this function)
ret = EIO;
^/local/scratch/xen.git/tools/firmware/hvmloader/../../../tools/Rules.mk:191: recipe for target 'xenbus.o' failed make[1]: *** [xenbus.o] Error 1
make[1]: Leaving directory '/local/scratch/xen.git/tools/firmware/hvmloader'
Makefile:93: recipe for target 'all' failed
make: *** [all] Error 2
I actually had a similar patch stashed in my queue but that was the reason I never sent it out...
Wei.
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 27 lines · Andrew Cooper
Quoted 12 lines · Wei Liu
Quoted 11 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>
---
tools/firmware/hvmloader/xenbus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 11 lines
tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@
#include "util.h"
#include "hypercall.h"tools/firmware/hvmloader/xenbus.c +1
-1-#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
Quoted 1 line
It compiled fine for me. HVMLoader should use
__XEN_TOOLS__.
It shouldn't and doesn't, see 3237645813d7 which stopped setting __XEN_TOOLS__ globally for all of tools/* and consequently removed the -U__XEN_TOOLS__ from hvmloader.
In any case I don't think __XEN_TOOLS__ has any impact on xen/errno.h (which is, perhaps confusingly, xen/include/public/errno.h and not xen/include/xen/errno.h)
For normal userspace uses of __XEN_TOOLS__ you wouldn't want unprefixed Xen errno values added to your namespace anyway -- since you need to deal with OS errno names/values.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 32 lines · Ian Campbell
Quoted 20 lines · Andrew Cooper
Quoted 19 lines · Wei Liu
Quoted 18 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>--- tools/firmware/hvmloader/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@Quoted 7 lines
Quoted 6 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 4 lines
tools/firmware/hvmloader/xenbus.c +1
-1#include "util.h" #include "hypercall.h" -#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
It compiled fine for me. HVMLoader should use
__XEN_TOOLS__.It shouldn't and doesn't, see
3237645813d7which stopped setting__XEN_TOOLS__globally for all oftools/*and consequently removed the -U__XEN_TOOLS__ from hvmloader.
Quoted 7 lines
In any case I don't think
__XEN_TOOLS__has any impact onxen/errno.h(which is, perhaps confusingly,xen/include/public/errno.hand notxen/include/xen/errno.h)For normal userspace uses of
__XEN_TOOLS__you wouldn't want unprefixed Xen errno values added to your namespace anyway -- since you need to deal with OS errno names/values.
HVMloader is an unhosted 32bit environment, which is why it should not be using the hosts errno.h in the first place.
~Andrew
Quoted 37 lines · Andrew Cooper
Quoted 36 lines · Ian Campbell
Quoted 26 lines · Andrew Cooper
Quoted 12 lines · Wei Liu
Quoted 11 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>
---
tools/firmware/hvmloader/xenbus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 11 lines
tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@
#include "util.h"
#include "hypercall.h"tools/firmware/hvmloader/xenbus.c +1
-1-#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
Quoted 1 line
It compiled fine for me. HVMLoader should use
__XEN_TOOLS__.It shouldn't and doesn't, see
3237645813d7which stopped setting__XEN_TOOLS__globally for all oftools/*and consequently removed the -U__XEN_TOOLS__ from hvmloader.In any case I don't think
__XEN_TOOLS__has any impact onxen/errno.h(which is, perhaps confusingly,xen/include/public/errno.hand notxen/include/xen/errno.h)
Quoted 8 lines
Quoted 5 lines
For normal userspace uses of
__XEN_TOOLS__you wouldn't want unprefixed Xen
errno values added to your namespace anyway -- since you need to deal with
OS errno names/values.HVMloader is an unhosted 32bit environment, which is why it should not be using the hosts
errno.hin the first place.
Of course I know this, and it has nothing to do with anything I explained above.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 12 lines · Wei Liu
Quoted 11 lines · Andrew Cooper
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Doug Goldstein <[email protected]>
---
tools/firmware/hvmloader/xenbus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
tools/firmware/hvmloader/xenbus.c line 30
Quoted 11 lines
tools/firmware/hvmloader/xenbus.c +0
-0@@ -27,7 +27,7 @@
#include "util.h"
#include "hypercall.h"tools/firmware/hvmloader/xenbus.c +1
-1-#include <errno.h> +#include <xen/errno.h> This doesn't seem to compile for me. Xen's error numbers live in a different name space.
Indeed.
Either all the codes in hvmloader would need updating or it needs to play the same trick as xen/include/xen/errno.h.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel