summaryrefslogtreecommitdiff
blob: ea0b9134c68343482d789af0d99be6a991a138dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
https://bugs.gentoo.org/809092
https://github.com/checkpoint-restore/criu/commit/1c25914a5dd1eb385937dffdd85901c3f5e39b8c

From 1c25914a5dd1eb385937dffdd85901c3f5e39b8c Mon Sep 17 00:00:00 2001
From: Zeyad Yasser <zeyady98@gmail.com>
Date: Thu, 22 Jul 2021 11:39:34 +0200
Subject: [PATCH] protobuf: remove leading underscores from protobuf structs

Fixes: #1560

The latest protobuf-c compiler breaks CRIU because they removed
leading underscores from structs in 1.4.0.

This replaces those definitions with the standard generated structs.

v2: remove struct _VmaEntry, struct _CredsEntry and struct _CoreEntry

Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
---
 criu/include/irmap.h            | 8 +++++---
 criu/include/parasite-syscall.h | 8 +++-----
 criu/include/pstree.h           | 2 +-
 criu/include/rst_info.h         | 5 ++---
 criu/include/shmem.h            | 1 -
 criu/mem.c                      | 2 +-
 lib/c/criu.h                    | 3 ++-
 7 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/criu/include/irmap.h b/criu/include/irmap.h
index 033f71e372..188d753f4d 100644
--- a/criu/include/irmap.h
+++ b/criu/include/irmap.h
@@ -1,13 +1,15 @@
 #ifndef __CR_IRMAP__H__
 #define __CR_IRMAP__H__
+
+#include "images/fh.pb-c.h"
+
 char *irmap_lookup(unsigned int s_dev, unsigned long i_ino);
-struct _FhEntry;
 int irmap_queue_cache(unsigned int dev, unsigned long ino,
-		struct _FhEntry *fh);
+		FhEntry *fh);
 int irmap_predump_prep(void);
 int irmap_predump_run(void);
 int check_open_handle(unsigned int s_dev, unsigned long i_ino,
-		struct _FhEntry *f_handle);
+		FhEntry *f_handle);
 int irmap_load_cache(void);
 int irmap_scan_path_add(char *path);
 #endif
diff --git a/criu/include/parasite-syscall.h b/criu/include/parasite-syscall.h
index c86a724fd1..afba95a9e7 100644
--- a/criu/include/parasite-syscall.h
+++ b/criu/include/parasite-syscall.h
@@ -11,8 +11,6 @@ struct parasite_dump_misc;
 struct parasite_drain_fd;
 struct vm_area_list;
 struct pstree_item;
-struct _CredsEntry;
-struct _CoreEntry;
 struct list_head;
 struct cr_imgset;
 struct fd_opts;
@@ -31,11 +29,11 @@ extern int parasite_dump_posix_timers_seized(struct proc_posix_timers_stat *proc
 		struct parasite_ctl *ctl, struct pstree_item *);
 
 extern int parasite_dump_misc_seized(struct parasite_ctl *ctl, struct parasite_dump_misc *misc);
-extern int parasite_dump_creds(struct parasite_ctl *ctl, struct _CredsEntry *ce);
-extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, struct _CoreEntry *core);
+extern int parasite_dump_creds(struct parasite_ctl *ctl, CredsEntry *ce);
+extern int parasite_dump_thread_leader_seized(struct parasite_ctl *ctl, int pid, CoreEntry *core);
 extern int parasite_dump_thread_seized(struct parasite_thread_ctl *tctl,
 				       struct parasite_ctl *ctl, int id,
-				       struct pid *tid, struct _CoreEntry *core);
+				       struct pid *tid, CoreEntry *core);
 extern int dump_thread_core(int pid, CoreEntry *core,
 					const struct parasite_dump_thread *dt);
 
diff --git a/criu/include/pstree.h b/criu/include/pstree.h
index 61ab0ce0eb..17d22e791e 100644
--- a/criu/include/pstree.h
+++ b/criu/include/pstree.h
@@ -113,7 +113,7 @@ extern int prepare_task_entries(void);
 extern int prepare_dummy_task_state(struct pstree_item *pi);
 
 extern int get_task_ids(struct pstree_item *);
-extern struct _TaskKobjIdsEntry *root_ids;
+extern TaskKobjIdsEntry *root_ids;
 
 extern void core_entry_free(CoreEntry *core);
 extern CoreEntry *core_entry_alloc(int alloc_thread_info, int alloc_tc);
diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h
index 3283849e44..3dc119a931 100644
--- a/criu/include/rst_info.h
+++ b/criu/include/rst_info.h
@@ -5,6 +5,7 @@
 #include "common/list.h"
 #include "vma.h"
 #include "kerndat.h"
+#include "images/mm.pb-c.h"
 
 struct task_entries {
 	int nr_threads, nr_tasks, nr_helpers;
@@ -25,8 +26,6 @@ struct fdt {
 	futex_t			fdt_lock;
 };
 
-struct _MmEntry;
-
 struct rst_info {
 	struct list_head	fds;
 
@@ -40,7 +39,7 @@ struct rst_info {
 	struct fdt		*fdt;
 
 	struct vm_area_list	vmas;
-	struct _MmEntry		*mm;
+	MmEntry		*mm;
 	struct list_head	vma_io;
 	unsigned int		pages_img_id;
 
diff --git a/criu/include/shmem.h b/criu/include/shmem.h
index 9afdb799af..798e28f347 100644
--- a/criu/include/shmem.h
+++ b/criu/include/shmem.h
@@ -5,7 +5,6 @@
 #include "common/lock.h"
 #include "images/vma.pb-c.h"
 
-struct _VmaEntry;
 struct vma_area;
 
 extern int collect_shmem(int pid, struct vma_area *vma);
diff --git a/criu/mem.c b/criu/mem.c
index 9fabe4c470..b0a76e4da9 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -1230,7 +1230,7 @@ static int restore_priv_vma_content(struct pstree_item *t, struct page_read *pr)
 
 static int maybe_disable_thp(struct pstree_item *t, struct page_read *pr)
 {
-	struct _MmEntry *mm = rsti(t)->mm;
+	MmEntry *mm = rsti(t)->mm;
 
 	/*
 	 * There is no need to disable it if the page read doesn't
diff --git a/lib/c/criu.h b/lib/c/criu.h
index 3d64939584..d2bfbf958c 100644
--- a/lib/c/criu.h
+++ b/lib/c/criu.h
@@ -22,6 +22,7 @@
 #include <stdbool.h>
 
 #include "version.h"
+#include "rpc.pb-c.h"
 
 #ifdef __GNUG__
 	extern "C" {
@@ -112,7 +113,7 @@ void criu_set_pidfd_store_sk(int sk);
  * some non-existing one is reported.
  */
 
-typedef struct _CriuNotify *criu_notify_arg_t;
+typedef CriuNotify *criu_notify_arg_t;
 void criu_set_notify_cb(int (*cb)(char *action, criu_notify_arg_t na));
 
 /* Get pid of root task. 0 if not available */