summaryrefslogtreecommitdiff
path: root/0125-fix-clang-build-error.patch
blob: ca8f9f6e197b094ed82cb8a6ffee171e004aba3e (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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
From d141d8bfc7a602b0f139bef42a1c73dc673687de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AD=A6=E7=A7=AF=E8=B6=85?= <wujichao1@huawei.com>
Date: Mon, 21 Oct 2024 19:39:38 +0800
Subject: [PATCH] fix-clang-build-error

---
 src/daemon/common/cri/cri_helpers.cc                   |  4 ++--
 src/daemon/entry/cri/streams/stream_server.h           |  4 ++--
 .../entry/cri/v1/v1_cri_container_manager_service.cc   |  2 +-
 .../entry/cri/v1/v1_cri_image_manager_service_impl.cc  |  2 +-
 .../entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc | 10 +++++-----
 src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h  |  2 +-
 .../entry/cri/v1alpha/cri_container_manager_service.cc |  2 +-
 .../cri/v1alpha/cri_pod_sandbox_manager_service.cc     |  6 +++---
 src/daemon/sandbox/sandbox.cc                          |  2 +-
 src/daemon/sandbox/sandbox_ops.cc                      |  2 +-
 10 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/daemon/common/cri/cri_helpers.cc b/src/daemon/common/cri/cri_helpers.cc
index 8117403c..a8cbd996 100644
--- a/src/daemon/common/cri/cri_helpers.cc
+++ b/src/daemon/common/cri/cri_helpers.cc
@@ -525,8 +525,8 @@ void RemoveContainerLogSymlink(const std::string &containerID, Errors &error)
     if (!path.empty()) {
         // Only remove the symlink when container log path is specified.
         if (util_path_remove(path.c_str()) != 0 && errno != ENOENT) {
-            SYSERROR("Failed to remove container %s log symlink %s.", containerID.c_str(), path);
-            error.Errorf("Failed to remove container %s log symlink %s.", containerID.c_str(), path);
+            SYSERROR("Failed to remove container %s log symlink %s.", containerID.c_str(), path.c_str());
+            error.Errorf("Failed to remove container %s log symlink %s.", containerID.c_str(), path.c_str());
         }
     }
 }
diff --git a/src/daemon/entry/cri/streams/stream_server.h b/src/daemon/entry/cri/streams/stream_server.h
index 81aa9987..028dfc84 100644
--- a/src/daemon/entry/cri/streams/stream_server.h
+++ b/src/daemon/entry/cri/streams/stream_server.h
@@ -17,6 +17,8 @@
 #include "errors.h"
 #include "url.h"
 
+url::URLDatum cri_stream_server_url(void);
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -27,8 +29,6 @@ void cri_stream_server_wait(void);
 
 void cri_stream_server_shutdown(void);
 
-url::URLDatum cri_stream_server_url(void);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
index d3fdd76a..1e84d14c 100644
--- a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
@@ -744,7 +744,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
             CRIHelpersV1::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
         container->set_state(state);
 
-        containers.push_back(move(container));
+        containers.push_back(std::move(container));
     }
 }
 
diff --git a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
index 71918706..561a40d5 100644
--- a/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_image_manager_service_impl.cc
@@ -149,7 +149,7 @@ void ImageManagerServiceImpl::list_images_to_grpc(im_list_response *response,
 
         imagetool_image_summary *element = list_images->images[i];
         conv_image_to_grpc(element, image);
-        images.push_back(move(image));
+        images.push_back(std::move(image));
     }
 }
 
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index b629b1c3..a5f98619 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -536,7 +536,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
     if (CRIHelpers::FiltersAddLabel(list_request->filters, CRIHelpers::Constants::SANDBOX_ID_LABEL_KEY,
                                     readSandboxID) != 0) {
         std::string tmp_errmsg = "Failed to add label in sandbox" + readSandboxID;
-        ERROR(tmp_errmsg.c_str());
+        ERROR("%s", tmp_errmsg.c_str());
         errors.push_back(tmp_errmsg);
         return nullptr;
     }
@@ -551,7 +551,7 @@ auto PodSandboxManagerService::GetContainerListResponse(const std::string &readS
     }
     if (ret != 0) {
         if (list_response != nullptr && list_response->errmsg != nullptr) {
-            ERROR(list_response->errmsg);
+            ERROR("%s", list_response->errmsg);
             errors.push_back(list_response->errmsg);
         } else {
             ERROR("Failed to call list container callback");
@@ -1218,7 +1218,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
         return;
     }
 
-    podStats = move(podStatsPtr);
+    podStats = std::move(podStatsPtr);
     return;
 }
 
@@ -1227,7 +1227,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
                                                Errors &error) -> std::unique_ptr<runtime::v1::PodSandboxStats>
 {
     Errors tmpErr;
-    cgroup_metrics_t cgroupMetrics { 0 };
+    cgroup_metrics_t cgroupMetrics {{ 0 }};
     std::vector<Network::NetworkInterfaceStats> netMetrics;
     std::map<std::string, std::string> annotations;
     std::unique_ptr<runtime::v1::PodSandboxStats> podStats { nullptr };
@@ -1368,7 +1368,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1::PodSandbox
             continue;
         }
 
-        podsStats.push_back(move(podStats));
+        podsStats.push_back(std::move(podStats));
     }
 }
 
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
index 3d93c7bb..33539a32 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
@@ -104,7 +104,7 @@ protected:
 private:
     std::string m_podSandboxImage;
     std::shared_ptr<Network::PluginManager> m_pluginManager { nullptr };
-    bool m_enablePodEvents;
+    [[maybe_unused]] bool m_enablePodEvents;
 };
 } // namespace CRIV1
 #endif // DAEMON_ENTRY_CRI_V1_CRI_RUNTIME_SERVICE_IMPL_H
diff --git a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
index dbefa143..97acecd9 100644
--- a/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_container_manager_service.cc
@@ -687,7 +687,7 @@ void ContainerManagerService::ListContainersToGRPC(container_list_response *resp
             CRIHelpersV1Alpha::ContainerStatusToRuntime(Container_Status(response->containers[i]->status));
         container->set_state(state);
 
-        pods.push_back(move(container));
+        pods.push_back(std::move(container));
     }
 }
 
diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index 1c343cda..3c128645 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -1573,7 +1573,7 @@ void PodSandboxManagerService::PodSandboxStatsToGRPC(const std::string &id, cons
         return;
     }
 
-    podStats = move(podStatsPtr);
+    podStats = std::move(podStatsPtr);
     return;
 }
 
@@ -1583,7 +1583,7 @@ auto PodSandboxManagerService::PodSandboxStats(const std::string &podSandboxID,
 {
     Errors tmpErr;
     container_inspect *inspectData { nullptr };
-    cgroup_metrics_t cgroupMetrics { 0 };
+    cgroup_metrics_t cgroupMetrics {{ 0 }};
     std::vector<Network::NetworkInterfaceStats> netMetrics;
     std::map<std::string, std::string> annotations;
     std::unique_ptr<runtime::v1alpha2::PodSandboxStats> podStats { nullptr };
@@ -1733,7 +1733,7 @@ void PodSandboxManagerService::ListPodSandboxStats(const runtime::v1alpha2::PodS
             continue;
         }
 
-        podsStats.push_back(move(podStats));
+        podsStats.push_back(std::move(podStats));
     }
 }
 
diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc
index d44abb99..dec082bc 100644
--- a/src/daemon/sandbox/sandbox.cc
+++ b/src/daemon/sandbox/sandbox.cc
@@ -847,7 +847,7 @@ auto Sandbox::SaveState(Errors &error) -> bool
 
     nret = util_atomic_write_file(path.c_str(), stateJson.c_str(), stateJson.length(), CONFIG_FILE_MODE, false);
     if (nret != 0) {
-        SYSERROR("Failed to write file %s");
+        SYSERROR("Failed to write file %s", path.c_str());
         error.Errorf("Failed to write file %s", path.c_str());
         return false;
     }
diff --git a/src/daemon/sandbox/sandbox_ops.cc b/src/daemon/sandbox/sandbox_ops.cc
index b7fb40bf..22cfea95 100644
--- a/src/daemon/sandbox/sandbox_ops.cc
+++ b/src/daemon/sandbox/sandbox_ops.cc
@@ -72,7 +72,7 @@ static int do_sandbox_prepare(const container_config_v2_common_config *config,
 
     params.containerId = config->id;
     params.execId = (nullptr == exec_id) ? "" : exec_id;
-    params.spec = std::move(std::unique_ptr<std::string>(new std::string(oci_spec)));
+    params.spec = std::unique_ptr<std::string>(new std::string(oci_spec));
 
     if (generate_ctrl_rootfs(params, config) != 0) {
         ERROR("Invalid rootfs");
-- 
2.25.1