[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/34] migration: privatize colo interfaces
From: |
peterx |
Subject: |
[PULL 25/34] migration: privatize colo interfaces |
Date: |
Mon, 11 Mar 2024 17:59:16 -0400 |
From: Steve Sistare <steven.sistare@oracle.com>
Remove private migration interfaces from net/colo-compare.c and push them
to migration/colo.c.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Link:
1710179338-294359-10-git-send-email-steven.sistare@oracle.com">https://lore.kernel.org/r/1710179338-294359-10-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/colo.c | 17 +++++++++++------
net/colo-compare.c | 3 +--
stubs/colo.c | 1 -
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/migration/colo.c b/migration/colo.c
index 315e31fe32..84632a603e 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -63,9 +63,9 @@ static bool colo_runstate_is_stopped(void)
return runstate_check(RUN_STATE_COLO) || !runstate_is_running();
}
-static void colo_checkpoint_notify(void *opaque)
+static void colo_checkpoint_notify(void)
{
- MigrationState *s = opaque;
+ MigrationState *s = migrate_get_current();
int64_t next_notify_time;
qemu_event_set(&s->colo_checkpoint_event);
@@ -74,10 +74,15 @@ static void colo_checkpoint_notify(void *opaque)
timer_mod(s->colo_delay_timer, next_notify_time);
}
+static void colo_checkpoint_notify_timer(void *opaque)
+{
+ colo_checkpoint_notify();
+}
+
void colo_checkpoint_delay_set(void)
{
if (migration_in_colo_state()) {
- colo_checkpoint_notify(migrate_get_current());
+ colo_checkpoint_notify();
}
}
@@ -162,7 +167,7 @@ static void primary_vm_do_failover(void)
* kick COLO thread which might wait at
* qemu_sem_wait(&s->colo_checkpoint_sem).
*/
- colo_checkpoint_notify(s);
+ colo_checkpoint_notify();
/*
* Wake up COLO thread which may blocked in recv() or send(),
@@ -518,7 +523,7 @@ out:
static void colo_compare_notify_checkpoint(Notifier *notifier, void *data)
{
- colo_checkpoint_notify(data);
+ colo_checkpoint_notify();
}
static void colo_process_checkpoint(MigrationState *s)
@@ -642,7 +647,7 @@ void migrate_start_colo_process(MigrationState *s)
bql_unlock();
qemu_event_init(&s->colo_checkpoint_event, false);
s->colo_delay_timer = timer_new_ms(QEMU_CLOCK_HOST,
- colo_checkpoint_notify, s);
+ colo_checkpoint_notify_timer, NULL);
qemu_sem_init(&s->colo_exit_sem, 0);
colo_process_checkpoint(s);
diff --git a/net/colo-compare.c b/net/colo-compare.c
index f2dfc0ebdc..c4ad0ab71f 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -28,7 +28,6 @@
#include "sysemu/iothread.h"
#include "net/colo-compare.h"
#include "migration/colo.h"
-#include "migration/migration.h"
#include "util.h"
#include "block/aio-wait.h"
@@ -189,7 +188,7 @@ static void colo_compare_inconsistency_notify(CompareState
*s)
notify_remote_frame(s);
} else {
notifier_list_notify(&colo_compare_notifiers,
- migrate_get_current());
+ NULL);
}
}
diff --git a/stubs/colo.c b/stubs/colo.c
index 08c9f982d5..f8c069b739 100644
--- a/stubs/colo.c
+++ b/stubs/colo.c
@@ -2,7 +2,6 @@
#include "qemu/notify.h"
#include "net/colo-compare.h"
#include "migration/colo.h"
-#include "migration/migration.h"
#include "qemu/error-report.h"
#include "qapi/qapi-commands-migration.h"
--
2.44.0
- [PULL 29/34] migration/multifd: Allow clearing of the file_bmap from multifd, (continued)
- [PULL 29/34] migration/multifd: Allow clearing of the file_bmap from multifd, peterx, 2024/03/11
- [PULL 34/34] migration/multifd: Add new migration test cases for legacy zero page checking., peterx, 2024/03/11
- [PULL 18/34] migration: export migration_is_setup_or_active, peterx, 2024/03/11
- [PULL 17/34] migration: remove migration.h references, peterx, 2024/03/11
- [PULL 21/34] migration: export vcpu_dirty_limit_period, peterx, 2024/03/11
- [PULL 15/34] migration: Fix format in error message, peterx, 2024/03/11
- [PULL 19/34] migration: export migration_is_active, peterx, 2024/03/11
- [PULL 20/34] migration: export migration_is_running, peterx, 2024/03/11
- [PULL 23/34] migration: migration_is_device, peterx, 2024/03/11
- [PULL 22/34] migration: migration_thread_is_self, peterx, 2024/03/11
- [PULL 25/34] migration: privatize colo interfaces,
peterx <=
- [PULL 26/34] migration: delete unused accessors, peterx, 2024/03/11
- [PULL 28/34] migration/multifd: Allow zero pages in file migration, peterx, 2024/03/11
- [PULL 24/34] migration: migration_file_set_error, peterx, 2024/03/11
- [PULL 30/34] migration/multifd: Add new migration option zero-page-detection., peterx, 2024/03/11
- [PULL 32/34] migration/multifd: Implement ram_save_target_page_multifd to handle multifd version of MigrationOps::ram_save_target_page., peterx, 2024/03/11
- [PULL 33/34] migration/multifd: Enable multifd zero page checking by default., peterx, 2024/03/11
- [PULL 31/34] migration/multifd: Implement zero page transmission on the multifd thread., peterx, 2024/03/11
- Re: [PULL 00/34] Migration 20240311 patches, Peter Maydell, 2024/03/12