Skip to contentSkip to conversation

linux-user: Fix compilation failure

PATCH Applied Peter Maydell 3 participants 3 messages Jun 27, 2013 – Jul 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Fix compilation failure

Fix compilation failures for linux-user targets following recent migration related commits bd2fa51fcd and 43487c67.

---
Longer term we should probably try to disentangle migration from user-mode emulators a bit better (eg hw.h should probably not pull in any of the migration headers if CONFIG_USER_ONLY); this is a minimal patch which fixes the compilation failures.

 exec.c                      |    2 +-
 include/hw/hw.h             |    1 -
 include/migration/vmstate.h |    2 ++
 3 files changed, 3 insertions(+), 2 deletions(-)
exec.c +1 -1
index 2e6fc00..f99041b 100644
@@ -2629,7 +2629,6 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr)
     return !(memory_region_is_ram(mr) ||
              memory_region_is_romd(mr));
 }
-#endif
 
 void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)
 {
@@ -2639,3 +2638,4 @@ void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)
         func(block->host, block->offset, block->length, opaque);
     }
 }
+#endif
include/hw/hw.h +0 -1
index cc9f847..33bdb92 100644
@@ -11,7 +11,6 @@
 #include "exec/ioport.h"
 #include "hw/irq.h"
 #include "block/aio.h"
-#include "migration/qemu-file.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
 
include/migration/vmstate.h +2 -0
index ebc4d09..1c31b5d 100644
@@ -26,7 +26,9 @@
 #ifndef QEMU_VMSTATE_H
 #define QEMU_VMSTATE_H 1
 
+#ifndef CONFIG_USER_ONLY
 #include <migration/qemu-file.h>
+#endif
 
 typedef void SaveStateHandler(QEMUFile *f, void *opaque);
 typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 49 lines · Peter Maydell

Fix compilation failures for linux-user targets following recent migration related commits bd2fa51fcd and 43487c67.

---
Longer term we should probably try to disentangle migration from user-mode emulators a bit better (eg hw.h should probably not pull in any of the migration headers if CONFIG_USER_ONLY); this is a minimal patch which fixes the compilation failures.

  exec.c                      |    2 +-
  include/hw/hw.h             |    1 -
  include/migration/vmstate.h |    2 ++
  3 files changed, 3 insertions(+), 2 deletions(-)
exec.c +1 -1
index 2e6fc00..f99041b 100644
@@ -2629,7 +2629,6 @@ bool cpu_physical_memory_is_io(hwaddr phys_addr)
      return !(memory_region_is_ram(mr) ||
               memory_region_is_romd(mr));
  }
-#endif
 
  void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)
  {
@@ -2639,3 +2638,4 @@ void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)
          func(block->host, block->offset, block->length, opaque);
      }
  }
+#endif
include/hw/hw.h +0 -1
index cc9f847..33bdb92 100644
@@ -11,7 +11,6 @@
  #include "exec/ioport.h"
  #include "hw/irq.h"
  #include "block/aio.h"
-#include "migration/qemu-file.h"
  #include "migration/vmstate.h"
  #include "qemu/log.h"
 
include/migration/vmstate.h +0 -0
index ebc4d09..1c31b5d 100644

include/migration/vmstate.h line 34

Quoted 9 lines
include/migration/vmstate.h +2 -0
@@ -26,7 +26,9 @@
  #ifndef QEMU_VMSTATE_H
  #define QEMU_VMSTATE_H 1
 
+#ifndef CONFIG_USER_ONLY
  #include <migration/qemu-file.h>
+#endif
 
  typedef void SaveStateHandler(QEMUFile *f, void *opaque);
  typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);

Thanks for the quick patch =)

- Michael