]> sourceware.org Git - lvm2.git/commitdiff
libdm-stats: move no regions warning after dm_stats_list()
authorBryn M. Reeves <bmr@redhat.com>
Thu, 1 Nov 2018 16:47:56 +0000 (16:47 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Thu, 1 Nov 2018 16:59:56 +0000 (16:59 +0000)
It doesn't make sense to test or warn about the region count until
the stats handle has been listed: at this point it may or may not
contain valid information (but is guaranteed to be correct after
the list).

libdm/libdm-stats.c

index 014395756ec5bd0d4e1143e5198e5841d87325a6..ca46d9a671a3291afc8c5d1cda8c006bfd069d61 100644 (file)
@@ -2338,11 +2338,6 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id,
                return 0;
        }
 
-       if (!dms->nr_regions) {
-               log_error("No regions registered.");
-               return 0;
-       }
-
        /* allow zero-length program_id for populate */
        if (!program_id)
                program_id = dms->program_id;
@@ -2354,6 +2349,11 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id,
                goto_bad;
        }
 
+       if (!dms->nr_regions) {
+               log_verbose("No stats regions registered: %s", dms->name);
+               return 0;
+       }
+
        dms->walk_flags = DM_STATS_WALK_REGION;
        dm_stats_walk_start(dms);
        do {
This page took 0.035507 seconds and 5 git commands to generate.