diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2020-02-25 16:15:59 -0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-02-27 16:59:23 -0500 |
commit | f4eec68635bc516ce99c804bdc876f74dd4523fc (patch) | |
tree | 149b04d3a85851703a72346b9b9247e5ce025b3c /recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch | |
parent | 593df044c6a18ac3594215f5b93ecbc3ceab9f44 (diff) | |
download | meta-virtualization-f4eec68635bc516ce99c804bdc876f74dd4523fc.tar.gz |
xen, xen-tools: update recipes for python3
Adds patches for packaged scripts to enable deployment with python3
where they have been ported to python 3 upstream.
setuptools3 inherits distutils3 which modifies ${B}, so cd ${S} is
needed in the do_configure, do_compile and do_install steps.
Remove python 2 dependency from the Xen recipes by adding a new
separate recipe, xen-python2, for packaging the remaining optional
scripts which are yet to be ported to python 3. Package naming in
the separate recipe is chosen to support transition back into the
xen-tools recipe if the scripts are ported later.
Use RSUGGESTS to support inclusion of the xen-python2 scripts in
images that include python 2.
Drop the remus package python dependency since the script was removed
in 2014: commit 5b66f84e37a45038f9e5dae7a5768a5525d1e6ba
Add python3 RDEPENDS needed to run xenmon.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch')
-rw-r--r-- | recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch new file mode 100644 index 00000000..b32c5d06 --- /dev/null +++ b/recipes-extended/xen/files/xen-tools-python-fix-Wsign-compare-warnings.patch | |||
@@ -0,0 +1,136 @@ | |||
1 | From 88d703a361d34d75f81fc6d30b31d0abc8aa17eb Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= | ||
3 | <marmarek@invisiblethingslab.com> | ||
4 | Date: Fri, 9 Aug 2019 03:01:36 +0100 | ||
5 | Subject: [PATCH] python: fix -Wsign-compare warnings | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | Specifically: | ||
11 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_create’: | ||
12 | xen/lowlevel/xc/xc.c:147:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
13 | 147 | for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) | ||
14 | | ^ | ||
15 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_sethandle’: | ||
16 | xen/lowlevel/xc/xc.c:312:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
17 | 312 | for ( i = 0; i < sizeof(xen_domain_handle_t); i++ ) | ||
18 | | ^ | ||
19 | xen/lowlevel/xc/xc.c: In function ‘pyxc_domain_getinfo’: | ||
20 | xen/lowlevel/xc/xc.c:391:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
21 | 391 | for ( j = 0; j < sizeof(xen_domain_handle_t); j++ ) | ||
22 | | ^ | ||
23 | xen/lowlevel/xc/xc.c: In function ‘pyxc_get_device_group’: | ||
24 | xen/lowlevel/xc/xc.c:677:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] | ||
25 | 677 | for ( i = 0; i < num_sdevs; i++ ) | ||
26 | | ^ | ||
27 | xen/lowlevel/xc/xc.c: In function ‘pyxc_physinfo’: | ||
28 | xen/lowlevel/xc/xc.c:988:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
29 | 988 | for ( i = 0; i < sizeof(pinfo.hw_cap)/4; i++ ) | ||
30 | | ^ | ||
31 | xen/lowlevel/xc/xc.c:994:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
32 | 994 | for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ ) | ||
33 | | ^ | ||
34 | xen/lowlevel/xc/xc.c:998:24: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] | ||
35 | 998 | for ( i = 0; i < ARRAY_SIZE(virtcaps_bits); i++ ) | ||
36 | | ^ | ||
37 | xen/lowlevel/xs/xs.c: In function ‘xspy_ls’: | ||
38 | xen/lowlevel/xs/xs.c:191:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] | ||
39 | 191 | for (i = 0; i < xsval_n; i++) | ||
40 | | ^ | ||
41 | xen/lowlevel/xs/xs.c: In function ‘xspy_get_permissions’: | ||
42 | xen/lowlevel/xs/xs.c:297:23: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] | ||
43 | 297 | for (i = 0; i < perms_n; i++) { | ||
44 | | ^ | ||
45 | cc1: all warnings being treated as errors | ||
46 | |||
47 | Use size_t for loop iterators where it's compared with sizeof() or | ||
48 | similar construct. | ||
49 | |||
50 | Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | ||
51 | Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> | ||
52 | |||
53 | Modified to apply to Xen 4.12.2 by Christopher Clark | ||
54 | Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> | ||
55 | --- | ||
56 | tools/python/xen/lowlevel/xc/xc.c | 13 ++++++++----- | ||
57 | tools/python/xen/lowlevel/xs/xs.c | 4 ++-- | ||
58 | 2 files changed, 10 insertions(+), 7 deletions(-) | ||
59 | |||
60 | diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c | ||
61 | index 522cbe3b9c..188bfa34da 100644 | ||
62 | --- a/tools/python/xen/lowlevel/xc/xc.c | ||
63 | +++ b/tools/python/xen/lowlevel/xc/xc.c | ||
64 | @@ -117,7 +117,8 @@ static PyObject *pyxc_domain_create(XcObject *self, | ||
65 | PyObject *kwds) | ||
66 | { | ||
67 | uint32_t dom = 0, target = 0; | ||
68 | - int ret, i; | ||
69 | + int ret; | ||
70 | + size_t i; | ||
71 | PyObject *pyhandle = NULL; | ||
72 | struct xen_domctl_createdomain config = { | ||
73 | .handle = { | ||
74 | @@ -295,7 +296,7 @@ static PyObject *pyxc_vcpu_setaffinity(XcObject *self, | ||
75 | |||
76 | static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args) | ||
77 | { | ||
78 | - int i; | ||
79 | + size_t i; | ||
80 | uint32_t dom; | ||
81 | PyObject *pyhandle; | ||
82 | xen_domain_handle_t handle; | ||
83 | @@ -336,7 +337,8 @@ static PyObject *pyxc_domain_getinfo(XcObject *self, | ||
84 | PyObject *list, *info_dict, *pyhandle; | ||
85 | |||
86 | uint32_t first_dom = 0; | ||
87 | - int max_doms = 1024, nr_doms, i, j; | ||
88 | + int max_doms = 1024, nr_doms, i; | ||
89 | + size_t j; | ||
90 | xc_dominfo_t *info; | ||
91 | |||
92 | static char *kwd_list[] = { "first_dom", "max_doms", NULL }; | ||
93 | @@ -631,7 +633,8 @@ static PyObject *pyxc_get_device_group(XcObject *self, | ||
94 | { | ||
95 | uint32_t sbdf; | ||
96 | uint32_t max_sdevs, num_sdevs; | ||
97 | - int domid, seg, bus, dev, func, rc, i; | ||
98 | + int domid, seg, bus, dev, func, rc; | ||
99 | + size_t i; | ||
100 | PyObject *Pystr; | ||
101 | char *group_str; | ||
102 | char dev_str[9]; | ||
103 | @@ -971,7 +974,7 @@ static PyObject *pyxc_physinfo(XcObject *self) | ||
104 | { | ||
105 | xc_physinfo_t pinfo; | ||
106 | char cpu_cap[128], virt_caps[128], *p; | ||
107 | - int i; | ||
108 | + size_t i; | ||
109 | const char *virtcap_names[] = { "hvm", "hvm_directio" }; | ||
110 | |||
111 | if ( xc_physinfo(self->xc_handle, &pinfo) != 0 ) | ||
112 | diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c | ||
113 | index 9a0acfc25c..ea50f86bc3 100644 | ||
114 | --- a/tools/python/xen/lowlevel/xs/xs.c | ||
115 | +++ b/tools/python/xen/lowlevel/xs/xs.c | ||
116 | @@ -186,7 +186,7 @@ static PyObject *xspy_ls(XsHandle *self, PyObject *args) | ||
117 | Py_END_ALLOW_THREADS | ||
118 | |||
119 | if (xsval) { | ||
120 | - int i; | ||
121 | + size_t i; | ||
122 | PyObject *val = PyList_New(xsval_n); | ||
123 | for (i = 0; i < xsval_n; i++) | ||
124 | #if PY_MAJOR_VERSION >= 3 | ||
125 | @@ -276,7 +276,7 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args) | ||
126 | struct xs_handle *xh = xshandle(self); | ||
127 | struct xs_permissions *perms; | ||
128 | unsigned int perms_n = 0; | ||
129 | - int i; | ||
130 | + size_t i; | ||
131 | |||
132 | xs_transaction_t th; | ||
133 | char *thstr; | ||
134 | -- | ||
135 | 2.17.1 | ||
136 | |||