igvm: fix build when igvm is not installed in a well known path
PATCH 1/1 igvm: fix build when igvm is not installed in a well known path
stubs/igvm.c includes igvm-internal.h, that in turn includes the igvm library. This is required just for the QIgvm declaration and creates an unnecessary dependency on the library.
Since igvm is not listed as a dependency of stubs, this results in build failing when the library is not installed in a "well known" path of the system.
Add a forward declaration for QIgvm and move the definition of qigvm_directive_madt to igvm.h so that we can drop igvm-internal.h from stubs/igvm.c.
--- include/qemu/typedefs.h | 1 + include/system/igvm-internal.h | 5 ----- include/system/igvm.h | 5 +++++ stubs/igvm.c | 1 - 4 files changed, 6 insertions(+), 6 deletions(-)
include/qemu/typedefs.h +1 -0
@@ -102,6 +102,7 @@ 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-internal.h +0 -5
@@ -74,9 +74,4 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp);QIgvmParameterData *qigvm_find_param_entry (QIgvm *igvm,uint32_t parameter_area_index); -/* -* IGVM parameter handlers -*/ -int qigvm_directive_madt (QIgvm *ctx,const uint8_t *header_data,Error **errp); -#endif
include/system/igvm.h +5 -0
@@ -27,4 +27,9 @@ int qigvm_x86_get_mem_map_entry(int index,int qigvm_x86_set_vp_context (void *data,int index,Error **errp); +/* +* IGVM parameter handlers +*/ +int qigvm_directive_madt (QIgvm *ctx,const uint8_t *header_data,Error **errp); +#endif
stubs/igvm.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/osdep.h" #include "system/igvm.h" -#include "system/igvm-internal.h" int qigvm_x86_get_mem_map_entry(int index, ConfidentialGuestMemoryMapEntry *entry,
---
base-commit: 333aaa55f051977cc897fb71e0a9ed52bb00a675
change-id: 20260305-master-e118b38e314e
Best regards,
Signature · 1 line
Luigi Leonardi <[email protected]>
Quoted 8 lines · Luigi Leonardi
stubs/igvm.cincludesigvm-internal.h, that in turn includes the igvm library. This is required just for the QIgvm declaration and creates an unnecessary dependency on the library.Since igvm is not listed as a dependency of stubs, this results in build failing when the library is not installed in a "well known" path of the system.
Quoted 6 lines
Add a forward declaration for QIgvm and move the definition of
qigvm_directive_madttoigvm.hso that we can dropigvm-internal.hfromstubs/igvm.c.Fixes dea1f68a5c ("igvm: Fill MADT IGVM parameter field on x86_64")
Usually we put all the tags back to back without extra new lines.
Quoted 14 lines
Suggested-by Stefano Garzarella <[email protected]>Signed-off-by Luigi Leonardi <[email protected]>---
include/qemu/typedefs.h | 1 + include/system/igvm-internal.h | 5 ----- include/system/igvm.h | 5 +++++ stubs/igvm.c | 1 - 4 files changed, 6 insertions(+), 6 deletions(-)include/qemu/typedefs.h +0
-0
include/qemu/typedefs.h typedef struct QEMUSGList QEMUSGList; · line 105
Quoted 4 lines
include/qemu/typedefs.h +1
-0@@ -102,6 +102,7 @@ typedef struct QEMUSGList QEMUSGList;typedef struct QemuSpin QemuSpin ;typedef struct QEMUTimer QEMUTimer ;typedef struct QEMUTimerListGroup QEMUTimerListGroup ; +typedef struct QIgvm QIgvm ;
So, should we remove the same typdef in include/system/igvm-internal.h like we already do for struct IgvmCfg where the typedef is only here.
Thanks,
Stefano
Quoted 52 lines
include/qemu/typedefs.h +0
-0typedef struct QList QList ;typedef struct QNull QNull ;typedef struct QNum QNum ;include/system/igvm-internal.h +0
-0@@ -74,9 +74,4 @@ IgvmHandle qigvm_file_init(char *filename, Error **errp);QIgvmParameterData*
qigvm_find_param_entry(QIgvm *igvm, uint32_t parameter_area_index);include/system/igvm-internal.h +0
-5-/* -* IGVM parameter handlers -*/ -int qigvm_directive_madt (QIgvm *ctx,const uint8_t *header_data,Error **errp); -#endif
include/system/igvm.h +5
-0@@ -27,4 +27,9 @@ int qigvm_x86_get_mem_map_entry(int index,int qigvm_x86_set_vp_context (void *data,int index,Error **errp); +/* +* IGVM parameter handlers +*/ +int qigvm_directive_madt (QIgvm *ctx,const uint8_t *header_data,Error **errp); +#endif stubs/igvm.c +0
-2@@ -12,7 +12,6 @@#include "qemu/osdep.h" #include "system/igvm.h" -#include "system/igvm-internal.h" int qigvm_x86_get_mem_map_entry(int index, ConfidentialGuestMemoryMapEntry *entry, ---base-commit:
333aaa55f051977cc897fb71e0a9ed52bb00a675
change-id: 20260305-master-e118b38e314eBest regards,
Signature · 1 line
Luigi Leonardi <[email protected]>
Quoted 9 lines · Stefano Garzarella
Quoted 8 lines · Luigi Leonardi
stubs/igvm.cincludesigvm-internal.h, that in turn includes the igvm library. This is required just for the QIgvm declaration and creates an unnecessary dependency on the library.Since igvm is not listed as a dependency of stubs, this results in build failing when the library is not installed in a "well known" path of the system.
Quoted 8 lines
Quoted 6 lines
Add a forward declaration for QIgvm and move the definition of
qigvm_directive_madttoigvm.hso that we can dropigvm-internal.hfromstubs/igvm.c.Fixes dea1f68a5c ("igvm: Fill MADT IGVM parameter field on x86_64")Usually we put all the tags back to back without extra new lines.
I'll make the change, thanks
Quoted 10 lines
Quoted 10 lines
Suggested-by Stefano Garzarella <[email protected]>Signed-off-by Luigi Leonardi <[email protected]>---
include/qemu/typedefs.h | 1 + include/system/igvm-internal.h | 5 ----- include/system/igvm.h | 5 +++++ stubs/igvm.c | 1 - 4 files changed, 6 insertions(+), 6 deletions(-)
Quoted 11 lines
include/qemu/typedefs.h typedef struct QEMUSGList QEMUSGList; · line 105
Quoted 9 lines
include/qemu/typedefs.h +1
-0@@ -102,6 +102,7 @@ typedef struct QEMUSGList QEMUSGList;typedef struct QemuSpin QemuSpin ;typedef struct QEMUTimer QEMUTimer ;typedef struct QEMUTimerListGroup QEMUTimerListGroup ; +typedef struct QIgvm QIgvm ;So, should we remove the same typdef in
include/system/igvm-internal.hlike we already do forstruct IgvmCfgwhere the typedef is only here.
Very good catch! Will do, thanks!
Luigi