Skip to contentSkip to conversation

target/i386: Fix broken build with WHPX enabled

PATCH In review Philippe Mathieu-Daudé 3 participants 3 messages Sep 18, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386: Fix broken build with WHPX enabled

The WHPX build is broken since commit 12e9493df92 which removed the "hw/boards.h" where MachineState is declared:

  $ ./configure \
     --enable-hax --enable-whpx
  $ make x86_64-softmmu/all
  [...]
    CC      x86_64-softmmu/target/i386/whpx-all.o
  target/i386/whpx-all.c: In function 'whpx_accel_init':
  target/i386/whpx-all.c:1378:25: error: dereferencing pointer to
  incomplete type 'MachineState' {aka 'struct MachineState'}
       whpx->mem_quota = ms->ram_size;
                           ^~
  make[1]: *** [rules.mak:69: target/i386/whpx-all.o] Error 1
    CC      x86_64-softmmu/trace/generated-helpers.o
  make[1]: Target 'all' not remade because of errors.
  make: *** [Makefile:471: x86_64-softmmu/all] Error 2

Restore this header, partially reverting commit 12e9493df92.

---
 target/i386/whpx-all.c | 1 +
 1 file changed, 1 insertion(+)
target/i386/whpx-all.c +1 -0
index 0c15241ae4..def0c28480 100644
@@ -18,6 +18,7 @@
 #include "sysemu/cpus.h"
 #include "sysemu/runstate.h"
 #include "qemu/main-loop.h"
+#include "hw/boards.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "migration/blocker.h"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Am 18.09.2019 um 14:11 schrieb Philippe Mathieu-Daudé:

Quoted 33 lines

The WHPX build is broken since commit 12e9493df92 which removed the "hw/boards.h" where MachineState is declared:

  $ ./configure \
     --enable-hax --enable-whpx
  $ make x86_64-softmmu/all
  [...]
    CC      x86_64-softmmu/target/i386/whpx-all.o
  target/i386/whpx-all.c: In function 'whpx_accel_init':
  target/i386/whpx-all.c:1378:25: error: dereferencing pointer to
  incomplete type 'MachineState' {aka 'struct MachineState'}
       whpx->mem_quota = ms->ram_size;
                           ^~
  make[1]: *** [rules.mak:69: target/i386/whpx-all.o] Error 1
    CC      x86_64-softmmu/trace/generated-helpers.o
  make[1]: Target 'all' not remade because of errors.
  make: *** [Makefile:471: x86_64-softmmu/all] Error 2

Restore this header, partially reverting commit 12e9493df92.

---
 target/i386/whpx-all.c | 1 +
 1 file changed, 1 insertion(+)
target/i386/whpx-all.c +0 -0
index 0c15241ae4..def0c28480 100644

target/i386/whpx-all.c line 24

Quoted 7 lines
target/i386/whpx-all.c +1 -0
@@ -18,6 +18,7 @@
 #include "sysemu/cpus.h"
 #include "sysemu/runstate.h"
 #include "qemu/main-loop.h"
+#include "hw/boards.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "migration/blocker.h"

Thank you for fixing this.

#2 lore raw
In reply to Philippe Mathieu-Daudé

Ah I though these would be enabled by default for x86 hosts. I guess we need another build entry in .Travis even if we can't test it there.

Quoted 45 lines · On Wed, 18 Sep 2019, 13:11 Philippe Mathieu-Daudé, <[email protected]> wrote:

The WHPX build is broken since commit 12e9493df92 which removed the "hw/boards.h" where MachineState is declared:

  $ ./configure \
     --enable-hax --enable-whpx
  $ make x86_64-softmmu/all
  [...]
    CC      x86_64-softmmu/target/i386/whpx-all.o
  target/i386/whpx-all.c: In function 'whpx_accel_init':
  target/i386/whpx-all.c:1378:25: error: dereferencing pointer to
  incomplete type 'MachineState' {aka 'struct MachineState'}
       whpx->mem_quota = ms->ram_size;
                           ^~
  make[1]: *** [rules.mak:69: target/i386/whpx-all.o] Error 1
    CC      x86_64-softmmu/trace/generated-helpers.o
  make[1]: Target 'all' not remade because of errors.
  make: *** [Makefile:471: x86_64-softmmu/all] Error 2

Restore this header, partially reverting commit 12e9493df92.

---
 target/i386/whpx-all.c | 1 +
 1 file changed, 1 insertion(+)
target/i386/whpx-all.c +1 -1
index 0c15241ae4..def0c28480 100644
@@ -18,6 +18,7 @@
 #include "sysemu/cpus.h"
 #include "sysemu/runstate.h"
 #include "qemu/main-loop.h"
+#include "hw/boards.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "migration/blocker.h"
--

2.20.1