summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2010-04-16 18:16:40 -0400
committerDoug Ledford <dledford@redhat.com>2010-04-16 18:16:40 -0400
commit56d318f825099f61370fc696c2a3e8f57bcf198c (patch)
treef1dd12d03287c6e341f14a4f2983fd58c60aa103
parentbdf05eca34d74d8220031dc8e672ba4d9209a800 (diff)
downloadmdadm-hotunplug.zip
mdadm-hotunplug.tar.gz
mdadm-hotunplug.tar.xz
Add stub for validation of partition table file during config parsinghotunplug
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--config.c6
-rw-r--r--mdadm.h1
-rw-r--r--util.c6
3 files changed, 13 insertions, 0 deletions
diff --git a/config.c b/config.c
index 3242f5f..b429968 100644
--- a/config.c
+++ b/config.c
@@ -903,6 +903,12 @@ void domainline(char *line)
free_domain(de);
return;
}
+ if (de->handler->validate(de)) {
+ fprintf(stderr, Name ": partition table file failed "
+ "validation.\n");
+ free_domain(de);
+ return;
+ }
}
de->next = domain_list;
domain_list = de;
diff --git a/mdadm.h b/mdadm.h
index b1e74db..7b81131 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -299,6 +299,7 @@ struct domain_ent;
extern struct partition_handler {
char *match; /* string we match in mdadm.conf */
+ int (*validate)(struct domain_ent *domain);
int (*check_table)(int dfd, int verbose, int export,
struct domain_ent *domain);
int (*write_table)(int dfd, int verbose, int export,
diff --git a/util.c b/util.c
index 3c8dbcb..211c82d 100644
--- a/util.c
+++ b/util.c
@@ -1745,6 +1745,11 @@ char *get_devpath_from_devname(char *devname)
return NULL;
}
+static int sfdisk_validate(struct domain_ent *domain)
+{
+ return 0;
+}
+
static int sfdisk_check_table(int dfd, int verbose, int export,
struct domain_ent *domain)
{
@@ -1759,6 +1764,7 @@ static int sfdisk_write_table(int dfd, int verbose, int export,
static struct partition_handler sfdisk_handler = {
.match = "sfdisk",
+ .validate = sfdisk_validate,
.check_table = sfdisk_check_table,
.write_table = sfdisk_write_table,
};