Lines Matching refs:header

30 	struct kvm_stats_header header;  in stats_test()  local
38 read_stats_header(stats_fd, &header); in stats_test()
40 size_desc = get_stats_descriptor_size(&header); in stats_test()
43 id = malloc(header.name_size); in stats_test()
46 ret = pread(stats_fd, id, header.name_size, sizeof(header)); in stats_test()
47 TEST_ASSERT(ret == header.name_size, in stats_test()
49 header.name_size, ret); in stats_test()
52 TEST_ASSERT(!strncmp(id, "kvm", 3) && strlen(id) < header.name_size, in stats_test()
56 if (header.num_desc == 0) { in stats_test()
65 TEST_ASSERT(header.desc_offset && header.desc_offset >= sizeof(header) && in stats_test()
66 header.data_offset && header.data_offset >= sizeof(header), in stats_test()
69 TEST_ASSERT(header.desc_offset > header.data_offset || in stats_test()
70 (header.desc_offset + size_desc * header.num_desc <= header.data_offset), in stats_test()
74 stats_desc = read_stats_descriptors(stats_fd, &header); in stats_test()
77 for (i = 0; i < header.num_desc; ++i) { in stats_test()
78 pdesc = get_stats_descriptor(stats_desc, i, &header); in stats_test()
84 TEST_ASSERT(strlen(pdesc->name) < header.name_size, in stats_test()
146 TEST_ASSERT(header.data_offset >= header.desc_offset || in stats_test()
147 header.data_offset + size_data <= header.desc_offset, in stats_test()
151 TEST_ASSERT(size_data >= header.num_desc * sizeof(*stats_data), in stats_test()
158 ret = pread(stats_fd, stats_data, size_data, header.data_offset); in stats_test()
161 for (i = 0; i < header.num_desc; ++i) { in stats_test()
162 pdesc = get_stats_descriptor(stats_desc, i, &header); in stats_test()
163 read_stat_data(stats_fd, &header, pdesc, stats_data, in stats_test()