From: Alasdair Kergon Date: Tue, 13 Dec 2005 13:34:31 +0000 (+0000) Subject: comments X-Git-Tag: v1_02_03~28 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=928f6e9209abed072af90b5e0c21647a9523d18e;p=dm.git comments --- diff --git a/dmeventd/libdevmapper-event.c b/dmeventd/libdevmapper-event.c index 62b12b7..5adb593 100644 --- a/dmeventd/libdevmapper-event.c +++ b/dmeventd/libdevmapper-event.c @@ -363,12 +363,13 @@ static int do_event(int cmd, struct dm_event_daemon_message *msg, struct dm_event_fifos fifos; /* FIXME Start the daemon here if it's not running e.g. exclusive lock file */ - + /* FIXME Move this to separate 'dm_event_register_handler' - if no daemon here, fail */ if (!init_client(&fifos)) { stack; return -ESRCH; } + /* FIXME Use separate 'dm_event_register_handler' function to pass in dso? */ ret = daemon_talk(&fifos, msg, cmd, dso_name, device, events, timeout); /* what is the opposite of init? */ @@ -377,6 +378,8 @@ static int do_event(int cmd, struct dm_event_daemon_message *msg, return ret; } +/* FIXME remove dso_name - use handle instead */ +/* FIXME Use uuid not path! */ /* External library interface. */ int dm_event_register(char *dso_name, char *device_path, enum dm_event_type events) diff --git a/dmeventd/libdevmapper-event.h b/dmeventd/libdevmapper-event.h index 9c9d637..e623d2f 100644 --- a/dmeventd/libdevmapper-event.h +++ b/dmeventd/libdevmapper-event.h @@ -82,6 +82,15 @@ enum dm_event_type { DM_EVENT_PATH_ERROR | DM_EVENT_ADAPTOR_ERROR) /* Prototypes for event lib interface. */ + +/* FIXME Replace device with standard name/uuid/devno choice */ +/* Interface changes: + First register a handler, passing in a unique ref for the device. */ + int dm_event_register_handler(const char *dso_name, const char *device); + int dm_event_register(const char *dso_name, const char *name, const char *uuid, uint32_t major, uint32_t minor, enum dm_event_type events); +Or (better?) add to task structure and use existing functions - run a task to register/unregister events - we may need to run task withe that with the new event mechanism anyway, then the dso calls just hook in. +*/ + /* FIXME Missing consts? */ int dm_event_register(char *dso_name, char *device, enum dm_event_type events); int dm_event_unregister(char *dso_name, char *device,