libap: use util_lockfile and remove liblockfile dependency

Now that we have a utility library for file locking, remove all
calls to liblockfile functions from libap and remove all links to
the library from the current users of the libap liblockfile
implementation (ap_tools/ap-check and zdev).

Fixes: https://github.com/ibm-s390-linux/s390-tools/issues/142
Suggested-by: Luca BRUNO <luca.bruno@coreos.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Matthew Rosato
2022-09-08 11:23:59 -04:00
committed by Jan Höppner
parent 6235a51d7c
commit 25a70ac5a8
7 changed files with 22 additions and 65 deletions

View File

@@ -7,21 +7,14 @@ MDEVCTL_CALLOUTS = /etc/mdevctl.d/scripts.d/callouts/
libs = $(rootdir)/libap/libap.a \
$(rootdir)/libutil/libutil.a
ifeq (${HAVE_LOCKFILE},0)
all:
$(SKIP) HAVE_LOCKFILE=0
install:
$(SKIP) HAVE_LOCKFILE=0
else ifeq (${HAVE_JSONC},0)
ifeq (${HAVE_JSONC},0)
all:
$(SKIP) HAVE_JSONC=0
install:
$(SKIP) HAVE_JSONC=0
else
LDLIBS += -llockfile -ljson-c
LDLIBS += -ljson-c
all: ap-check

View File

@@ -133,7 +133,7 @@ static void ap_check_cleanup(struct ap_check_anchor *anc)
if (anc->dev)
vfio_ap_device_free(anc->dev);
if (anc->cleanup_lock)
ap_release_lock();
ap_release_lock_callout();
}
/*
@@ -775,7 +775,7 @@ out:
*/
static int ap_check_handle_post(void)
{
return ap_release_lock();
return ap_release_lock_callout();
}
/* For the specified device, print the attributes to stdout in JSON format */