Bug 1368042

Summary: make fails if Events APIs are disabled
Product: [Community] GlusterFS Reporter: Aravinda VK <avishwan>
Component: eventsapiAssignee: Aravinda VK <avishwan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: amukherj
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.9.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-27 18:19:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1351589    

Description Aravinda VK 2016-08-18 07:57:17 UTC
Description of problem:
If Events APIs are disabled using `./configure --disable-events` then make will get following error since events.h or events.c files are not loaded in libglusterfs. I think we need to use #if (USE_EVENTS) and #endif everywhere we call gf_event

Additional info:
cli-cmd-volume.c: In function ‘cli_cmd_volume_create_cbk’:
cli-cmd-volume.c:247:17: error: implicit declaration of function ‘gf_event’ [-Werror=implicit-function-declaration]
                 gf_event (EVENT_VOLUME_CREATE, "name=%s", (char *)words[2]);
                 ^
cli-cmd-volume.c:247:27: error: ‘EVENT_VOLUME_CREATE’ undeclared (first use in this function)
                 gf_event (EVENT_VOLUME_CREATE, "name=%s", (char *)words[2]);
                           ^
cli-cmd-volume.c:247:27: note: each undeclared identifier is reported only once for each function it appears in
cli-cmd-volume.c: In function ‘cli_cmd_volume_delete_cbk’:
cli-cmd-volume.c:324:27: error: ‘EVENT_VOLUME_DELETE’ undeclared (first use in this function)
                 gf_event (EVENT_VOLUME_DELETE, "name=%s", (char *)words[2]);
                           ^
cli-cmd-volume.c: In function ‘cli_cmd_volume_start_cbk’:
cli-cmd-volume.c:402:27: error: ‘EVENT_VOLUME_START’ undeclared (first use in this function)
                 gf_event (EVENT_VOLUME_START, "name=%s", (char *)words[2]);
                           ^
cli-cmd-volume.c: In function ‘cli_cmd_volume_stop_cbk’:
cli-cmd-volume.c:538:27: error: ‘EVENT_VOLUME_STOP’ undeclared (first use in this function)
                 gf_event (EVENT_VOLUME_STOP, "name=%s", (char *)words[2]);
                           ^
  CC       cli-cmd-peer.o
cc1: some warnings being treated as errors
Makefile:549: recipe for target 'cli-cmd-volume.o' failed
make[3]: *** [cli-cmd-volume.o] Error 1
make[3]: *** Waiting for unfinished jobs....
cli-cmd-peer.c: In function ‘cli_cmd_peer_probe_cbk’:
cli-cmd-peer.c:94:17: error: implicit declaration of function ‘gf_event’ [-Werror=implicit-function-declaration]
                 gf_event (EVENT_PEER_ATTACH, "host=%s", (char *)words[2]);
                 ^
cli-cmd-peer.c:94:27: error: ‘EVENT_PEER_ATTACH’ undeclared (first use in this function)
                 gf_event (EVENT_PEER_ATTACH, "host=%s", (char *)words[2]);
                           ^
cli-cmd-peer.c:94:27: note: each undeclared identifier is reported only once for each function it appears in
cli-cmd-peer.c: In function ‘cli_cmd_peer_deprobe_cbk’:
cli-cmd-peer.c:168:27: error: ‘EVENT_PEER_DETACH’ undeclared (first use in this function)
                 gf_event (EVENT_PEER_DETACH, "host=%s", (char *)words[2]);
                           ^
cc1: some warnings being treated as errors

Comment 1 Vijay Bellur 2016-08-18 10:07:07 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#1) for review on master by Aravinda VK (avishwan)

Comment 2 Vijay Bellur 2016-08-19 06:04:33 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#2) for review on master by Aravinda VK (avishwan)

Comment 3 Vijay Bellur 2016-08-19 06:50:00 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#3) for review on master by Aravinda VK (avishwan)

Comment 4 Vijay Bellur 2016-08-19 07:06:06 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#4) for review on master by Aravinda VK (avishwan)

Comment 5 Vijay Bellur 2016-08-19 08:29:33 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#5) for review on master by Aravinda VK (avishwan)

Comment 6 Vijay Bellur 2016-08-19 09:08:12 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#6) for review on master by Aravinda VK (avishwan)

Comment 7 Worker Ant 2016-08-23 08:26:08 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#7) for review on master by Aravinda VK (avishwan)

Comment 8 Worker Ant 2016-08-23 09:31:49 UTC
REVIEW: http://review.gluster.org/15198 (eventsapi: Fix disable-events issue) posted (#8) for review on master by Aravinda VK (avishwan)

Comment 9 Worker Ant 2016-08-24 08:23:10 UTC
COMMIT: http://review.gluster.org/15198 committed in master by Aravinda VK (avishwan) 
------
commit d1aa35c3619847922e092b7dbfb201bceea8fa33
Author: Aravinda VK <avishwan>
Date:   Thu Aug 18 14:51:44 2016 +0530

    eventsapi: Fix disable-events issue
    
    Events related sources are not loaded in libglusterfs when
    configure is run with --disable-events option. Due to this
    every call of gf_event should be guarded with USE_EVENTS macro.
    
    To prevent this, USE_EVENTS macro was included in events.c
    itself(Patch #15054)
    
    Instead of disabling building entire directory "events", selectively
    disabled the code. So that constants and empty function gf_event is
    exposed. Code will not fail even if gf_event is called when events is
    disabled.
    
    BUG: 1368042
    Change-Id: Ia6abfe9c1e46a7640c4d8ff5ccf0e9c30c87f928
    Signed-off-by: Aravinda VK <avishwan>
    Reviewed-on: http://review.gluster.org/15198
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Niels de Vos <ndevos>
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>

Comment 10 Shyamsundar 2017-03-27 18:19:27 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.9.0, please open a new bug report.

glusterfs-3.9.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/gluster-users/2016-November/029281.html
[2] https://www.gluster.org/pipermail/gluster-users/