Skip to contentSkip to conversation

qga: Add multiple include guard to guest-agent-core.h

PATCH Applied Peter Maydell 4 participants 4 messages Nov 8, 2018 – Nov 9, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qga: Add multiple include guard to guest-agent-core.h

The guest-agent-core.h header was missing the usual guards against multiple inclusion; add them.

(Spotted by lgtm.com's static analyzer.)

---
 qga/guest-agent-core.h | 5 +++++
 1 file changed, 5 insertions(+)
qga/guest-agent-core.h +5 -0
index 6f4d214cb9f..60eae16f27a 100644
@@ -10,6 +10,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#ifndef GUEST_AGENT_CORE_H
+#define GUEST_AGENT_CORE_H
+
 #include "qapi/qmp/dispatch.h"
 #include "qemu-common.h"
 #include "qga-qapi-types.h"
@@ -46,3 +49,5 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp);
 #ifndef _WIN32
 void reopen_fd_to_null(int fd);
 #endif
+
+#endif /* GUEST_AGENT_CORE_H */
Signature · 1 line
2.19.1
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Peter Maydell

The guest-agent-core.h header was missing the usual guards against multiple inclusion; add them.

(Spotted by lgtm.com's static analyzer.)

Quoted 25 lines
---
  qga/guest-agent-core.h | 5 +++++
  1 file changed, 5 insertions(+)
qga/guest-agent-core.h +5 -0
index 6f4d214cb9f..60eae16f27a 100644
@@ -10,6 +10,9 @@
   * This work is licensed under the terms of the GNU GPL, version 2 or later.
   * See the COPYING file in the top-level directory.
   */
+#ifndef GUEST_AGENT_CORE_H
+#define GUEST_AGENT_CORE_H
+
  #include "qapi/qmp/dispatch.h"
  #include "qemu-common.h"
  #include "qga-qapi-types.h"
@@ -46,3 +49,5 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp);
  #ifndef _WIN32
  void reopen_fd_to_null(int fd);
  #endif
+
+#endif /* GUEST_AGENT_CORE_H */
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell

Hi

Quoted 5 lines · Peter Maydell

The guest-agent-core.h header was missing the usual guards against multiple inclusion; add them.

(Spotted by lgtm.com's static analyzer.)

neat,

Quoted 30 lines
---
 qga/guest-agent-core.h | 5 +++++
 1 file changed, 5 insertions(+)
qga/guest-agent-core.h +5 -1
index 6f4d214cb9f..60eae16f27a 100644
@@ -10,6 +10,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#ifndef GUEST_AGENT_CORE_H
+#define GUEST_AGENT_CORE_H
+
 #include "qapi/qmp/dispatch.h"
 #include "qemu-common.h"
 #include "qga-qapi-types.h"
@@ -46,3 +49,5 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp);
 #ifndef _WIN32
 void reopen_fd_to_null(int fd);
 #endif
+
+#endif /* GUEST_AGENT_CORE_H */
--

2.19.1

Signature · 1 line
Marc-André Lureau
Applied
#3 lore raw
In reply to Peter Maydell

Quoting Peter Maydell (2018-11-08 06:52:23)

Quoted 6 lines

The guest-agent-core.h header was missing the usual guards against multiple inclusion; add them.

(Spotted by lgtm.com's static analyzer.)

Thanks, applied to qga tree:
https://github.com/mdroth/qemu/commits/qga

Quoted 27 lines
---
 qga/guest-agent-core.h | 5 +++++
 1 file changed, 5 insertions(+)
qga/guest-agent-core.h +5 -0
index 6f4d214cb9f..60eae16f27a 100644
@@ -10,6 +10,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#ifndef GUEST_AGENT_CORE_H
+#define GUEST_AGENT_CORE_H
+
 #include "qapi/qmp/dispatch.h"
 #include "qemu-common.h"
 #include "qga-qapi-types.h"
@@ -46,3 +49,5 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp);
 #ifndef _WIN32
 void reopen_fd_to_null(int fd);
 #endif
+
+#endif /* GUEST_AGENT_CORE_H */
Signature · 1 line
2.19.1