mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-03 01:34:41 +00:00
migration: privatize colo interfaces
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: https://lore.kernel.org/r/1710179338-294359-10-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
20c64c8a51
commit
7395127f23
|
@ -63,9 +63,9 @@ static bool colo_runstate_is_stopped(void)
|
||||||
return runstate_check(RUN_STATE_COLO) || !runstate_is_running();
|
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;
|
int64_t next_notify_time;
|
||||||
|
|
||||||
qemu_event_set(&s->colo_checkpoint_event);
|
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);
|
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)
|
void colo_checkpoint_delay_set(void)
|
||||||
{
|
{
|
||||||
if (migration_in_colo_state()) {
|
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
|
* kick COLO thread which might wait at
|
||||||
* qemu_sem_wait(&s->colo_checkpoint_sem).
|
* 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(),
|
* 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)
|
static void colo_compare_notify_checkpoint(Notifier *notifier, void *data)
|
||||||
{
|
{
|
||||||
colo_checkpoint_notify(data);
|
colo_checkpoint_notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void colo_process_checkpoint(MigrationState *s)
|
static void colo_process_checkpoint(MigrationState *s)
|
||||||
|
@ -642,7 +647,7 @@ void migrate_start_colo_process(MigrationState *s)
|
||||||
bql_unlock();
|
bql_unlock();
|
||||||
qemu_event_init(&s->colo_checkpoint_event, false);
|
qemu_event_init(&s->colo_checkpoint_event, false);
|
||||||
s->colo_delay_timer = timer_new_ms(QEMU_CLOCK_HOST,
|
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);
|
qemu_sem_init(&s->colo_exit_sem, 0);
|
||||||
colo_process_checkpoint(s);
|
colo_process_checkpoint(s);
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "sysemu/iothread.h"
|
#include "sysemu/iothread.h"
|
||||||
#include "net/colo-compare.h"
|
#include "net/colo-compare.h"
|
||||||
#include "migration/colo.h"
|
#include "migration/colo.h"
|
||||||
#include "migration/migration.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include "block/aio-wait.h"
|
#include "block/aio-wait.h"
|
||||||
|
@ -189,7 +188,7 @@ static void colo_compare_inconsistency_notify(CompareState *s)
|
||||||
notify_remote_frame(s);
|
notify_remote_frame(s);
|
||||||
} else {
|
} else {
|
||||||
notifier_list_notify(&colo_compare_notifiers,
|
notifier_list_notify(&colo_compare_notifiers,
|
||||||
migrate_get_current());
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#include "qemu/notify.h"
|
#include "qemu/notify.h"
|
||||||
#include "net/colo-compare.h"
|
#include "net/colo-compare.h"
|
||||||
#include "migration/colo.h"
|
#include "migration/colo.h"
|
||||||
#include "migration/migration.h"
|
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qapi/qapi-commands-migration.h"
|
#include "qapi/qapi-commands-migration.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue