summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c84646c)
raw | patch | inline | side by side (parent: c84646c)
author | Francesco Romani <fromani@redhat.com> | |
Wed, 23 Nov 2016 17:53:08 +0000 (18:53 +0100) | ||
committer | Francesco Romani <fromani@redhat.com> | |
Wed, 30 Nov 2016 09:27:00 +0000 (10:27 +0100) |
One 'int' is big enough, and we check the boundaries anyway
in lv_config.
Signed-off-by: Francesco Romani <fromani@redhat.com>
in lv_config.
Signed-off-by: Francesco Romani <fromani@redhat.com>
src/virt.c | patch | blob | history |
diff --git a/src/virt.c b/src/virt.c
index 9ca4f0d72e1f6f29e1e129c839fe763d9daa317b..e5bc965d87389a861cf623f2b95c99c0be0e1b99 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
#define NR_INSTANCES_DEFAULT 1
#define NR_INSTANCES_MAX 128
-static size_t nr_instances = NR_INSTANCES_DEFAULT;
+static int nr_instances = NR_INSTANCES_DEFAULT;
static struct lv_user_data lv_read_user_data[NR_INSTANCES_MAX];
/* HostnameFormat. */
val, NR_INSTANCES_MAX);
return 1;
}
- nr_instances = (size_t)val;
+ nr_instances = (int)val;
return 0;
}
if (virInitialize() != 0)
return -1;
- for (size_t i = 0; i < nr_instances; ++i)
+ for (int i = 0; i < nr_instances; ++i)
lv_init_instance(i, lv_read);
return 0;
}
static int is_known_tag(const char *dom_tag) {
- for (size_t i = 0; i < nr_instances; ++i)
+ for (int i = 0; i < nr_instances; ++i)
if (!strcmp(dom_tag, lv_read_user_data[i].inst.tag))
return 1;
return 0;
}
static int lv_shutdown(void) {
- for (size_t i = 0; i < nr_instances; ++i) {
+ for (int i = 0; i < nr_instances; ++i) {
struct lv_read_state *state = &(lv_read_user_data[i].inst.read_state);
free_block_devices(state);
free_interface_devices(state);