4
0

votequorum_initialize.3 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .\"/*
  2. .\" * Copyright (c) 2009 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Author: Christine Caulfield <ccaulfie@redhat.com>
  7. .\" *
  8. .\" * This software licensed under BSD license, the text of which follows:
  9. .\" *
  10. .\" * Redistribution and use in source and binary forms, with or without
  11. .\" * modification, are permitted provided that the following conditions are met:
  12. .\" *
  13. .\" * - Redistributions of source code must retain the above copyright notice,
  14. .\" * this list of conditions and the following disclaimer.
  15. .\" * - Redistributions in binary form must reproduce the above copyright notice,
  16. .\" * this list of conditions and the following disclaimer in the documentation
  17. .\" * and/or other materials provided with the distribution.
  18. .\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. .\" * contributors may be used to endorse or promote products derived from this
  20. .\" * software without specific prior written permission.
  21. .\" *
  22. .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. .\" * THE POSSIBILITY OF SUCH DAMAGE.
  33. .\" */
  34. .TH VOTEQUORUM_INITIALIZE 3 2009-01-26 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  35. .SH NAME
  36. votequorum_initialize \- Create a new connection to the VoteQuorum service
  37. .SH SYNOPSIS
  38. .B #include <corosync/votequorum.h>
  39. .sp
  40. .BI "int votequorum_initialize(votequorum_handle_t *" handle ", votequorum_callbacks_t *" callbacks ");
  41. .SH DESCRIPTION
  42. The
  43. .B votequorum_initialize
  44. function is used to initialize a connection to the vote-based quorum database API.
  45. .PP
  46. Each application may have several connections to the votequorum API. Each application
  47. uses the
  48. .I handle
  49. argument to uniquely identify the connection. The
  50. .I handle
  51. argument is then used in other function calls to identify the connection to be used
  52. for communication with the votequorum service.
  53. .PP
  54. Every time the voting configuraton changes (eg a node joins or leave the cluster), the callback is called.
  55. The callback function is described by the following type definitions:
  56. typedef void (*votequorum_notification_fn_t) (
  57. votequorum_handle_t handle,
  58. uint64_t context,
  59. uint32_t quorate,
  60. uint32_t node_list_entries,
  61. votequorum_node_t node_list[]
  62. );
  63. .ta
  64. .fi
  65. .RE
  66. .IP
  67. .PP
  68. .PP
  69. The
  70. .I callbacks
  71. argument is of the type:
  72. .IP
  73. .RS
  74. .ne 18
  75. .nf
  76. .PP
  77. typedef struct {
  78. votequorum_notification_fn_t votequorum_notify_fn;
  79. } votequorum_callbacks_t;
  80. .ta
  81. .fi
  82. .RE
  83. .IP
  84. .PP
  85. When a configuration change occurs, the callback
  86. is called from the
  87. .B votequorum_dispatch()
  88. function.
  89. .PP
  90. .SH RETURN VALUE
  91. This call returns the CS_OK value if successful, otherwise an error is returned.
  92. .PP
  93. .SH BUGS
  94. Callbacks are not support at the moment.
  95. .PP
  96. .SH ERRORS
  97. The errors are undocumented.
  98. .SH "SEE ALSO"
  99. .BR votequorum_overview (8),
  100. .BR votequorum_finalize (3),
  101. .BR votequorum_fd_get (3),
  102. .BR votequorum_dispatch (3),
  103. .PP