Skip to contentSkip to conversation

xen-tools: add a patch to address failures on 32 bit systems with 64 bit time_t

PATCH Bruce Ashfield 1 participant 1 message Apr 12, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

staged on master-next.

Bruce

In message: [meta-virtualization][PATCH] xen-tools: add a patch to address failures on 32 bit systems with 64 bit time_t

Quoted 95 lines · on 12/04/2023 Alexander Kanavin wrote:
---
 ...enstored_control.c-correctly-print-t.patch | 34 +++++++++++++++++++
 recipes-extended/xen/xen-tools_4.16.bb        |  3 +-
 recipes-extended/xen/xen-tools_4.17.bb        |  1 +
 recipes-extended/xen/xen-tools_git.bb         |  1 +
 4 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 recipes-extended/xen/files/0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch
recipes-extended/xen/files/0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch new file +34 -0
new file mode 100644
index 0000000..bf99f5e
@@ -0,0 +1,34 @@
+From c7c43c4531fe1cd188f62d9905c3f5c7a29a6fb0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Wed, 12 Apr 2023 10:30:18 +0200
+Subject: [PATCH] tools/xenstore/xenstored_control.c: correctly print time_t
+
+On 32 bit systems with 64 bit time_t (hello, Y2038 problem),
+the following error occurs otherwise:
+
+| xenstored_control.c: In function 'lu_reject_reason':
+| xenstored_control.c:646:70: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t' {aka 'long long int'} [-Werror=format=]
+
+Upstream-Status: Submitted [by email to [email protected] and maintainers as suggested by add_maintainers.pl script]
+Signed-off-by: Alexander Kanavin <[email protected]>
+---
+ tools/xenstore/xenstored_control.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/xenstore/xenstored_control.c b/tools/xenstore/xenstored_control.c
+index d1aaa00bf4..8d318c0399 100644
+--- a/tools/xenstore/xenstored_control.c
++++ b/tools/xenstore/xenstored_control.c
+@@ -643,10 +643,10 @@ static const char *lu_reject_reason(const void *ctx)
+ 	list_for_each_entry(conn, &connections, list) {
+ 		if (conn->ta_start_time &&
+ 		    (now - conn->ta_start_time >= lu_status->timeout)) {
+-			ret = talloc_asprintf(ctx, "%s\nDomain %u: %ld s",
++			ret = talloc_asprintf(ctx, "%s\nDomain %u: %jd s",
+ 					      ret ? : "Domains with long running transactions:",
+ 					      conn->id,
+-					      now - conn->ta_start_time);
++					      (intmax_t)now - conn->ta_start_time);
+ 		}
+ 	}
+ 
recipes-extended/xen/xen-tools_4.16.bb +2 -1
index 386e7dc..2861788 100644
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-python-pygrub-pass-DISTUTILS-xen-4.15.patch \
+    file://0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5"
@@ -20,4 +21,4 @@ require xen-tools.inc
 
 SYSTEMD_SERVICE:${PN}-xencommons:append = " \
     var-lib-xenstored.mount \
-    "
\ No newline at end of file
+    "
recipes-extended/xen/xen-tools_4.17.bb +1 -0
index 0f323cb..d0ab2db 100644
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-python-pygrub-pass-DISTUTILS-xen-4.15.patch \
+    file://0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
recipes-extended/xen/xen-tools_git.bb +1 -0
index fd42cf2..7557081 100644
@@ -7,6 +7,7 @@ XEN_BRANCH ?= "master"
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
     file://0001-python-pygrub-pass-DISTUTILS-xen-4.15.patch \
+    file://0001-tools-xenstore-xenstored_control.c-correctly-print-t.patch \
     "
 
 LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9"
Signature · 1 line
2.30.2