Skip to contentSkip to conversation

typedefs: move QIgvm out of typedefs.h

PATCH In review Paolo Bonzini 3 participants 4 messages Mar 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 typedefs: move QIgvm out of typedefs.h

Typedefs.h should only be used for really core types; QIgvm is just an opaque struct that is defined in system/igvm-internal.h, and the typedef itself can be placed simply in system/igvm.h.

---
 include/qemu/typedefs.h | 1 -
 include/system/igvm.h   | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/qemu/typedefs.h +0 -1
index cbe6f7f4c7c..416a8c9acea 100644
@@ -102,7 +102,6 @@ typedef struct QEMUSGList QEMUSGList;
 typedef struct QemuSpin QemuSpin;
 typedef struct QEMUTimer QEMUTimer;
 typedef struct QEMUTimerListGroup QEMUTimerListGroup;
-typedef struct QIgvm QIgvm;
 typedef struct QList QList;
 typedef struct QNull QNull;
 typedef struct QNum QNum;
include/system/igvm.h +2 -1
index f9231f03ec8..64d3542311a 100644
@@ -13,10 +13,11 @@
 #define BACKENDS_IGVM_H
 
 #include "hw/core/boards.h"
-#include "qemu/typedefs.h"
 #include "system/confidential-guest-support.h"
 #include "qapi/error.h"
 
+typedef struct QIgvm QIgvm;
+
 int qigvm_process_file(IgvmCfg *igvm, MachineState *machine_state,
                        bool onlyVpContext, Error **errp);
 
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 41 lines · Paolo Bonzini

Typedefs.h should only be used for really core types; QIgvm is just an opaque struct that is defined in system/igvm-internal.h, and the typedef itself can be placed simply in system/igvm.h.

---
include/qemu/typedefs.h | 1 -
include/system/igvm.h | 3 ++-

2 files changed, 2 insertions(+), 2 deletions(-)
include/qemu/typedefs.h +0 -1
index cbe6f7f4c7c..416a8c9acea 100644
@@ -102,7 +102,6 @@ typedef struct QEMUSGList QEMUSGList;
 typedef struct QemuSpin QemuSpin;
 typedef struct QEMUTimer QEMUTimer;
 typedef struct QEMUTimerListGroup QEMUTimerListGroup;
-typedef struct QIgvm QIgvm;
 typedef struct QList QList;
 typedef struct QNull QNull;
 typedef struct QNum QNum;
include/system/igvm.h +2 -1
index f9231f03ec8..64d3542311a 100644
@@ -13,10 +13,11 @@
 #define BACKENDS_IGVM_H
 
 #include "hw/core/boards.h"
-#include "qemu/typedefs.h"
 #include "system/confidential-guest-support.h"
 #include "qapi/error.h"
 
+typedef struct QIgvm QIgvm;
+
 int qigvm_process_file(IgvmCfg *igvm, MachineState *machine_state,
                       bool onlyVpContext, Error **errp);
 
Signature · 1 line
2.53.0

oops :) Thanks Paolo!

I wonder if we should move IgvmCfg as well?

#2 lore raw
Quoted 3 lines

oops :) Thanks Paolo!

I wonder if we should move IgvmCfg as well?

Yes, why not. target/i386/igvm.c does not include system/igvm-cfg.h so one has to make some choices unlike for this patch. It's probably easiest to just merge igvm-cfg.h and igvm.h into a single file.

Paolo

Quoted 2 lines
Reviewed-by on v1 1/1
#3 lore raw
In reply to Paolo Bonzini
Quoted 9 lines · Paolo Bonzini

Typedefs.h should only be used for really core types; QIgvm is just an opaque struct that is defined in system/igvm-internal.h, and the typedef itself can be placed simply in system/igvm.h.

---
  include/qemu/typedefs.h | 1 -
  include/system/igvm.h   | 3 ++-
  2 files changed, 2 insertions(+), 2 deletions(-)