[Linux-cluster] Interfacing csnap to cluster stack

Daniel McNeil daniel at osdl.org
Fri Oct 8 19:34:46 UTC 2004


On Wed, 2004-10-06 at 17:55, Daniel Phillips wrote:
... stuff deleted ...
> 
> Sorry, I meant "cman api", here is how Magma talks to it:
> 
> ...cluster/magma-plugins$ grep ioctl * -r
> cman/cman.c:#include <sys/ioctl.h>
> cman/cman.c:            x = ioctl(p->sockfd, SIOCCLUSTER_GETMEMBERS, NULL);
> cman/cman.c:    } while (ioctl(p->sockfd, SIOCCLUSTER_GETMEMBERS, &cman_nl) !=
> cman/cman.c:    qs = ioctl(p->sockfd, SIOCCLUSTER_ISQUORATE, NULL);
> cman/cman.c:    return ioctl(p->sockfd, SIOCCLUSTER_KILLNODE, nodeid);
> sm/services.c:#include <linux/ioctl.h>
> sm/services.c:#include <sys/ioctl.h>
> sm/services.c:          x = ioctl(sockfd, SIOCCLUSTER_GETMEMBERS, NULL);
> sm/services.c:  } while (ioctl(sockfd, SIOCCLUSTER_GETMEMBERS, &cman_nl) !=
> sm/sm.c:#include <sys/ioctl.h>
> sm/sm.c:                x = ioctl(p->sockfd, op, NULL);
> sm/sm.c:        } while (ioctl(p->sockfd, op, &sm_nl) != sm_nl.max_members);
> sm/sm.c:        qs = ioctl(p->sockfd, SIOCCLUSTER_ISQUORATE, NULL);
> sm/sm.c:                if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_GETEVENT,
> sm/sm.c:                        ioctl(p->sockfd, SIOCCLUSTER_SERVICE_STARTDONE,
> sm/sm.c:                if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_GETEVENT,
> sm/sm.c:        if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_REGISTER, p->groupname) < 0) {
> sm/sm.c:        if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_JOIN, p->groupname) < 0) {
> sm/sm.c:                if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_LEAVE, NULL))
> sm/sm.c:        ioctl(p->sockfd, SIOCCLUSTER_SERVICE_UNREGISTER, NULL);
> sm/sm.c:        return ioctl(p->sockfd, SIOCCLUSTER_KILLNODE, nodeid);
> sm/sm.c:        if (ioctl(p->sockfd, SIOCCLUSTER_SERVICE_GETEVENT, &ev) < 0) {
> sm/sm.c:                //printf("ioctl() failed: %s\n", strerror(errno));
> sm/sm.c:                ioctl(p->sockfd, SIOCCLUSTER_SERVICE_STARTDONE, ev.event_id);
> 
> Maybe csnap will end up talking to it the same way, who knows.  I just
> always feel like I got something icky on myself when I call an ioctl.
> 

These ioctls are ugly.  Shouldn't there be a library interface for
getting this info?  We all agreed there should be an API for
membership and quorum.  There should be an API for both the
kernel and user-land.  csnap should NOT use ioctls.

Daniel




More information about the Linux-cluster mailing list