Since the colo stubs are needed exactly when the build options are not
enabled, move them together with the code they stub.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <
20240408155330.522792-16-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
--- /dev/null
+#include "qemu/osdep.h"
+#include "qemu/notify.h"
+#include "net/colo-compare.h"
+#include "migration/colo.h"
+#include "qemu/error-report.h"
+#include "qapi/qapi-commands-migration.h"
+
+void colo_shutdown(void)
+{
+}
+
+int coroutine_fn colo_incoming_co(void)
+{
+ return 0;
+}
+
+void colo_checkpoint_delay_set(void)
+{
+}
+
+void migrate_start_colo_process(MigrationState *s)
+{
+ error_report("Impossible happened: trying to start COLO when COLO "
+ "module is not built in");
+ abort();
+}
+
+bool migration_in_colo_state(void)
+{
+ return false;
+}
+
+bool migration_incoming_in_colo_state(void)
+{
+ return false;
+}
if get_option('replication').allowed()
system_ss.add(files('colo-failover.c', 'colo.c'))
+else
+ system_ss.add(files('colo-stubs.c'))
endif
system_ss.add(when: rdma, if_true: files('rdma.c'))
--- /dev/null
+#include "qemu/osdep.h"
+#include "qemu/notify.h"
+#include "net/colo-compare.h"
+
+void colo_compare_cleanup(void)
+{
+}
get_option('colo_proxy').allowed()
system_ss.add(files('colo-compare.c'))
system_ss.add(files('colo.c'))
+else
+ system_ss.add(files('colo-stubs.c'))
endif
if get_option('colo_proxy').allowed()
+++ /dev/null
-#include "qemu/osdep.h"
-#include "qemu/notify.h"
-#include "net/colo-compare.h"
-
-void colo_compare_cleanup(void)
-{
-}
+++ /dev/null
-#include "qemu/osdep.h"
-#include "qemu/notify.h"
-#include "net/colo-compare.h"
-#include "migration/colo.h"
-#include "qemu/error-report.h"
-#include "qapi/qapi-commands-migration.h"
-
-void colo_shutdown(void)
-{
-}
-
-int coroutine_fn colo_incoming_co(void)
-{
- return 0;
-}
-
-void colo_checkpoint_delay_set(void)
-{
-}
-
-void migrate_start_colo_process(MigrationState *s)
-{
- error_report("Impossible happened: trying to start COLO when COLO "
- "module is not built in");
- abort();
-}
-
-bool migration_in_colo_state(void)
-{
- return false;
-}
-
-bool migration_incoming_in_colo_state(void)
-{
- return false;
-}
stub_ss.add(files('target-monitor-defs.c'))
stub_ss.add(files('trace-control.c'))
stub_ss.add(files('uuid.c'))
-stub_ss.add(files('colo.c'))
-stub_ss.add(files('colo-compare.c'))
stub_ss.add(files('vmstate.c'))
stub_ss.add(files('vm-stop.c'))
stub_ss.add(files('win32-kbd-hook.c'))