diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 79951a841f..07fbd21334 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -323,8 +323,8 @@ def _begin_user_module(self, name: str) -> None:
 #include "qapi/qmp/qdict.h"
 #include "qapi/dealloc-visitor.h"
 #include "qapi/error.h"
-#include "%(visit)s.h"
-#include "%(commands)s.h"
+#include "qapi/%(visit)s.h"
+#include "qapi/%(commands)s.h"
 ''',
                              commands=commands, visit=visit))
 
@@ -338,7 +338,7 @@ def _begin_user_module(self, name: str) -> None:
             # match .underscorify() in trace/meson.build
 
         self._genh.add(mcgen('''
-#include "%(types)s.h"
+#include "qapi/%(types)s.h"
 
 ''',
                              types=types))
@@ -353,8 +353,8 @@ def visit_begin(self, schema: QAPISchema) -> None:
                              c_prefix=c_name(self._prefix, protect=False)))
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
-#include "%(prefix)sqapi-commands.h"
-#include "%(prefix)sqapi-init-commands.h"
+#include "qapi/%(prefix)sqapi-commands.h"
+#include "qapi/%(prefix)sqapi-init-commands.h"
 
 void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
 {
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index d1f639981a..f3803c8afe 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -189,9 +189,9 @@ def _begin_user_module(self, name: str) -> None:
         visit = self._module_basename('qapi-visit', name)
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
-#include "%(prefix)sqapi-emit-events.h"
-#include "%(events)s.h"
-#include "%(visit)s.h"
+#include "qapi/%(prefix)sqapi-emit-events.h"
+#include "qapi/%(events)s.h"
+#include "qapi/%(visit)s.h"
 #include "qapi/compat-policy.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
@@ -201,7 +201,7 @@ def _begin_user_module(self, name: str) -> None:
                              prefix=self._prefix))
         self._genh.add(mcgen('''
 #include "qapi/util.h"
-#include "%(types)s.h"
+#include "qapi/%(types)s.h"
 ''',
                              types=types))
 
@@ -209,7 +209,7 @@ def visit_end(self) -> None:
         self._add_module('./emit', ' * QAPI Events emission')
         self._genc.preamble_add(mcgen('''
 #include "qemu/osdep.h"
-#include "%(prefix)sqapi-emit-events.h"
+#include "qapi/%(prefix)sqapi-emit-events.h"
 ''',
                                       prefix=self._prefix))
         self._genh.preamble_add(mcgen('''
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index 6a8abe0041..d24bd7ba08 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -363,6 +363,6 @@ def visit_include(self, name: str, info: Optional[QAPISourceInfo]) -> None:
         relname = os.path.relpath(self._module_filename(self._what, name),
                                   os.path.dirname(self._genh.fname))
         self._genh.preamble_add(mcgen('''
-#include "%(relname)s.h"
+#include "qapi/%(relname)s.h"
 ''',
                                       relname=relname))
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
index ac14b20f30..7b74db11ed 100644
--- a/scripts/qapi/introspect.py
+++ b/scripts/qapi/introspect.py
@@ -182,7 +182,7 @@ def __init__(self, prefix: str, unmask: bool):
         self._name_map: Dict[str, str] = {}
         self._genc.add(mcgen('''
 #include "qemu/osdep.h"
-#include "%(prefix)sqapi-introspect.h"
+#include "qapi/%(prefix)sqapi-introspect.h"
 
 ''',
                              prefix=prefix))
diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index 0dd0b00ada..19c8c9c18c 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -306,8 +306,8 @@ def _begin_user_module(self, name: str) -> None:
         self._genc.preamble_add(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
-#include "%(types)s.h"
-#include "%(visit)s.h"
+#include "qapi/%(types)s.h"
+#include "qapi/%(visit)s.h"
 ''',
                                       types=types, visit=visit))
         self._genh.preamble_add(mcgen('''
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 12f92e429f..06d89504ce 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -359,12 +359,12 @@ def _begin_user_module(self, name: str) -> None:
         self._genc.preamble_add(mcgen('''
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "%(visit)s.h"
+#include "qapi/%(visit)s.h"
 ''',
                                       visit=visit))
         self._genh.preamble_add(mcgen('''
 #include "qapi/qapi-builtin-visit.h"
-#include "%(types)s.h"
+#include "qapi/%(types)s.h"
 
 ''',
                                       types=types))
