On Mon, May 25, 2026 at 01:56:57PM +0200, Luigi Leonardi wrote:
Use IgvmVariableHeaderType and IgvmHeaderSection in QIGVMHandler and
qigvm_handler() instead of plain uint32_t, so that each field's purpose
is clear from its type.

Signed-off-by: Luigi Leonardi <[email protected]>
---
backends/igvm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/backends/igvm.c b/backends/igvm.c
index c347d0c17e..8bb5750768 100644
--- a/backends/igvm.c
+++ b/backends/igvm.c
@@ -102,8 +102,8 @@ static int qigvm_initialization_guest_policy(QIgvm *ctx,
                                       Error **errp);

struct QIGVMHandler {
-    uint32_t type;
-    uint32_t section;
+    IgvmVariableHeaderType type;
+    IgvmHeaderSection section;
    int (*handler)(QIgvm *ctx, const uint8_t *header_data, Error **errp);
};

@@ -132,7 +132,7 @@ static struct QIGVMHandler handlers[] = {
      qigvm_directive_madt },
};

-static int qigvm_handler(QIgvm *ctx, uint32_t type, Error **errp)
+static int qigvm_handler(QIgvm *ctx, IgvmVariableHeaderType type, Error **errp)

Pre-existing, but since I was looking at the code. In all the place where we call qigvm_handler() we get `type` calling igvm_get_header_type() which returns int32_t (< 0 is an error IIUC). We convert to uint32_t without checking errors, maybe we can improve it.

That said, this patch LGTM:

Reviewed-by: Stefano Garzarella <[email protected]>

{
    size_t handler;
    IgvmHandle header_handle;

---
base-commit: cbf877d67a812be17a9ce404a589e1bdf722c1f6
change-id: 20260525-igvm_types-4b24d233e6bb

Best regards,
--
Luigi Leonardi <[email protected]>



Reply via email to