* simple question... to tough to answer?
@ 2008-05-15 17:09 Wim Colgate
2008-05-15 17:46 ` malahal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Wim Colgate @ 2008-05-15 17:09 UTC (permalink / raw)
To: dm-devel
[-- Attachment #1.1: Type: text/plain, Size: 275 bytes --]
Hi,
I'm not quite sure why no one in the community hasn't been able to
answer my questions.
Simply (re)stated:
1) Are there hooks for dm/multipath events to notify software?
2) does path down/up fire up udev rules?
Thanks,
Wim
[-- Attachment #1.2: Type: text/html, Size: 4012 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: simple question... to tough to answer?
2008-05-15 17:09 simple question... to tough to answer? Wim Colgate
@ 2008-05-15 17:46 ` malahal
2008-05-15 17:54 ` Konrad Rzeszutek
2008-05-16 11:19 ` Hannes Reinecke
2 siblings, 0 replies; 6+ messages in thread
From: malahal @ 2008-05-15 17:46 UTC (permalink / raw)
To: dm-devel
Wim Colgate [Wim.Colgate@citrix.com] wrote:
> Hi,
>
Simply (re)stated:
> 1) Are there hooks for dm/multipath events to notify software?
Not that I know of, but multipath uses uevets, so you can have your own
daemon listening.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: simple question... to tough to answer?
2008-05-15 17:09 simple question... to tough to answer? Wim Colgate
2008-05-15 17:46 ` malahal
@ 2008-05-15 17:54 ` Konrad Rzeszutek
2008-05-16 11:19 ` Hannes Reinecke
2 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek @ 2008-05-15 17:54 UTC (permalink / raw)
To: device-mapper development
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
On Thu, May 15, 2008 at 10:09:35AM -0700, Wim Colgate wrote:
> Hi,
>
>
>
> I'm not quite sure why no one in the community hasn't been able to
> answer my questions.
Probably b/c folks are too busy..
>
>
>
> Simply (re)stated:
>
>
>
> 1) Are there hooks for dm/multipath events to notify software?
You can also listen to the NETLINK_DM socket and parse the data.
But that complicated by the fact that there is only one
socket that the kernel uses and it cannot be shared.
>
> 2) does path down/up fire up udev rules?
Yes. I am attaching a simple program you can use to listen to the kobject uevents
that get fired.
You can also modify it to use NETLINK_DM instead of NETLINK_KOBJECT_UEVENT and see
what comes out.
[-- Attachment #2: listen.c --]
[-- Type: text/plain, Size: 1061 bytes --]
#include <sys/socket.h>
#include <linux/netlink.h>
#include <stdio.h>
#include <string.h>
#define MAX_PAYLOAD 1024 /* maximum payload size */
struct sockaddr_nl src_addr;
int sock_fd;
static char buff[MAX_PAYLOAD];
ssize_t buflen;
int
main ()
{
sock_fd = socket (PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
memset (&src_addr, 0, sizeof (src_addr));
src_addr.nl_family = AF_NETLINK;
src_addr.nl_pid = getpid (); /* self pid */
src_addr.nl_groups = 0xffffffff;
printf ("Listen..\n");
bind (sock_fd, (struct sockaddr *) &src_addr, sizeof (src_addr));
printf ("Receiving..\n");
while (1)
{
buflen = recv (sock_fd, &buff, sizeof (buff), 0);
printf ("Got data: %d\n", buflen);
int i, bufpos;
char *key;
for (i = 0, bufpos = 0; (bufpos < buflen) && i < MAX_PAYLOAD; i++)
{
key = &buff[bufpos];
printf ("[%s]\n", key);
bufpos += strlen (key) + 1;
}
memset (&buff, 0, MAX_PAYLOAD);
}
/* Close Netlink Socket */
close (sock_fd);
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: simple question... to tough to answer?
2008-05-15 17:09 simple question... to tough to answer? Wim Colgate
2008-05-15 17:46 ` malahal
2008-05-15 17:54 ` Konrad Rzeszutek
@ 2008-05-16 11:19 ` Hannes Reinecke
2008-05-16 15:27 ` Mike Anderson
2 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2008-05-16 11:19 UTC (permalink / raw)
To: device-mapper development
Hi Wim,
Wim Colgate wrote:
> Hi,
>
> I’m not quite sure why no one in the community hasn’t been able to
> answer my questions.
>
> Simply (re)stated:
>
> 1) Are there hooks for dm/multipath events to notify software?
>
Yes. There is the general dm_event mechanism (which I wouldn't recommend)
or with newer kernels you'll get netlink events from multipath for any
path-related events.
> 2) does path down/up fire up udev rules?
>
Not as such. As stated above we should be sending out netlink events for
path up/down events, but to my knowledge no-one is taking advantage
of them. Certainly not udev in its default setting nor multipath.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: simple question... to tough to answer?
2008-05-16 11:19 ` Hannes Reinecke
@ 2008-05-16 15:27 ` Mike Anderson
2008-06-05 19:06 ` Craig Simpson
0 siblings, 1 reply; 6+ messages in thread
From: Mike Anderson @ 2008-05-16 15:27 UTC (permalink / raw)
To: device-mapper development
Hannes Reinecke <hare@suse.de> wrote:
> Hi Wim,
>
> Wim Colgate wrote:
>> Hi,
>>
>> I???m not quite sure why no one in the community hasn???t been able to
>> answer my questions.
>>
>> Simply (re)stated:
>>
>> 1) Are there hooks for dm/multipath events to notify software?
>>
> Yes. There is the general dm_event mechanism (which I wouldn't recommend)
> or with newer kernels you'll get netlink events from multipath for any
> path-related events.
>
You can look at the documentation in recent kernels trees to get an
example of the event attributes provided with each event using the
uevent interface: Documentation/device-mapper/dm-uevent.txt
>> 2) does path down/up fire up udev rules?
>>
> Not as such. As stated above we should be sending out netlink events for
> path up/down events, but to my knowledge no-one is taking advantage
> of them. Certainly not udev in its default setting nor multipath.
One should note that if using the the current git version of the multipath
tools and one wants to experiment with additional events one would need to
add a udev rule "(i.e., RUN+="socket:...") You can reference this previous
email for context.
http://article.gmane.org/gmane.linux.scsi/36165
On some what related note. With all the work around making sure we can run
in low memory situations we should make a choice to use raw netlink
interface or the udev abstract namespace socket.
-andmike
--
Michael Anderson
andmike@linux.vnet.ibm.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: simple question... to tough to answer?
2008-05-16 15:27 ` Mike Anderson
@ 2008-06-05 19:06 ` Craig Simpson
0 siblings, 0 replies; 6+ messages in thread
From: Craig Simpson @ 2008-06-05 19:06 UTC (permalink / raw)
To: device-mapper development
By chance does anyone have a working configuration of some example of
this working?
I am not so interested in a SNMP trap. But if I could have it email/page
me, now that would rock.
Craig
-----Original Message-----
From: dm-devel-bounces@redhat.com [mailto:dm-devel-bounces@redhat.com]
On Behalf Of Mike Anderson
Sent: Friday, May 16, 2008 8:27 AM
To: device-mapper development
Subject: Re: [dm-devel] simple question... to tough to answer?
Hannes Reinecke <hare@suse.de> wrote:
> Hi Wim,
>
> Wim Colgate wrote:
>> Hi,
>>
>> I???m not quite sure why no one in the community hasn???t been able
to
>> answer my questions.
>>
>> Simply (re)stated:
>>
>> 1) Are there hooks for dm/multipath events to notify software?
>>
> Yes. There is the general dm_event mechanism (which I wouldn't
recommend)
> or with newer kernels you'll get netlink events from multipath for any
> path-related events.
>
You can look at the documentation in recent kernels trees to get an
example of the event attributes provided with each event using the
uevent interface: Documentation/device-mapper/dm-uevent.txt
>> 2) does path down/up fire up udev rules?
>>
> Not as such. As stated above we should be sending out netlink events
for
> path up/down events, but to my knowledge no-one is taking advantage
> of them. Certainly not udev in its default setting nor multipath.
One should note that if using the the current git version of the
multipath
tools and one wants to experiment with additional events one would need
to
add a udev rule "(i.e., RUN+="socket:...") You can reference this
previous
email for context.
http://article.gmane.org/gmane.linux.scsi/36165
On some what related note. With all the work around making sure we can
run
in low memory situations we should make a choice to use raw netlink
interface or the udev abstract namespace socket.
-andmike
--
Michael Anderson
andmike@linux.vnet.ibm.com
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-06-05 19:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 17:09 simple question... to tough to answer? Wim Colgate
2008-05-15 17:46 ` malahal
2008-05-15 17:54 ` Konrad Rzeszutek
2008-05-16 11:19 ` Hannes Reinecke
2008-05-16 15:27 ` Mike Anderson
2008-06-05 19:06 ` Craig Simpson
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.