migration/block-dirty-bitmap: rename finish_lock to just lock
finish_lock is bad name, as lock used not only on process end. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Message-Id: <20200727194236.19551-13-vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
3b52726ec0
commit
8949121644
@ -143,7 +143,7 @@ typedef struct DBMLoadState {
|
|||||||
BdrvDirtyBitmap *bitmap;
|
BdrvDirtyBitmap *bitmap;
|
||||||
|
|
||||||
GSList *enabled_bitmaps;
|
GSList *enabled_bitmaps;
|
||||||
QemuMutex finish_lock;
|
QemuMutex lock; /* protect enabled_bitmaps */
|
||||||
} DBMLoadState;
|
} DBMLoadState;
|
||||||
|
|
||||||
typedef struct DBMState {
|
typedef struct DBMState {
|
||||||
@ -575,7 +575,7 @@ void dirty_bitmap_mig_before_vm_start(void)
|
|||||||
DBMLoadState *s = &dbm_state.load;
|
DBMLoadState *s = &dbm_state.load;
|
||||||
GSList *item;
|
GSList *item;
|
||||||
|
|
||||||
qemu_mutex_lock(&s->finish_lock);
|
qemu_mutex_lock(&s->lock);
|
||||||
|
|
||||||
for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
|
for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
|
||||||
LoadBitmapState *b = item->data;
|
LoadBitmapState *b = item->data;
|
||||||
@ -592,7 +592,7 @@ void dirty_bitmap_mig_before_vm_start(void)
|
|||||||
g_slist_free(s->enabled_bitmaps);
|
g_slist_free(s->enabled_bitmaps);
|
||||||
s->enabled_bitmaps = NULL;
|
s->enabled_bitmaps = NULL;
|
||||||
|
|
||||||
qemu_mutex_unlock(&s->finish_lock);
|
qemu_mutex_unlock(&s->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
|
static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
|
||||||
@ -601,7 +601,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
|
|||||||
trace_dirty_bitmap_load_complete();
|
trace_dirty_bitmap_load_complete();
|
||||||
bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
|
bdrv_dirty_bitmap_deserialize_finish(s->bitmap);
|
||||||
|
|
||||||
qemu_mutex_lock(&s->finish_lock);
|
qemu_mutex_lock(&s->lock);
|
||||||
|
|
||||||
for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
|
for (item = s->enabled_bitmaps; item; item = g_slist_next(item)) {
|
||||||
LoadBitmapState *b = item->data;
|
LoadBitmapState *b = item->data;
|
||||||
@ -633,7 +633,7 @@ static void dirty_bitmap_load_complete(QEMUFile *f, DBMLoadState *s)
|
|||||||
bdrv_dirty_bitmap_unlock(s->bitmap);
|
bdrv_dirty_bitmap_unlock(s->bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_mutex_unlock(&s->finish_lock);
|
qemu_mutex_unlock(&s->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
|
static int dirty_bitmap_load_bits(QEMUFile *f, DBMLoadState *s)
|
||||||
@ -815,7 +815,7 @@ static SaveVMHandlers savevm_dirty_bitmap_handlers = {
|
|||||||
void dirty_bitmap_mig_init(void)
|
void dirty_bitmap_mig_init(void)
|
||||||
{
|
{
|
||||||
QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
|
QSIMPLEQ_INIT(&dbm_state.save.dbms_list);
|
||||||
qemu_mutex_init(&dbm_state.load.finish_lock);
|
qemu_mutex_init(&dbm_state.load.lock);
|
||||||
|
|
||||||
register_savevm_live("dirty-bitmap", 0, 1,
|
register_savevm_live("dirty-bitmap", 0, 1,
|
||||||
&savevm_dirty_bitmap_handlers,
|
&savevm_dirty_bitmap_handlers,
|
||||||
|
Loading…
Reference in New Issue
Block a user