Skip to content

Commit

Permalink
modify: using local function to get the static variable value
Browse files Browse the repository at this point in the history
  • Loading branch information
kester-lin committed Oct 3, 2019
1 parent bbb336a commit a28d149
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ void hmp_cuju_adjust_epoch(Monitor *mon, const QDict *qdict)

void hmp_cuju_ft_started(Monitor *mon, const QDict *qdict)
{
monitor_printf(mon, "ft_started: %d\n", ft_started);
monitor_printf(mon, "ft_started: %d\n", show_ft_started());

return;
}
Expand Down
3 changes: 1 addition & 2 deletions include/migration/cuju-kvm-share-mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#define SHARED_DIRTY_SIZE 10000
#define SHARED_DIRTY_WATERMARK 9600

extern int ft_started;

bool cuju_supported(void);

void kvmft_pre_init(void);
Expand Down Expand Up @@ -71,5 +69,6 @@ void kvm_shmem_load_ram(void *buf, int size);
void* kvm_shmem_map_pfn(unsigned long pfn, unsigned long size);
void kvm_shmem_unmap_pfn(void *ptr, unsigned long size);

int show_ft_started (void);

#endif
6 changes: 5 additions & 1 deletion migration/cuju-kvm-share-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct dirty_page_tracking_logs dirty_page_tracking_logs;
static void*** page_array;
static int bitmap_count;

int ft_started = 0;
static int ft_started = 0;

static unsigned int epoch_time_in_us = EPOCH_TIME_IN_MS * 1000;

Expand Down Expand Up @@ -1474,3 +1474,7 @@ void kvmft_update_epoch_flush_time_linear(double time_s)
}
}

int show_ft_started (void)
{
return ft_started;
}

0 comments on commit a28d149

Please sign in to comment.