quorum_initialize.3.in 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .\"/*
  2. .\" * Copyright (c) 2012 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Author: Fabio M. Di Nitto <fdinitto@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 QUORUM_INITIALIZE 3 @BUILDDATE@ "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  35. .SH NAME
  36. quorum_initialize \- Create a new connection to the Quorum service
  37. .SH SYNOPSIS
  38. .B #include <corosync/quorum.h>
  39. .sp
  40. .BI "int quorum_initialize(quorum_handle_t *" handle ", quorum_callbacks_t *" callbacks ", uint32_t *" quorum_type ");"
  41. .SH DESCRIPTION
  42. The
  43. .B quorum_initialize
  44. function is used to initialize a connection to the quorum API.
  45. .PP
  46. Each application may have several connections to the quorum 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 quorum service.
  53. .PP
  54. Every time the voting configuration changes (eg a node joins or leave the cluster) or the quorum status change,
  55. the callback is called.
  56. The callback function is described by the following type definitions:
  57. .nf
  58. typedef void (*quorum_notification_fn_t) (
  59. quorum_handle_t handle,
  60. uint32_t quorate,
  61. uint64_t ring_seq,
  62. uint32_t view_list_entries,
  63. uint32_t *view_list
  64. );
  65. .fi
  66. .PP
  67. The
  68. .I callbacks
  69. argument is of the type:
  70. .nf
  71. typedef struct {
  72. quorum_notification_fn_t quorum_notify_fn;
  73. } quorum_callbacks_t;
  74. .fi
  75. .PP
  76. The
  77. .I quorum_type
  78. argument is set to:
  79. .nf
  80. #define QUORUM_FREE 0
  81. #define QUORUM_SET 1
  82. .fi
  83. .PP
  84. .I QUORUM_FREE
  85. value means that no quorum algorithm is loaded and that no callbacks will take place.
  86. .PP
  87. .I QUORUM_SET
  88. value means that one quorum algorithm is configured and that callbacks will take place.
  89. .PP
  90. When a configuration change occurs, the callback
  91. is called from the
  92. .B quorum_dispatch()
  93. function.
  94. .PP
  95. .SH RETURN VALUE
  96. This call returns the CS_OK value if successful, otherwise an error is returned.
  97. .PP
  98. .SH ERRORS
  99. @COMMONIPCERRORS@
  100. .SH "SEE ALSO"
  101. .BR quorum_overview (8),
  102. .BR quorum_finalize (3),
  103. .BR quorum_getquorate (3),
  104. .BR quorum_trackstart (3),
  105. .BR quorum_trackstop (3),
  106. .BR quorum_fd_get (3),
  107. .BR quorum_dispatch (3),
  108. .BR quorum_context_set (3),
  109. .BR quorum_context_get (3)
  110. .PP