Skip to contentSkip to conversation

qom/object: Remove circular include dependency

PATCH Applied Philippe Mathieu-Daudé 6 participants 7 messages May 9, 2022 – Jun 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom/object: Remove circular include dependency

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

---
 include/qom/object.h | 1 -
 1 file changed, 1 deletion(-)
include/qom/object.h +0 -1
index 5f3d5b5bf5..ef7258a5e1 100644
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-builtin-types.h"
 #include "qemu/module.h"
-#include "qom/object.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

Quoted 16 lines
---
  include/qom/object.h | 1 -
  1 file changed, 1 deletion(-)
include/qom/object.h +0 -1
index 5f3d5b5bf5..ef7258a5e1 100644
@@ -16,7 +16,6 @@
 
  #include "qapi/qapi-builtin-types.h"
  #include "qemu/module.h"
-#include "qom/object.h"
 
  struct TypeImpl;
  typedef struct TypeImpl *Type;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 15 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

---
 include/qom/object.h | 1 -
 1 file changed, 1 deletion(-)
include/qom/object.h +0 -0
index 5f3d5b5bf5..ef7258a5e1 100644

include/qom/object.h line 21

Quoted 7 lines
include/qom/object.h +0 -1
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-builtin-types.h"
 #include "qemu/module.h"
-#include "qom/object.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;

Accidentally (but harmlessly) added in commit db1015e92e0483 by a change generated by a script.

Eduardo: is it worth making ./scripts/codeconverter/converter.py handle this as a special case, so it doesn't add the include line to qom/object.h itself ? Or do we not really expect that script to be run on the codebase again in future ?

thanks
-- PMM

Reviewed-by on v1 1/1
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 14 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

---
 include/qom/object.h | 1 -
 1 file changed, 1 deletion(-)
include/qom/object.h +0 -0
index 5f3d5b5bf5..ef7258a5e1 100644

include/qom/object.h line 21

Quoted 7 lines
include/qom/object.h +0 -1
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-builtin-types.h"
 #include "qemu/module.h"
-#include "qom/object.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;

I figure this is scripts/codeconverter/converter.py's doing, in commit db1015e92e "Move QOM typedefs and add missing includes". Probably not worth fixing there. Possibly worth mentioning in the commit message.

#3 lore raw
In reply to Peter Maydell
Quoted 18 lines · Peter Maydell
Quoted 16 lines · Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

---
  include/qom/object.h | 1 -
  1 file changed, 1 deletion(-)
include/qom/object.h +0 -0
index 5f3d5b5bf5..ef7258a5e1 100644
@@ -16,7 +16,6 @@
 
Quoted 8 lines

include/qom/object.h line 21

Quoted 6 lines
include/qom/object.h +0 -1
  #include "qapi/qapi-builtin-types.h"
  #include "qemu/module.h"
-#include "qom/object.h"
 
  struct TypeImpl;
  typedef struct TypeImpl *Type;

Accidentally (but harmlessly)

This makes crash clang tools such clang-format, I'll amend that to the description.

Quoted 9 lines

added in commit db1015e92e0483 by a
change generated by a script.

Eduardo: is it worth making ./scripts/codeconverter/converter.py handle this as a special case, so it doesn't add the include line to qom/object.h itself ? Or do we not really expect that script to be run on the codebase again in future ?

Oh, I see required_identifiers() adding this include in scripts/codeconverter/codeconverter/qom_macros.py.

If we do not expect to use these scripts, we should remove it from the repository. They are in good shape however, and might be still valuable, so I'll amend a fix to the script.

Thanks for pointing at these scripts,

Phil.

#4 lore raw
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 1 line · Peter Maydell

Accidentally (but harmlessly)

This makes crash clang tools such clang-format, I'll amend that to the description.

That sounds like a bug in clang-format :-)

-- PMM

#6 lore raw
In reply to Philippe Mathieu-Daudé

Le 09/05/2022 à 10:46, Philippe Mathieu-Daudé a écrit :

Quoted 14 lines

From: Philippe Mathieu-Daudé <[email protected]>

"qom/object.h" doesn't need to include itself.

---
  include/qom/object.h | 1 -
  1 file changed, 1 deletion(-)
include/qom/object.h +0 -0
index 5f3d5b5bf5..ef7258a5e1 100644

include/qom/object.h line 21

Quoted 7 lines
include/qom/object.h +0 -1
@@ -16,7 +16,6 @@
 
  #include "qapi/qapi-builtin-types.h"
  #include "qemu/module.h"
-#include "qom/object.h"
 
  struct TypeImpl;
  typedef struct TypeImpl *Type;

Applied to my trivial-patches branch.

Thanks,
Laurent