Do not call the dumpconf method unless there is one.
Compare pointers with NULL. Partially submitted by: Christian Carstensen <cc@gate5.de> Approved by: re
This commit is contained in:
parent
edb3cb1652
commit
82e5a9a354
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107111
@ -126,7 +126,8 @@ g_conftxt_geom(struct sbuf *sb, struct g_geom *gp, int level)
|
||||
LIST_FOREACH(pp, &gp->provider, provider) {
|
||||
sbuf_printf(sb, "%d %s %s %ju %u", level, gp->class->name,
|
||||
pp->name, (uintmax_t)pp->mediasize, pp->sectorsize);
|
||||
gp->dumpconf(sb, NULL, gp, NULL, pp);
|
||||
if (gp->dumpconf != NULL)
|
||||
gp->dumpconf(sb, NULL, gp, NULL, pp);
|
||||
sbuf_printf(sb, "\n");
|
||||
LIST_FOREACH(cp, &pp->consumers, consumers)
|
||||
g_conftxt_geom(sb, cp->geom, level + 1);
|
||||
@ -170,7 +171,7 @@ g_conf_consumer(struct sbuf *sb, struct g_consumer *cp)
|
||||
sbuf_printf(sb, "\t <provider ref=\"%p\"/>\n", cp->provider);
|
||||
sbuf_printf(sb, "\t <mode>r%dw%de%d</mode>\n",
|
||||
cp->acr, cp->acw, cp->ace);
|
||||
if (cp->geom->dumpconf) {
|
||||
if (cp->geom->dumpconf != NULL) {
|
||||
sbuf_printf(sb, "\t <config>\n");
|
||||
cp->geom->dumpconf(sb, "\t ", cp->geom, cp, NULL);
|
||||
sbuf_printf(sb, "\t </config>\n");
|
||||
@ -190,7 +191,7 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp)
|
||||
sbuf_printf(sb, "\t <mediasize>%jd</mediasize>\n",
|
||||
(intmax_t)pp->mediasize);
|
||||
sbuf_printf(sb, "\t <sectorsize>%u</sectorsize>\n", pp->sectorsize);
|
||||
if (pp->geom->dumpconf) {
|
||||
if (pp->geom->dumpconf != NULL) {
|
||||
sbuf_printf(sb, "\t <config>\n");
|
||||
pp->geom->dumpconf(sb, "\t ", pp->geom, NULL, pp);
|
||||
sbuf_printf(sb, "\t </config>\n");
|
||||
@ -209,7 +210,7 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct g_provider *pp, struct g_
|
||||
sbuf_printf(sb, " <class ref=\"%p\"/>\n", gp->class);
|
||||
sbuf_printf(sb, " <name>%s</name>\n", gp->name);
|
||||
sbuf_printf(sb, " <rank>%d</rank>\n", gp->rank);
|
||||
if (gp->dumpconf) {
|
||||
if (gp->dumpconf != NULL) {
|
||||
sbuf_printf(sb, " <config>\n");
|
||||
gp->dumpconf(sb, "\t", gp, NULL, NULL);
|
||||
sbuf_printf(sb, " </config>\n");
|
||||
|
Loading…
Reference in New Issue
Block a user