Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstall libtcmu API and header files #444

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ target_link_libraries(tcmu
${LIBNL_GENL_LIB}
${GLIB_LIBRARIES}
)
install(TARGETS tcmu LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} NAMELINK_SKIP)
install(TARGETS tcmu LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

# Stuff for building the static library
add_library(tcmu_static
Expand Down Expand Up @@ -272,6 +272,8 @@ configure_file (
)
install(SCRIPT tcmu.conf_install.cmake)

install(FILES libtcmu.h libtcmu_common.h libtcmu_priv.h darray.h
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the final lib we are not going to have users use/include the private definitions. The lib user should also not need the darray.h header unless we expose an api that uses a darrary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the tcmulib_context and tcmu_device structs in libtcmu_priv.h are needed by users and tcmulib_context depends on darray.h currently. Maybe we should rename libtcmu_priv.h as it will not 'private'.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lib users should not need to ever directly interact with tcmu_device. It is internal to the lib. The only interact with it via libtcmu helpers.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out how consumer.c or tcmu-synthesizer worked with libtcmu originally for an example. They never directly interacted with tcmu_device so we could make internal changes and not have to update every libtcmu user.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah for libtcmu_context and darray that should not be an issue. The users of libtcmu only pass around a tcmulib_context struct pointer. They never access it, so the forward declaration in the libtcmu.h should be enough.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I'll tune this as your suggestion. Thansk.

DESTINATION include)
install(FILES org.kernel.TCMUService1.service
DESTINATION /usr/share/dbus-1/system-services)
install(FILES tcmu-runner.conf DESTINATION /etc/dbus-1/system.d)
Expand Down
1 change: 1 addition & 0 deletions alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "libtcmu_log.h"
#include "libtcmu_common.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch seems ok.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

#include "libtcmu_priv.h"
#include "tcmu-runner.h"
#include "tcmur_device.h"
#include "target.h"
#include "alua.h"
Expand Down
1 change: 1 addition & 0 deletions api.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "libtcmu_log.h"
#include "libtcmu_common.h"
#include "libtcmu_priv.h"
#include "tcmu-runner.h"
#include "target.h"
#include "alua.h"
#include "be_byteshift.h"
Expand Down
1 change: 1 addition & 0 deletions libtcmu_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "libtcmu_config.h"
#include "libtcmu_time.h"
#include "libtcmu_priv.h"
#include "tcmu-runner.h"
#include "string_priv.h"

/* tcmu ring buffer for log */
Expand Down
4 changes: 0 additions & 4 deletions libtcmu_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
#include <gio/gio.h>
#include <pthread.h>

#include "scsi_defs.h"
#include "darray.h"
#include "ccan/list/list.h"
#include "tcmur_aio.h"
#include "tcmu-runner.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch is fine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

#define KERN_IFACE_VER 2

Expand Down