diff --git a/.gitignore b/.gitignore index 3ea4aba..d02a7d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libqb-0.17.1.tar.xz +SOURCES/libqb-1.0.tar.xz diff --git a/.libqb.metadata b/.libqb.metadata index 6211ac9..62ba640 100644 --- a/.libqb.metadata +++ b/.libqb.metadata @@ -1 +1 @@ -fef008494b556518ddbdd88eeac844683396a686 SOURCES/libqb-0.17.1.tar.xz +f21035c914767ba4bf1a6651c438970106dc17e6 SOURCES/libqb-1.0.tar.xz diff --git a/SOURCES/bz1198718-libqb-realtime-priority-fix.patch b/SOURCES/bz1198718-libqb-realtime-priority-fix.patch deleted file mode 100644 index ea00e3d..0000000 --- a/SOURCES/bz1198718-libqb-realtime-priority-fix.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 7f56f583d891859c94b24db0ec38a301c3f3466a Mon Sep 17 00:00:00 2001 -From: David Vossel -Date: Mon, 23 Feb 2015 14:59:51 -0500 -Subject: [PATCH] High: yield to scheduler during new connection auth - processing - ---- - lib/ipc_setup.c | 233 ++++++++++++++++++++++++++++++++++++++------------------ - 1 file changed, 159 insertions(+), 74 deletions(-) - -diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c -index 1ea085b..144b4c0 100644 ---- a/lib/ipc_setup.c -+++ b/lib/ipc_setup.c -@@ -48,6 +48,24 @@ struct ipc_auth_ugp { - pid_t pid; - }; - -+struct ipc_auth_data { -+ int32_t sock; -+ struct qb_ipcs_service *s; -+ struct qb_ipc_connection_request msg; -+ struct msghdr msg_recv; -+ struct iovec iov_recv; -+ struct ipc_auth_ugp ugp; -+ -+ size_t processed; -+ size_t len; -+ -+#ifdef SO_PASSCRED -+ char *cmsg_cred; -+#endif -+ -+}; -+ -+ - static int32_t qb_ipcs_us_connection_acceptor(int fd, int revent, void *data); - - ssize_t -@@ -83,20 +101,21 @@ retry_send: - } - - static ssize_t --qb_ipc_us_recv_msghdr(int32_t s, struct msghdr *hdr, char *msg, size_t len) -+qb_ipc_us_recv_msghdr(struct ipc_auth_data *data) - { -+ char *msg = (char *) &data->msg; - int32_t result; -- int32_t processed = 0; - - qb_sigpipe_ctl(QB_SIGPIPE_IGNORE); - - retry_recv: -- hdr->msg_iov->iov_base = &msg[processed]; -- hdr->msg_iov->iov_len = len - processed; -+ data->msg_recv.msg_iov->iov_base = &msg[data->processed]; -+ data->msg_recv.msg_iov->iov_len = data->len - data->processed; - -- result = recvmsg(s, hdr, MSG_NOSIGNAL | MSG_WAITALL); -+ result = recvmsg(data->sock, &data->msg_recv, MSG_NOSIGNAL | MSG_WAITALL); - if (result == -1 && errno == EAGAIN) { -- goto retry_recv; -+ qb_sigpipe_ctl(QB_SIGPIPE_DEFAULT); -+ return -EAGAIN; - } - if (result == -1) { - qb_sigpipe_ctl(QB_SIGPIPE_DEFAULT); -@@ -105,18 +124,18 @@ retry_recv: - if (result == 0) { - qb_sigpipe_ctl(QB_SIGPIPE_DEFAULT); - qb_util_log(LOG_DEBUG, -- "recv(fd %d) got 0 bytes assuming ENOTCONN", s); -+ "recv(fd %d) got 0 bytes assuming ENOTCONN", data->sock); - return -ENOTCONN; - } - -- processed += result; -- if (processed != len) { -+ data->processed += result; -+ if (data->processed != data->len) { - goto retry_recv; - } - qb_sigpipe_ctl(QB_SIGPIPE_DEFAULT); -- assert(processed == len); -+ assert(data->processed == data->len); - -- return processed; -+ return data->processed; - } - - int32_t -@@ -434,6 +453,7 @@ qb_ipcs_us_withdraw(struct qb_ipcs_service * s) - (void)s->poll_fns.dispatch_del(s->server_sock); - shutdown(s->server_sock, SHUT_RDWR); - close(s->server_sock); -+ s->server_sock = -1; - return 0; - } - -@@ -541,45 +561,56 @@ send_response: - return res; - } - --static int32_t --qb_ipcs_uc_recv_and_auth(int32_t sock, void *msg, size_t len, -- struct ipc_auth_ugp *ugp) -+static void -+destroy_ipc_auth_data(struct ipc_auth_data *data) - { -- int32_t res = 0; -- struct msghdr msg_recv; -- struct iovec iov_recv; -+ if (data->s) { -+ qb_ipcs_unref(data->s); -+ } - - #ifdef SO_PASSCRED -- char cmsg_cred[CMSG_SPACE(sizeof(struct ucred))]; -- int off = 0; -- int on = 1; --#endif -- msg_recv.msg_iov = &iov_recv; -- msg_recv.msg_iovlen = 1; -- msg_recv.msg_name = 0; -- msg_recv.msg_namelen = 0; --#ifdef SO_PASSCRED -- msg_recv.msg_control = (void *)cmsg_cred; -- msg_recv.msg_controllen = sizeof(cmsg_cred); -+ free(data->cmsg_cred); - #endif --#ifdef QB_SOLARIS -- msg_recv.msg_accrights = 0; -- msg_recv.msg_accrightslen = 0; --#else -- msg_recv.msg_flags = 0; --#endif /* QB_SOLARIS */ -+ free(data); -+} -+ -+static int32_t -+process_auth(int32_t fd, int32_t revents, void *d) -+{ -+ struct ipc_auth_data *data = (struct ipc_auth_data *) d; - -- iov_recv.iov_base = msg; -- iov_recv.iov_len = len; -+ int32_t res = 0; - #ifdef SO_PASSCRED -- setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); -+ int off = 0; - #endif - -- res = qb_ipc_us_recv_msghdr(sock, &msg_recv, msg, len); -- if (res < 0) { -+ if (data->s->server_sock == -1) { -+ qb_util_log(LOG_DEBUG, "Closing fd (%d) for server shutdown", fd); -+ res = -ESHUTDOWN; - goto cleanup_and_return; - } -- if (res != len) { -+ -+ if (revents & POLLNVAL) { -+ qb_util_log(LOG_DEBUG, "NVAL conn fd (%d)", fd); -+ res = -EINVAL; -+ goto cleanup_and_return; -+ } -+ if (revents & POLLHUP) { -+ qb_util_log(LOG_DEBUG, "HUP conn fd (%d)", fd); -+ res = -ESHUTDOWN; -+ goto cleanup_and_return; -+ } -+ if ((revents & POLLIN) == 0) { -+ return 0; -+ } -+ -+ res = qb_ipc_us_recv_msghdr(data); -+ if (res == -EAGAIN) { -+ /* yield to mainloop, Let mainloop call us again */ -+ return 0; -+ } -+ -+ if (res != data->len) { - res = -EIO; - goto cleanup_and_return; - } -@@ -595,11 +626,11 @@ qb_ipcs_uc_recv_and_auth(int32_t sock, void *msg, size_t len, - { - ucred_t *uc = NULL; - -- if (getpeerucred(sock, &uc) == 0) { -+ if (getpeerucred(data->sock, &uc) == 0) { - res = 0; -- ugp->uid = ucred_geteuid(uc); -- ugp->gid = ucred_getegid(uc); -- ugp->pid = ucred_getpid(uc); -+ ugp.uid = ucred_geteuid(uc); -+ ugp.gid = ucred_getegid(uc); -+ ugp.pid = ucred_getpid(uc); - ucred_free(uc); - } else { - res = -errno; -@@ -614,7 +645,7 @@ qb_ipcs_uc_recv_and_auth(int32_t sock, void *msg, size_t len, - * TODO get the peer's pid. - * c->pid = ?; - */ -- if (getpeereid(sock, &ugp->uid, &ugp->gid) == 0) { -+ if (getpeereid(data->sock, &ugp.uid, &ugp.gid) == 0) { - res = 0; - } else { - res = -errno; -@@ -630,33 +661,105 @@ qb_ipcs_uc_recv_and_auth(int32_t sock, void *msg, size_t len, - struct cmsghdr *cmsg; - - res = -EINVAL; -- for (cmsg = CMSG_FIRSTHDR(&msg_recv); cmsg != NULL; -- cmsg = CMSG_NXTHDR(&msg_recv, cmsg)) { -+ for (cmsg = CMSG_FIRSTHDR(&data->msg_recv); cmsg != NULL; -+ cmsg = CMSG_NXTHDR(&data->msg_recv, cmsg)) { - if (cmsg->cmsg_type != SCM_CREDENTIALS) - continue; - - memcpy(&cred, CMSG_DATA(cmsg), sizeof(struct ucred)); - res = 0; -- ugp->pid = cred.pid; -- ugp->uid = cred.uid; -- ugp->gid = cred.gid; -+ data->ugp.pid = cred.pid; -+ data->ugp.uid = cred.uid; -+ data->ugp.gid = cred.gid; - break; - } - } - #else /* no credentials */ -- ugp->pid = 0; -- ugp->uid = 0; -- ugp->gid = 0; -+ data->ugp.pid = 0; -+ data->ugp.uid = 0; -+ data->ugp.gid = 0; - res = -ENOTSUP; - #endif /* no credentials */ - - cleanup_and_return: -+#ifdef SO_PASSCRED -+ setsockopt(data->sock, SOL_SOCKET, SO_PASSCRED, &off, sizeof(off)); -+#endif - -+ (void)data->s->poll_fns.dispatch_del(data->sock); -+ -+ if (res < 0) { -+ close(data->sock); -+ } else if (data->msg.hdr.id == QB_IPC_MSG_AUTHENTICATE) { -+ (void)handle_new_connection(data->s, res, data->sock, &data->msg, data->len, &data->ugp); -+ } else { -+ close(data->sock); -+ } -+ destroy_ipc_auth_data(data); -+ -+ return 1; -+} -+ -+static void -+qb_ipcs_uc_recv_and_auth(int32_t sock, struct qb_ipcs_service *s) -+{ -+ int res = 0; -+ struct ipc_auth_data *data = NULL; - #ifdef SO_PASSCRED -- setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &off, sizeof(off)); -+ int on = 1; - #endif - -- return res; -+ data = calloc(1, sizeof(struct ipc_auth_data)); -+ if (data == NULL) { -+ close(sock); -+ /* -ENOMEM */ -+ return; -+ } -+ -+ data->s = s; -+ qb_ipcs_ref(data->s); -+ -+ data->msg_recv.msg_iov = &data->iov_recv; -+ data->msg_recv.msg_iovlen = 1; -+ data->msg_recv.msg_name = 0; -+ data->msg_recv.msg_namelen = 0; -+ -+#ifdef SO_PASSCRED -+ data->cmsg_cred = calloc(1,CMSG_SPACE(sizeof(struct ucred))); -+ if (data->cmsg_cred == NULL) { -+ close(sock); -+ destroy_ipc_auth_data(data); -+ /* -ENOMEM */ -+ return; -+ } -+ data->msg_recv.msg_control = (void *)data->cmsg_cred; -+ data->msg_recv.msg_controllen = CMSG_SPACE(sizeof(struct ucred)); -+#endif -+#ifdef QB_SOLARIS -+ data->msg_recv.msg_accrights = 0; -+ data->msg_recv.msg_accrightslen = 0; -+#else -+ data->msg_recv.msg_flags = 0; -+#endif /* QB_SOLARIS */ -+ -+ data->len = sizeof(struct qb_ipc_connection_request); -+ data->iov_recv.iov_base = &data->msg; -+ data->iov_recv.iov_len = data->len; -+ data->sock = sock; -+ -+#ifdef SO_PASSCRED -+ setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); -+#endif -+ -+ res = s->poll_fns.dispatch_add(QB_LOOP_MED, -+ data->sock, -+ POLLIN | POLLPRI | POLLNVAL, -+ data, process_auth); -+ if (res < 0) { -+ qb_util_log(LOG_DEBUG, "Failed to process AUTH for fd (%d)", data->sock); -+ close(sock); -+ destroy_ipc_auth_data(data); -+ } - } - - static int32_t -@@ -666,8 +769,6 @@ qb_ipcs_us_connection_acceptor(int fd, int revent, void *data) - int32_t new_fd; - struct qb_ipcs_service *s = (struct qb_ipcs_service *)data; - int32_t res; -- struct qb_ipc_connection_request setup_msg; -- struct ipc_auth_ugp ugp; - socklen_t addrlen = sizeof(struct sockaddr_un); - - if (revent & (POLLNVAL | POLLHUP | POLLERR)) { -@@ -707,22 +808,6 @@ retry_accept: - return 0; - } - -- res = qb_ipcs_uc_recv_and_auth(new_fd, &setup_msg, sizeof(setup_msg), -- &ugp); -- if (res < 0) { -- close(new_fd); -- /* This is an error, but -1 would indicate disconnect -- * from the poll loop -- */ -- return 0; -- } -- -- if (setup_msg.hdr.id == QB_IPC_MSG_AUTHENTICATE) { -- (void)handle_new_connection(s, res, new_fd, &setup_msg, -- sizeof(setup_msg), &ugp); -- } else { -- close(new_fd); -- } -- -+ qb_ipcs_uc_recv_and_auth(new_fd, s); - return 0; - } --- -1.8.4.2 - diff --git a/SOURCES/bz1211375-ipc-test-update1.patch b/SOURCES/bz1211375-ipc-test-update1.patch deleted file mode 100644 index 8ee3119..0000000 --- a/SOURCES/bz1211375-ipc-test-update1.patch +++ /dev/null @@ -1,183 +0,0 @@ -From c6c9a9ed6feb47bd357ce56c00f80cc6985390e1 Mon Sep 17 00:00:00 2001 -From: David Vossel -Date: Tue, 14 Apr 2015 15:10:28 -0400 -Subject: [PATCH 2/4] Low: tests: regression tests for stress testing loop_poll - ipc create/destroy - ---- - tests/check_ipc.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 96 insertions(+) - -diff --git a/tests/check_ipc.c b/tests/check_ipc.c -index ce9a7c0..79faa16 100644 ---- a/tests/check_ipc.c -+++ b/tests/check_ipc.c -@@ -94,6 +94,7 @@ static int32_t disconnect_after_created = QB_FALSE; - static int32_t num_bulk_events = 10; - static int32_t num_stress_events = 30000; - static int32_t reference_count_test = QB_FALSE; -+static int32_t multiple_connections = QB_FALSE; - - - static int32_t -@@ -227,6 +228,7 @@ s1_msg_process_fn(qb_ipcs_connection_t *c, - } else if (req_pt->id == IPC_MSG_REQ_SERVER_FAIL) { - exit(0); - } else if (req_pt->id == IPC_MSG_REQ_SERVER_DISCONNECT) { -+ multiple_connections = QB_FALSE; - qb_ipcs_disconnect(c); - } - return 0; -@@ -263,6 +265,9 @@ my_dispatch_del(int32_t fd) - static int32_t - s1_connection_closed(qb_ipcs_connection_t *c) - { -+ if (multiple_connections) { -+ return 0; -+ } - qb_enter(); - qb_leave(); - return 0; -@@ -301,6 +306,10 @@ outq_flush (void *data) - static void - s1_connection_destroyed(qb_ipcs_connection_t *c) - { -+ if (multiple_connections) { -+ return; -+ } -+ - qb_enter(); - if (reference_count_test) { - struct cs_ipcs_conn_context *cnx; -@@ -316,6 +325,9 @@ static void - s1_connection_created(qb_ipcs_connection_t *c) - { - uint32_t max = MAX_MSG_SIZE; -+ if (multiple_connections) { -+ return; -+ } - - if (send_event_on_created) { - struct qb_ipc_response_header response; -@@ -934,6 +946,60 @@ count_bulk_events(int32_t fd, int32_t revents, void *data) - } - - static void -+test_ipc_stress_connections(void) -+{ -+ int32_t c = 0; -+ int32_t j = 0; -+ uint32_t max_size = MAX_MSG_SIZE; -+ int32_t connections = 0; -+ pid_t pid; -+ -+ multiple_connections = QB_TRUE; -+ -+ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_CLEAR_ALL, -+ QB_LOG_FILTER_FILE, "*", LOG_TRACE); -+ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD, -+ QB_LOG_FILTER_FILE, "*", LOG_INFO); -+ qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE); -+ -+ pid = run_function_in_new_process(run_ipc_server); -+ fail_if(pid == -1); -+ sleep(1); -+ -+ for (connections = 1; connections < 70000; connections++) { -+ if (conn) { -+ qb_ipcc_disconnect(conn); -+ conn = NULL; -+ } -+ do { -+ conn = qb_ipcc_connect(ipc_name, max_size); -+ if (conn == NULL) { -+ j = waitpid(pid, NULL, WNOHANG); -+ ck_assert_int_eq(j, 0); -+ sleep(1); -+ c++; -+ } -+ } while (conn == NULL && c < 5); -+ fail_if(conn == NULL); -+ -+ if (((connections+1) % 1000) == 0) { -+ qb_log(LOG_INFO, "%d ipc connections made", connections+1); -+ } -+ } -+ multiple_connections = QB_FALSE; -+ -+ request_server_exit(); -+ verify_graceful_stop(pid); -+ qb_ipcc_disconnect(conn); -+ -+ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_CLEAR_ALL, -+ QB_LOG_FILTER_FILE, "*", LOG_TRACE); -+ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD, -+ QB_LOG_FILTER_FILE, "*", LOG_TRACE); -+ qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE); -+} -+ -+static void - test_ipc_bulk_events(void) - { - int32_t c = 0; -@@ -1076,6 +1142,16 @@ START_TEST(test_ipc_stress_test_us) - } - END_TEST - -+START_TEST(test_ipc_stress_connections_us) -+{ -+ qb_enter(); -+ ipc_type = QB_IPC_SOCKET; -+ ipc_name = __func__; -+ test_ipc_stress_connections(); -+ qb_leave(); -+} -+END_TEST -+ - START_TEST(test_ipc_bulk_events_us) - { - qb_enter(); -@@ -1265,6 +1341,16 @@ START_TEST(test_ipc_stress_test_shm) - } - END_TEST - -+START_TEST(test_ipc_stress_connections_shm) -+{ -+ qb_enter(); -+ ipc_type = QB_IPC_SHM; -+ ipc_name = __func__; -+ test_ipc_stress_connections(); -+ qb_leave(); -+} -+END_TEST -+ - START_TEST(test_ipc_bulk_events_shm) - { - qb_enter(); -@@ -1439,6 +1525,11 @@ make_shm_suite(void) - tcase_set_timeout(tc, 10); - suite_add_tcase(s, tc); - -+ tc = tcase_create("ipc_stress_connections"); -+ tcase_add_test(tc, test_ipc_stress_connections_shm); -+ tcase_set_timeout(tc, 200); -+ suite_add_tcase(s, tc); -+ - return s; - } - -@@ -1513,6 +1604,11 @@ make_soc_suite(void) - tcase_set_timeout(tc, 10); - suite_add_tcase(s, tc); - -+ tc = tcase_create("ipc_stress_connections"); -+ tcase_add_test(tc, test_ipc_stress_connections_us); -+ tcase_set_timeout(tc, 200); -+ suite_add_tcase(s, tc); -+ - return s; - } - --- -1.8.4.2 - diff --git a/SOURCES/bz1211375-ipc-test-update2.patch b/SOURCES/bz1211375-ipc-test-update2.patch deleted file mode 100644 index 901b67a..0000000 --- a/SOURCES/bz1211375-ipc-test-update2.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 340ed23772de567186e964a8278d668680a962a9 Mon Sep 17 00:00:00 2001 -From: David Vossel -Date: Thu, 16 Apr 2015 09:40:08 -0500 -Subject: [PATCH 3/4] Low: check_ipc: give connection stress tests for shm and - socket unique names - ---- - tests/check_ipc.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tests/check_ipc.c b/tests/check_ipc.c -index 79faa16..b69d9fb 100644 ---- a/tests/check_ipc.c -+++ b/tests/check_ipc.c -@@ -1525,7 +1525,7 @@ make_shm_suite(void) - tcase_set_timeout(tc, 10); - suite_add_tcase(s, tc); - -- tc = tcase_create("ipc_stress_connections"); -+ tc = tcase_create("ipc_stress_connections_shm"); - tcase_add_test(tc, test_ipc_stress_connections_shm); - tcase_set_timeout(tc, 200); - suite_add_tcase(s, tc); -@@ -1604,7 +1604,7 @@ make_soc_suite(void) - tcase_set_timeout(tc, 10); - suite_add_tcase(s, tc); - -- tc = tcase_create("ipc_stress_connections"); -+ tc = tcase_create("ipc_stress_connections_us"); - tcase_add_test(tc, test_ipc_stress_connections_us); - tcase_set_timeout(tc, 200); - suite_add_tcase(s, tc); --- -1.8.4.2 - diff --git a/SOURCES/bz1211375-ipc-test-update3.patch b/SOURCES/bz1211375-ipc-test-update3.patch deleted file mode 100644 index 7cea470..0000000 --- a/SOURCES/bz1211375-ipc-test-update3.patch +++ /dev/null @@ -1,281 +0,0 @@ -From 378be495e888fc9b5c1adeef078c06b662cf5a54 Mon Sep 17 00:00:00 2001 -From: David Vossel -Date: Thu, 16 Apr 2015 09:53:12 -0500 -Subject: [PATCH 4/4] Low: check_ipc: generate unique server names for tests - -Package builders that run multiple builds of libqb in parallel -will fail because the IPC unit tests stomp on each other's namespace. -We have to give each IPC server a randomized unique name during -'make check' to avoid this. ---- - tests/check_ipc.c | 65 +++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 39 insertions(+), 26 deletions(-) - -diff --git a/tests/check_ipc.c b/tests/check_ipc.c -index b69d9fb..4397963 100644 ---- a/tests/check_ipc.c -+++ b/tests/check_ipc.c -@@ -32,7 +32,7 @@ - #include - #include - --static const char *ipc_name = "ipc_test"; -+static char ipc_name[256]; - - #define DEFAULT_MAX_MSG_SIZE (8192*16) - static int CALCULATED_DGRAM_MAX_MSG_SIZE = 0; -@@ -105,6 +105,18 @@ exit_handler(int32_t rsignal, void *data) - return -1; - } - -+static void -+set_ipc_name(const char *prefix) -+{ -+ /* We have to give the server name a random postfix because -+ * some build systems attempt to generate packages for libqb -+ * in parallel. These unit tests are run during the package -+ * build process. Two builds executing on the same machine -+ * can stomp on each other's unit tests if the ipc server -+ * names aren't unique... This was very confusing to debug */ -+ snprintf(ipc_name, 256, "%s-%d", prefix, (int32_t)random()); -+} -+ - static int32_t - s1_msg_process_fn(qb_ipcs_connection_t *c, - void *data, size_t size) -@@ -710,7 +722,7 @@ START_TEST(test_ipc_exit_us) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = 5000; - test_ipc_exit(); - qb_leave(); -@@ -721,7 +733,7 @@ START_TEST(test_ipc_exit_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = 1000; - test_ipc_exit(); - qb_leave(); -@@ -732,7 +744,7 @@ START_TEST(test_ipc_txrx_shm_timeout) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_txrx_timeout(); - qb_leave(); - } -@@ -742,7 +754,7 @@ START_TEST(test_ipc_txrx_us_timeout) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_txrx_timeout(); - qb_leave(); - } -@@ -753,7 +765,7 @@ START_TEST(test_ipc_txrx_shm_tmo) - qb_enter(); - turn_on_fc = QB_FALSE; - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = 1000; - test_ipc_txrx(); - qb_leave(); -@@ -765,7 +777,7 @@ START_TEST(test_ipc_txrx_shm_block) - qb_enter(); - turn_on_fc = QB_FALSE; - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = -1; - test_ipc_txrx(); - qb_leave(); -@@ -778,7 +790,7 @@ START_TEST(test_ipc_fc_shm) - turn_on_fc = QB_TRUE; - ipc_type = QB_IPC_SHM; - recv_timeout = 500; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_txrx(); - qb_leave(); - } -@@ -789,7 +801,7 @@ START_TEST(test_ipc_txrx_us_block) - qb_enter(); - turn_on_fc = QB_FALSE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = -1; - test_ipc_txrx(); - qb_leave(); -@@ -801,7 +813,7 @@ START_TEST(test_ipc_txrx_us_tmo) - qb_enter(); - turn_on_fc = QB_FALSE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - recv_timeout = 1000; - test_ipc_txrx(); - qb_leave(); -@@ -814,7 +826,7 @@ START_TEST(test_ipc_fc_us) - turn_on_fc = QB_TRUE; - ipc_type = QB_IPC_SOCKET; - recv_timeout = 500; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_txrx(); - qb_leave(); - } -@@ -869,7 +881,7 @@ START_TEST(test_ipc_disp_us) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_dispatch(); - qb_leave(); - } -@@ -1136,7 +1148,7 @@ START_TEST(test_ipc_stress_test_us) - qb_enter(); - send_event_on_created = QB_FALSE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_stress_test(); - qb_leave(); - } -@@ -1146,7 +1158,7 @@ START_TEST(test_ipc_stress_connections_us) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_stress_connections(); - qb_leave(); - } -@@ -1157,7 +1169,7 @@ START_TEST(test_ipc_bulk_events_us) - qb_enter(); - send_event_on_created = QB_FALSE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_bulk_events(); - qb_leave(); - } -@@ -1213,7 +1225,7 @@ START_TEST(test_ipc_event_on_created_us) - qb_enter(); - send_event_on_created = QB_TRUE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_event_on_created(); - qb_leave(); - } -@@ -1275,7 +1287,7 @@ START_TEST(test_ipc_disconnect_after_created_us) - qb_enter(); - disconnect_after_created = QB_TRUE; - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_disconnect_after_created(); - qb_leave(); - } -@@ -1314,7 +1326,7 @@ START_TEST(test_ipc_server_fail_soc) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_server_fail(); - qb_leave(); - } -@@ -1324,7 +1336,7 @@ START_TEST(test_ipc_disp_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_dispatch(); - qb_leave(); - } -@@ -1335,7 +1347,7 @@ START_TEST(test_ipc_stress_test_shm) - qb_enter(); - send_event_on_created = QB_FALSE; - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_stress_test(); - qb_leave(); - } -@@ -1345,7 +1357,7 @@ START_TEST(test_ipc_stress_connections_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_stress_connections(); - qb_leave(); - } -@@ -1355,7 +1367,7 @@ START_TEST(test_ipc_bulk_events_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_bulk_events(); - qb_leave(); - } -@@ -1366,7 +1378,7 @@ START_TEST(test_ipc_event_on_created_shm) - qb_enter(); - send_event_on_created = QB_TRUE; - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_event_on_created(); - qb_leave(); - } -@@ -1376,7 +1388,7 @@ START_TEST(test_ipc_server_fail_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_server_fail(); - qb_leave(); - } -@@ -1417,7 +1429,7 @@ START_TEST(test_ipc_service_ref_count_shm) - { - qb_enter(); - ipc_type = QB_IPC_SHM; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_service_ref_count(); - qb_leave(); - } -@@ -1427,7 +1439,7 @@ START_TEST(test_ipc_service_ref_count_us) - { - qb_enter(); - ipc_type = QB_IPC_SOCKET; -- ipc_name = __func__; -+ set_ipc_name(__func__); - test_ipc_service_ref_count(); - qb_leave(); - } -@@ -1620,6 +1632,7 @@ main(void) - Suite *s; - int32_t do_shm_tests = QB_TRUE; - -+ set_ipc_name("ipc_test"); - #ifdef DISABLE_IPC_SHM - do_shm_tests = QB_FALSE; - #endif /* DISABLE_IPC_SHM */ --- -1.8.4.2 - diff --git a/SOURCES/bz1211375-libqb-poll-fix.patch b/SOURCES/bz1211375-libqb-poll-fix.patch deleted file mode 100644 index be0a341..0000000 --- a/SOURCES/bz1211375-libqb-poll-fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b6f000f237eccf13ac3a1f2902d1fec8794e88cd Mon Sep 17 00:00:00 2001 -From: David Vossel -Date: Tue, 14 Apr 2015 11:52:59 -0400 -Subject: [PATCH 1/4] High: loop: fixes resource starvation in mainloop code - ---- - lib/loop_poll.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/loop_poll.c b/lib/loop_poll.c -index 49c9650..117a276 100644 ---- a/lib/loop_poll.c -+++ b/lib/loop_poll.c -@@ -110,7 +110,7 @@ _poll_dispatch_and_take_back_(struct qb_loop_item *item, - pe->item.user_data); - if (res < 0) { - _poll_entry_mark_deleted_(pe); -- } else { -+ } else if (pe->state != QB_POLL_ENTRY_DELETED) { - pe->state = QB_POLL_ENTRY_ACTIVE; - pe->ufd.revents = 0; - } --- -1.8.4.2 - diff --git a/SOURCES/bz1277538-increase-socket-field-len.patch b/SOURCES/bz1277538-increase-socket-field-len.patch deleted file mode 100644 index 87a03ae..0000000 --- a/SOURCES/bz1277538-increase-socket-field-len.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit 0766a3ca5473a9e126e91022075b4b3798b8d5bc -Author: Arkadiusz Bubala -Date: Thu Aug 6 08:56:59 2015 +0200 - - Increase the length of description field. - - Make description field larger to satisfy all possible pids and file - descriptor values. - -diff --git a/lib/ipc_int.h b/lib/ipc_int.h -index a428721..500315e 100644 ---- a/lib/ipc_int.h -+++ b/lib/ipc_int.h -@@ -159,7 +159,7 @@ enum qb_ipcs_connection_state { - QB_IPCS_CONNECTION_SHUTTING_DOWN, - }; - --#define CONNECTION_DESCRIPTION (16) -+#define CONNECTION_DESCRIPTION (34) /* INT_MAX length + 3 */ - - struct qb_ipcs_connection_auth { - uid_t uid; diff --git a/SPECS/libqb.spec b/SPECS/libqb.spec index 03913b4..fd72cf8 100644 --- a/SPECS/libqb.spec +++ b/SPECS/libqb.spec @@ -1,19 +1,13 @@ Name: libqb -Version: 0.17.1 -Release: 2%{?dist}.1 +Version: 1.0 +Release: 1%{?dist} Summary: An IPC library for high performance servers Group: System Environment/Libraries License: LGPLv2+ -URL: http://www.libqb.org -Source0: https://fedorahosted.org/releases/q/u/quarterback/%{name}-%{version}.tar.xz - -Patch1: bz1198718-libqb-realtime-priority-fix.patch -Patch2: bz1211375-ipc-test-update1.patch -Patch3: bz1211375-ipc-test-update2.patch -Patch4: bz1211375-ipc-test-update3.patch -Patch5: bz1211375-libqb-poll-fix.patch -Patch6: bz1277538-increase-socket-field-len.patch +URL: http://clusterlabs.github.io/libqb/ +Source0: https://github.com/ClusterLabs/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz +#Source0: https://github.com/ClusterLabs/%{name}/archive/v%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -27,12 +21,6 @@ Initially these are IPC and poll. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 # work-around for broken epoll in rawhide/f17 %build @@ -82,10 +70,13 @@ developing applications that use %{name}. %changelog -* Tue Nov 3 2015 Christine Caulfield - 0.17.1-2.1 - Increase size of the buffer where we make the socket name to allow for - longer PIDs - Resolves: rhbz#1277538 +* Thu Apr 21 2016 Christine Caulfield - 1.0-1 + Rebase to 1.0 + Resolves bz#1299968 + +* Mon Nov 2 2015 Christine Caulfield - 0.17.1-2.1 + Increase size of the buffer where we make the socket name to allow for longer PIDs + Resolves bz#1114852 * Thu Apr 16 2015 David Vossel - 0.17.1-2 Fixes assert encountered in libqb's mainloop implementation.