After commit 71cab1a42d2 removed the indirect include of
exec/cpu-defs.h from target/loongarch/cpu.h, the TARGET_FMT_lx
macro is no longer visible in kvm.c, causing build failures:
error: expected ')' before TARGET_FMT_lx
Add the missing #include exec/cpu-defs.h to restore the
TARGET_FMT_lx definition.
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
target/loongarch/kvm/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c
index 9d844c4905..4af4ab2ed0 100644
--- a/target/loongarch/kvm/kvm.c
+++ b/target/loongarch/kvm/kvm.c
@@ -6,6 +6,7 @@
*/
#include "qemu/osdep.h"
+#include "exec/target_long.h"
#include <sys/ioctl.h>
#include <linux/kvm.h>
#include "asm-loongarch/kvm_para.h"
--
2.20.1
在 2026/5/12 下午9:11, Qiang Ma 写道: > After commit 71cab1a42d2 removed the indirect include of > exec/cpu-defs.h from target/loongarch/cpu.h, the TARGET_FMT_lx > macro is no longer visible in kvm.c, causing build failures: > > error: expected ')' before TARGET_FMT_lx > > Add the missing #include exec/cpu-defs.h to restore the > TARGET_FMT_lx definition. Hi, The commit message does not match the changes. > Signed-off-by: Qiang Ma <maqianga@uniontech.com> > --- > target/loongarch/kvm/kvm.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c > index 9d844c4905..4af4ab2ed0 100644 > --- a/target/loongarch/kvm/kvm.c > +++ b/target/loongarch/kvm/kvm.c > @@ -6,6 +6,7 @@ > */ > > #include "qemu/osdep.h" > +#include "exec/target_long.h" Reviewed-by: Song Gao <gaosong@loongson.cn> Thanks. Song Gao > #include <sys/ioctl.h> > #include <linux/kvm.h> > #include "asm-loongarch/kvm_para.h"
On 13/5/26 03:11, gaosong wrote: > 在 2026/5/12 下午9:11, Qiang Ma 写道: >> After commit 71cab1a42d2 removed the indirect include of >> exec/cpu-defs.h from target/loongarch/cpu.h, the TARGET_FMT_lx >> macro is no longer visible in kvm.c, causing build failures: >> >> error: expected ')' before TARGET_FMT_lx >> >> Add the missing #include exec/cpu-defs.h to restore the >> TARGET_FMT_lx definition. > Hi, > The commit message does not match the changes. Otherwise: Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> >> Signed-off-by: Qiang Ma <maqianga@uniontech.com> >> --- >> target/loongarch/kvm/kvm.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c >> index 9d844c4905..4af4ab2ed0 100644 >> --- a/target/loongarch/kvm/kvm.c >> +++ b/target/loongarch/kvm/kvm.c >> @@ -6,6 +6,7 @@ >> */ >> #include "qemu/osdep.h" >> +#include "exec/target_long.h" > Reviewed-by: Song Gao <gaosong@loongson.cn> > > Thanks. > Song Gao >> #include <sys/ioctl.h> >> #include <linux/kvm.h> >> #include "asm-loongarch/kvm_para.h" >
© 2016 - 2026 Red Hat, Inc.