All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about dmevents
@ 2007-07-20 16:02 Wood, Brian J
  2007-07-20 16:16 ` Alasdair G Kergon
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Wood, Brian J @ 2007-07-20 16:02 UTC (permalink / raw)
  To: device-mapper development

Hello everyone, I have a question about something in the
"libdevmapper-event.c" code. I'm building a test application that I can
use to setup events I would like to register with dmeventd. As suggested
by Jonathan Brassow I've used the framework from lib/mirror/mirrored.c
in LVM2 as a template to creating my setup code in the test application.
Right now I'm hard coding in the name of the dso and the name of the
device I would like to register as a watch point. Here is how I get
things going: 

Create a structure "dm_event_handler"
Set char *dso to a stub dso (created for testing).
Set char *name to "/dev/mapper/XXXXX_Volume0p1" (one of my dm device
names) 
Call "dm_event_handler_create()"
Call "dm_event_handler_set_dso()"
Call "dm_event_handler_set_dev_name()"

After setting all this up I call "dm_event_register_handler()" passing
in the "dm_event_handler" structure. Inside this call the first thing is
a call to "_get_device_info()" that sets up my "dm_task" structure.
Inside this function I noticed the "dm_task_create()" function sets up
the dm_task structure, but leaves uuid as null. We then test uuid (since
its null it jumps past the first "if" statement heading into
dm_task_set_name()). In here it cuts off the "/dev/mapper/" and sets
dev_name to XXXXX and returns as it should.

After this long setup here's the problem I'm having. I run through the
remaining function calls in _get_device_info() and my uuid for the
dm_task is still null. The last call before sending this message off to
dmeventd using the "_do_event()" is a call to dm_task_get_uuid() that is
passed my dm_task struct. This should return a uuid string, but returns
null since my dm_task is never getting a uuid set. Without this I get a
failure on the dmeventd side stating I passed a null pointer into
dm_strdup via the function _alloc_thread_status (where it checks the
uuid field). 

Just as a test, in my gdb session I set the uuid to some text string,
"blah" for example, and I'm able to register my event and get a
"SUCCESS" message back in the FIFO. 

 
My one clue is that I noticed back in _get_device_info() a line that
says
 	/* FIXME Add name or uuid or devno to messages */
Does this mean that there needs to be code added to setup the dm_task
uuid? Or is there another call in libdevmapper.h that I'm missing that I
can use to set this up?

Thank you for any help you might be able to offer; I'm hoping I just
missed calling a libdevmapper* initialization function :)


Brian Wood
Intel Corporation 
Digital Enterprise Group
Manageability & Platform Software Division
brian.j.wood@intel.com

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Question about dmevents
@ 2007-07-16 15:08 Wood, Brian J
  2007-07-17 14:04 ` Jonathan Brassow
  0 siblings, 1 reply; 14+ messages in thread
From: Wood, Brian J @ 2007-07-16 15:08 UTC (permalink / raw)
  To: device-mapper development

Hello everyone, I was wondering if someone could point me to a utility
that I could look at that uses the dmeventd event registration. I asked
Heinz M. if there were an LVM utilities that I could see sample code for
and it sounded like there weren't any implementations currently in LVM
(he did mention "mirrored.c" but that seems incomplete, unless I'm
missing something). I'm wondering if someone on this list has made some
sort of test utility that I could see the source code for (maybe a small
application and a "hello world" type DSO that I could learn from :) ). 

Thank you, 

Brian Wood
Intel Corporation 
Digital Enterprise Group
Manageability & Platform Software Division
brian.j.wood@intel.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-07-24 14:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070720162626.GA459@agk.fab.redhat.com>
2007-07-20 16:57 ` Question about dmevents Wood, Brian J
2007-07-20 17:14   ` Alasdair G Kergon
2007-07-20 17:23     ` Wood, Brian J
2007-07-22  8:43     ` Peter Rockai
2007-07-22 11:15       ` Alasdair G Kergon
2007-07-23 16:43         ` Wood, Brian J
2007-07-24 14:46           ` Question about device-mapper/raid Wood, Brian J
2007-07-20 16:02 Question about dmevents Wood, Brian J
2007-07-20 16:16 ` Alasdair G Kergon
2007-07-20 16:22 ` Alasdair G Kergon
2007-07-20 16:44   ` Wood, Brian J
2007-07-22  8:53 ` Peter Rockai
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16 15:08 Wood, Brian J
2007-07-17 14:04 ` Jonathan Brassow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.