Skip to content

Commit 645bf06

Browse files
pbo-linarostsquad
authored andcommitted
contrib/plugins/hotpages: fix 32-bit build
Reviewed-by: Richard Henderson <[email protected]> Signed-off-by: Pierrick Bouvier <[email protected]> Message-Id: <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Message-Id: <[email protected]>
1 parent cab85a6 commit 645bf06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/plugins/hotpages.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
103103
static void plugin_init(void)
104104
{
105105
page_mask = (page_size - 1);
106-
pages = g_hash_table_new(NULL, g_direct_equal);
106+
pages = g_hash_table_new(g_int64_hash, g_int64_equal);
107107
}
108108

109109
static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo,
@@ -130,12 +130,12 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo,
130130
page &= ~page_mask;
131131

132132
g_mutex_lock(&lock);
133-
count = (PageCounters *) g_hash_table_lookup(pages, GUINT_TO_POINTER(page));
133+
count = (PageCounters *) g_hash_table_lookup(pages, &page);
134134

135135
if (!count) {
136136
count = g_new0(PageCounters, 1);
137137
count->page_address = page;
138-
g_hash_table_insert(pages, GUINT_TO_POINTER(page), (gpointer) count);
138+
g_hash_table_insert(pages, &count->page_address, count);
139139
}
140140
if (qemu_plugin_mem_is_store(meminfo)) {
141141
count->writes++;

0 commit comments

Comments
 (0)