diff options
author | marcel <marcel@FreeBSD.org> | 2008-04-23 20:13:05 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-04-23 20:13:05 +0000 |
commit | 38e8adf72053670c84a15fd57d641357ec1d4501 (patch) | |
tree | 0e7bf464079f7c3553cf6f191b95c9772ae66018 /sys/geom/part/g_part_gpt.c | |
parent | f7fcfdc595633492f520f12db8f7447003ab54b3 (diff) | |
download | FreeBSD-src-38e8adf72053670c84a15fd57d641357ec1d4501.zip FreeBSD-src-38e8adf72053670c84a15fd57d641357ec1d4501.tar.gz |
Implement the G_PART_DUMPCONF method for all 6 schemes. Also call
the method for the (indent == NULL) case (i.e. the kern.geom.conftxt
sysctl). The purpose is to extend the conftxt output with scheme-
specific fields which can be used by libdisk. In particular, have
the schemes dump the xs and xt fields, which contain the backward
compatible values for class type and partition type. This allows
libdisk to work with the legacy slicers as well as with gpart and
helps/promotes migration.
Diffstat (limited to 'sys/geom/part/g_part_gpt.c')
-rw-r--r-- | sys/geom/part/g_part_gpt.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index cc9cdfc..d2df420 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -88,6 +88,8 @@ static int g_part_gpt_add(struct g_part_table *, struct g_part_entry *, static int g_part_gpt_bootcode(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_create(struct g_part_table *, struct g_part_parms *); static int g_part_gpt_destroy(struct g_part_table *, struct g_part_parms *); +static int g_part_gpt_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); static int g_part_gpt_dumpto(struct g_part_table *, struct g_part_entry *); static int g_part_gpt_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); @@ -104,6 +106,7 @@ static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_bootcode, g_part_gpt_bootcode), KOBJMETHOD(g_part_create, g_part_gpt_create), KOBJMETHOD(g_part_destroy, g_part_gpt_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_gpt_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_gpt_dumpto), KOBJMETHOD(g_part_modify, g_part_gpt_modify), KOBJMETHOD(g_part_name, g_part_gpt_name), @@ -430,6 +433,21 @@ g_part_gpt_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) } static int +g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, + struct sbuf *sb, const char *indent) +{ + struct g_part_gpt_entry *entry; + + if (indent != NULL) + return (0); + + entry = (struct g_part_gpt_entry *)baseentry; + sbuf_printf(sb, " xs GPT xt "); + sbuf_printf_uuid(sb, &entry->ent.ent_type); + return (0); +} + +static int g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_gpt_entry *entry; |