6ee9df2
From 282634a835f4711c8b501dd76c344058bc399fbd Mon Sep 17 00:00:00 2001
6ee9df2
From: Juan Quintela <quintela@redhat.com>
6ee9df2
Date: Wed, 1 Mar 2023 21:18:45 +0100
6ee9df2
Subject: [PATCH 23/56] migration: Create options.c
6ee9df2
MIME-Version: 1.0
6ee9df2
Content-Type: text/plain; charset=UTF-8
6ee9df2
Content-Transfer-Encoding: 8bit
6ee9df2
6ee9df2
RH-Author: Peter Xu <peterx@redhat.com>
6ee9df2
RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types
6ee9df2
RH-Bugzilla: 2057267
6ee9df2
RH-Acked-by: Leonardo BrĂ¡s <leobras@redhat.com>
6ee9df2
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
6ee9df2
RH-Acked-by: quintela1 <quintela@redhat.com>
6ee9df2
RH-Commit: [22/50] 10c9be528b9fcfae93f1a12fcd09db1a69e58f64 (peterx/qemu-kvm)
6ee9df2
6ee9df2
We move there all capabilities helpers from migration.c.
6ee9df2
6ee9df2
Signed-off-by: Juan Quintela <quintela@redhat.com>
6ee9df2
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
6ee9df2
6ee9df2
---
6ee9df2
6ee9df2
Following David advise:
6ee9df2
- looked through the history, capabilities are newer than 2012, so we
6ee9df2
  can remove that bit of the header.
6ee9df2
- This part is posterior to Anthony.
6ee9df2
  Original Author is Orit. Once there,
6ee9df2
  I put myself.  Peter Xu also did quite a bit of work here.
6ee9df2
  Anyone else wants/needs to be there?  I didn't search too hard
6ee9df2
  because nobody asked before to be added.
6ee9df2
6ee9df2
What do you think?
6ee9df2
6ee9df2
(cherry picked from commit 1f0776f1c03312aad5d6a5f98871240bc3af01e5)
6ee9df2
Signed-off-by: Peter Xu <peterx@redhat.com>
6ee9df2
---
6ee9df2
 hw/virtio/virtio-balloon.c     |   1 +
6ee9df2
 migration/block-dirty-bitmap.c |   1 +
6ee9df2
 migration/block.c              |   1 +
6ee9df2
 migration/colo.c               |   1 +
6ee9df2
 migration/meson.build          |   1 +
6ee9df2
 migration/migration.c          | 109 +----------------------------
6ee9df2
 migration/migration.h          |  12 ----
6ee9df2
 migration/options.c            | 124 +++++++++++++++++++++++++++++++++
6ee9df2
 migration/options.h            |  32 +++++++++
6ee9df2
 migration/postcopy-ram.c       |   1 +
6ee9df2
 migration/ram.c                |   1 +
6ee9df2
 migration/savevm.c             |   1 +
6ee9df2
 migration/socket.c             |   1 +
6ee9df2
 13 files changed, 166 insertions(+), 120 deletions(-)
6ee9df2
 create mode 100644 migration/options.c
6ee9df2
 create mode 100644 migration/options.h
6ee9df2
6ee9df2
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
6ee9df2
index 746f07c4d2..43092aa634 100644
6ee9df2
--- a/hw/virtio/virtio-balloon.c
6ee9df2
+++ b/hw/virtio/virtio-balloon.c
6ee9df2
@@ -32,6 +32,7 @@
6ee9df2
 #include "qemu/error-report.h"
6ee9df2
 #include "migration/misc.h"
6ee9df2
 #include "migration/migration.h"
6ee9df2
+#include "migration/options.h"
6ee9df2
 
6ee9df2
 #include "hw/virtio/virtio-bus.h"
6ee9df2
 #include "hw/virtio/virtio-access.h"
6ee9df2
diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
6ee9df2
index fe73aa94b1..a6ffae0002 100644
6ee9df2
--- a/migration/block-dirty-bitmap.c
6ee9df2
+++ b/migration/block-dirty-bitmap.c
6ee9df2
@@ -79,6 +79,7 @@
6ee9df2
 #include "qapi/qapi-visit-migration.h"
6ee9df2
 #include "qapi/clone-visitor.h"
6ee9df2
 #include "trace.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 #define CHUNK_SIZE     (1 << 10)
6ee9df2
 
6ee9df2
diff --git a/migration/block.c b/migration/block.c
6ee9df2
index b2497bbd32..4b167fa5cf 100644
6ee9df2
--- a/migration/block.c
6ee9df2
+++ b/migration/block.c
6ee9df2
@@ -28,6 +28,7 @@
6ee9df2
 #include "migration/vmstate.h"
6ee9df2
 #include "sysemu/block-backend.h"
6ee9df2
 #include "trace.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 #define BLK_MIG_BLOCK_SIZE           (1ULL << 20)
6ee9df2
 #define BDRV_SECTORS_PER_DIRTY_CHUNK (BLK_MIG_BLOCK_SIZE >> BDRV_SECTOR_BITS)
6ee9df2
diff --git a/migration/colo.c b/migration/colo.c
6ee9df2
index 0716e64689..93b78c9270 100644
6ee9df2
--- a/migration/colo.c
6ee9df2
+++ b/migration/colo.c
6ee9df2
@@ -36,6 +36,7 @@
6ee9df2
 #include "sysemu/cpus.h"
6ee9df2
 #include "sysemu/runstate.h"
6ee9df2
 #include "net/filter.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 static bool vmstate_loading;
6ee9df2
 static Notifier packets_compare_notifier;
6ee9df2
diff --git a/migration/meson.build b/migration/meson.build
6ee9df2
index 0d1bb9f96e..480ff6854a 100644
6ee9df2
--- a/migration/meson.build
6ee9df2
+++ b/migration/meson.build
6ee9df2
@@ -22,6 +22,7 @@ softmmu_ss.add(files(
6ee9df2
   'migration.c',
6ee9df2
   'multifd.c',
6ee9df2
   'multifd-zlib.c',
6ee9df2
+  'options.c',
6ee9df2
   'postcopy-ram.c',
6ee9df2
   'savevm.c',
6ee9df2
   'socket.c',
6ee9df2
diff --git a/migration/migration.c b/migration/migration.c
6ee9df2
index 18058fb597..66ea55be06 100644
6ee9df2
--- a/migration/migration.c
6ee9df2
+++ b/migration/migration.c
6ee9df2
@@ -63,6 +63,7 @@
6ee9df2
 #include "sysemu/cpus.h"
6ee9df2
 #include "yank_functions.h"
6ee9df2
 #include "sysemu/qtest.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 #define MAX_THROTTLE  (128 << 20)      /* Migration transfer speed throttling */
6ee9df2
 
6ee9df2
@@ -357,15 +358,6 @@ static void migrate_generate_event(int new_state)
6ee9df2
     }
6ee9df2
 }
6ee9df2
 
6ee9df2
-static bool migrate_late_block_activate(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE];
6ee9df2
-}
6ee9df2
-
6ee9df2
 /*
6ee9df2
  * Send a message on the return channel back to the source
6ee9df2
  * of the migration.
6ee9df2
@@ -2525,56 +2517,11 @@ void qmp_migrate_continue(MigrationStatus state, Error **errp)
6ee9df2
     qemu_sem_post(&s->pause_sem);
6ee9df2
 }
6ee9df2
 
6ee9df2
-bool migrate_release_ram(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_postcopy_ram(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM];
6ee9df2
-}
6ee9df2
-
6ee9df2
 bool migrate_postcopy(void)
6ee9df2
 {
6ee9df2
     return migrate_postcopy_ram() || migrate_dirty_bitmaps();
6ee9df2
 }
6ee9df2
 
6ee9df2
-bool migrate_auto_converge(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_zero_blocks(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_postcopy_blocktime(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME];
6ee9df2
-}
6ee9df2
-
6ee9df2
 bool migrate_use_compression(void)
6ee9df2
 {
6ee9df2
     MigrationState *s;
6ee9df2
@@ -2620,33 +2567,6 @@ int migrate_decompress_threads(void)
6ee9df2
     return s->parameters.decompress_threads;
6ee9df2
 }
6ee9df2
 
6ee9df2
-bool migrate_dirty_bitmaps(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_ignore_shared(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_validate_uuid(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID];
6ee9df2
-}
6ee9df2
-
6ee9df2
 bool migrate_use_events(void)
6ee9df2
 {
6ee9df2
     MigrationState *s;
6ee9df2
@@ -2665,15 +2585,6 @@ bool migrate_use_multifd(void)
6ee9df2
     return s->capabilities[MIGRATION_CAPABILITY_MULTIFD];
6ee9df2
 }
6ee9df2
 
6ee9df2
-bool migrate_pause_before_switchover(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER];
6ee9df2
-}
6ee9df2
-
6ee9df2
 int migrate_multifd_channels(void)
6ee9df2
 {
6ee9df2
     MigrationState *s;
6ee9df2
@@ -2785,24 +2696,6 @@ bool migrate_use_block_incremental(void)
6ee9df2
     return s->parameters.block_incremental;
6ee9df2
 }
6ee9df2
 
6ee9df2
-bool migrate_background_snapshot(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT];
6ee9df2
-}
6ee9df2
-
6ee9df2
-bool migrate_postcopy_preempt(void)
6ee9df2
-{
6ee9df2
-    MigrationState *s;
6ee9df2
-
6ee9df2
-    s = migrate_get_current();
6ee9df2
-
6ee9df2
-    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT];
6ee9df2
-}
6ee9df2
-
6ee9df2
 /* migration thread support */
6ee9df2
 /*
6ee9df2
  * Something bad happened to the RP stream, mark an error
6ee9df2
diff --git a/migration/migration.h b/migration/migration.h
6ee9df2
index 04e0860b4e..a25fed6ef0 100644
6ee9df2
--- a/migration/migration.h
6ee9df2
+++ b/migration/migration.h
6ee9df2
@@ -449,16 +449,7 @@ MigrationState *migrate_get_current(void);
6ee9df2
 
6ee9df2
 bool migrate_postcopy(void);
6ee9df2
 
6ee9df2
-bool migrate_release_ram(void);
6ee9df2
-bool migrate_postcopy_ram(void);
6ee9df2
-bool migrate_zero_blocks(void);
6ee9df2
-bool migrate_dirty_bitmaps(void);
6ee9df2
-bool migrate_ignore_shared(void);
6ee9df2
-bool migrate_validate_uuid(void);
6ee9df2
-
6ee9df2
-bool migrate_auto_converge(void);
6ee9df2
 bool migrate_use_multifd(void);
6ee9df2
-bool migrate_pause_before_switchover(void);
6ee9df2
 int migrate_multifd_channels(void);
6ee9df2
 MultiFDCompression migrate_multifd_compression(void);
6ee9df2
 int migrate_multifd_zlib_level(void);
6ee9df2
@@ -487,9 +478,6 @@ int migrate_compress_threads(void);
6ee9df2
 int migrate_compress_wait_thread(void);
6ee9df2
 int migrate_decompress_threads(void);
6ee9df2
 bool migrate_use_events(void);
6ee9df2
-bool migrate_postcopy_blocktime(void);
6ee9df2
-bool migrate_background_snapshot(void);
6ee9df2
-bool migrate_postcopy_preempt(void);
6ee9df2
 
6ee9df2
 /* Sending on the return path - generic and then for each message type */
6ee9df2
 void migrate_send_rp_shut(MigrationIncomingState *mis,
6ee9df2
diff --git a/migration/options.c b/migration/options.c
6ee9df2
new file mode 100644
6ee9df2
index 0000000000..88a9a45913
6ee9df2
--- /dev/null
6ee9df2
+++ b/migration/options.c
6ee9df2
@@ -0,0 +1,124 @@
6ee9df2
+/*
6ee9df2
+ * QEMU migration capabilities
6ee9df2
+ *
6ee9df2
+ * Copyright (c) 2012-2023 Red Hat Inc
6ee9df2
+ *
6ee9df2
+ * Authors:
6ee9df2
+ *   Orit Wasserman <owasserm@redhat.com>
6ee9df2
+ *   Juan Quintela <quintela@redhat.com>
6ee9df2
+ *
6ee9df2
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
6ee9df2
+ * See the COPYING file in the top-level directory.
6ee9df2
+ */
6ee9df2
+
6ee9df2
+#include "qemu/osdep.h"
6ee9df2
+#include "migration.h"
6ee9df2
+#include "options.h"
6ee9df2
+
6ee9df2
+bool migrate_auto_converge(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_background_snapshot(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_dirty_bitmaps(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_ignore_shared(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_late_block_activate(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_pause_before_switchover(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_postcopy_blocktime(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_postcopy_preempt(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_postcopy_ram(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_release_ram(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_validate_uuid(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID];
6ee9df2
+}
6ee9df2
+
6ee9df2
+bool migrate_zero_blocks(void)
6ee9df2
+{
6ee9df2
+    MigrationState *s;
6ee9df2
+
6ee9df2
+    s = migrate_get_current();
6ee9df2
+
6ee9df2
+    return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
6ee9df2
+}
6ee9df2
diff --git a/migration/options.h b/migration/options.h
6ee9df2
new file mode 100644
6ee9df2
index 0000000000..0dfa0af245
6ee9df2
--- /dev/null
6ee9df2
+++ b/migration/options.h
6ee9df2
@@ -0,0 +1,32 @@
6ee9df2
+/*
6ee9df2
+ * QEMU migration capabilities
6ee9df2
+ *
6ee9df2
+ * Copyright (c) 2012-2023 Red Hat Inc
6ee9df2
+ *
6ee9df2
+ * Authors:
6ee9df2
+ *   Orit Wasserman <owasserm@redhat.com>
6ee9df2
+ *   Juan Quintela <quintela@redhat.com>
6ee9df2
+ *
6ee9df2
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
6ee9df2
+ * See the COPYING file in the top-level directory.
6ee9df2
+ */
6ee9df2
+
6ee9df2
+#ifndef QEMU_MIGRATION_OPTIONS_H
6ee9df2
+#define QEMU_MIGRATION_OPTIONS_H
6ee9df2
+
6ee9df2
+/* capabilities */
6ee9df2
+
6ee9df2
+bool migrate_auto_converge(void);
6ee9df2
+bool migrate_background_snapshot(void);
6ee9df2
+bool migrate_dirty_bitmaps(void);
6ee9df2
+bool migrate_ignore_shared(void);
6ee9df2
+bool migrate_late_block_activate(void);
6ee9df2
+bool migrate_pause_before_switchover(void);
6ee9df2
+bool migrate_postcopy_blocktime(void);
6ee9df2
+bool migrate_postcopy_preempt(void);
6ee9df2
+bool migrate_postcopy_ram(void);
6ee9df2
+bool migrate_release_ram(void);
6ee9df2
+bool migrate_validate_uuid(void);
6ee9df2
+bool migrate_zero_blocks(void);
6ee9df2
+
6ee9df2
+#endif
6ee9df2
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
6ee9df2
index d7b48dd920..0711500036 100644
6ee9df2
--- a/migration/postcopy-ram.c
6ee9df2
+++ b/migration/postcopy-ram.c
6ee9df2
@@ -37,6 +37,7 @@
6ee9df2
 #include "tls.h"
6ee9df2
 #include "qemu/userfaultfd.h"
6ee9df2
 #include "qemu/mmap-alloc.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 /* Arbitrary limit on size of each discard command,
6ee9df2
  * keeps them around ~200 bytes
6ee9df2
diff --git a/migration/ram.c b/migration/ram.c
6ee9df2
index 229714045a..912ccd89fa 100644
6ee9df2
--- a/migration/ram.c
6ee9df2
+++ b/migration/ram.c
6ee9df2
@@ -57,6 +57,7 @@
6ee9df2
 #include "qemu/iov.h"
6ee9df2
 #include "multifd.h"
6ee9df2
 #include "sysemu/runstate.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 #include "hw/boards.h" /* for machine_dump_guest_core() */
6ee9df2
 
6ee9df2
diff --git a/migration/savevm.c b/migration/savevm.c
6ee9df2
index 589ef926ab..ebcf571e37 100644
6ee9df2
--- a/migration/savevm.c
6ee9df2
+++ b/migration/savevm.c
6ee9df2
@@ -67,6 +67,7 @@
6ee9df2
 #include "qemu/yank.h"
6ee9df2
 #include "yank_functions.h"
6ee9df2
 #include "sysemu/qtest.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 const unsigned int postcopy_ram_discard_version;
6ee9df2
 
6ee9df2
diff --git a/migration/socket.c b/migration/socket.c
6ee9df2
index e6fdf3c5e1..ebf9ac41af 100644
6ee9df2
--- a/migration/socket.c
6ee9df2
+++ b/migration/socket.c
6ee9df2
@@ -27,6 +27,7 @@
6ee9df2
 #include "io/net-listener.h"
6ee9df2
 #include "trace.h"
6ee9df2
 #include "postcopy-ram.h"
6ee9df2
+#include "options.h"
6ee9df2
 
6ee9df2
 struct SocketOutgoingArgs {
6ee9df2
     SocketAddress *saddr;
6ee9df2
-- 
6ee9df2
2.39.1
6ee9df2