qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qht: constify qht_statistics_init

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

authored by

Emilio G. Cota and committed by
Richard Henderson
6579f107 e6c58299

+5 -5
+1 -1
include/qemu/qht.h
··· 211 211 * When done with @stats, pass the struct to qht_statistics_destroy(). 212 212 * Failing to do this will leak memory. 213 213 */ 214 - void qht_statistics_init(struct qht *ht, struct qht_stats *stats); 214 + void qht_statistics_init(const struct qht *ht, struct qht_stats *stats); 215 215 216 216 /** 217 217 * qht_statistics_destroy - Destroy a &struct qht_stats
+4 -4
util/qht.c
··· 895 895 } 896 896 897 897 /* pass @stats to qht_statistics_destroy() when done */ 898 - void qht_statistics_init(struct qht *ht, struct qht_stats *stats) 898 + void qht_statistics_init(const struct qht *ht, struct qht_stats *stats) 899 899 { 900 - struct qht_map *map; 900 + const struct qht_map *map; 901 901 int i; 902 902 903 903 map = atomic_rcu_read(&ht->map); ··· 914 914 stats->head_buckets = map->n_buckets; 915 915 916 916 for (i = 0; i < map->n_buckets; i++) { 917 - struct qht_bucket *head = &map->buckets[i]; 918 - struct qht_bucket *b; 917 + const struct qht_bucket *head = &map->buckets[i]; 918 + const struct qht_bucket *b; 919 919 unsigned int version; 920 920 size_t buckets; 921 921 size_t entries;