From 38e8adf72053670c84a15fd57d641357ec1d4501 Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 23 Apr 2008 20:13:05 +0000 Subject: 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. --- sys/geom/part/g_part_gpt.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sys/geom/part/g_part_gpt.c') 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; -- cgit v1.1