qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-9.1?] qapi/util: Include missing 'qapi/error.h' header


From: Richard Henderson
Subject: Re: [PATCH-for-9.1?] qapi/util: Include missing 'qapi/error.h' header
Date: Wed, 7 Aug 2024 00:32:30 +1000
User-agent: Mozilla Thunderbird

On 8/6/24 22:41, Philippe Mathieu-Daudé wrote:
qapi_enum_parse() uses the Error type which is
declared in "qapi/error.h". Include "qapi/error.h"
in order to avoid:

   include/qapi/util.h:27:30: error: unknown type name 'Error'
                     int def, Error **errp);
                              ^

Note we include it after the QEnumLookup declaration
to avoid:

   In file included from include/qapi/error.h:275:
   qapi/qapi-types-error.h:30:14: error: unknown type name 'QEnumLookup'
   extern const QEnumLookup QapiErrorClass_lookup;
                ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/qapi/util.h | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/include/qapi/util.h b/include/qapi/util.h
index b8254247b8..568f31ac9e 100644
--- a/include/qapi/util.h
+++ b/include/qapi/util.h
@@ -22,6 +22,8 @@ typedef struct QEnumLookup {
      const int size;
  } QEnumLookup;
+#include "qapi/error.h"
+
  const char *qapi_enum_lookup(const QEnumLookup *lookup, int val);
  int qapi_enum_parse(const QEnumLookup *lookup, const char *buf,
                      int def, Error **errp);

Error is in qemu/typedefs.h, which is included from qemu/osdeps.h, which is 
always first.

There is should be no need for this patch.  Why do you think it is needed?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]