[dm-devel] [multipath] Should we include python API in the codebase?

2018-03-23 Thread Gris Ge
Hi Guys, I created a python API of multipath using the JSON output of multipathd like what we did C API -- libdmmp: https://github.com/cathay4t/python-dmmp Does upstream want it maintained in the codebase of multipath-tools? Thanks. -- Gris Ge signature.asc Description: PGP signature

Re: [dm-devel] [PATCH] multipath-tools: refresh kernel-doc from kernel sources

2017-11-21 Thread Gris Ge
Hi Xose Vazquez Perez, Looks good to me. The libdmmp manpage generated by it is identical(new kernel-doc make a small improvement of dmmp_context_log_func_set.3 on removing unneeded spaces). Thanks. On Fri, Nov 17, 2017 at 05:54:25PM +0100, Xose Vazquez Perez wrote: > Cc: Gris Ge

[dm-devel] [PATCH 1/4] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread

2017-11-21 Thread Gris Ge
K_REALTIME for pthread_mutex_timedlock(). Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/cli.c b/multipathd/cli.c index deb72cbe..f10f862c 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -480,7 +48

[dm-devel] [PATCH 3/4] multipath-tools: libdmmp: Add new function dmmp_last_error_msg()

2017-11-21 Thread Gris Ge
* New function dmmp_last_error_msg() to retrieve the last error message. Signed-off-by: Gris Ge <f...@redhat.com> --- libdmmp/libdmmp.c | 9 + libdmmp/libdmmp/libdmmp.h | 15 +++ libdmmp/test/libdmmp_test.c | 12 3 files changed, 32 inse

[dm-devel] [PATCH 4/4] multipath-tools: libdmmp: Add new error DMMP_ERR_PERMISSION_DENY

2017-11-21 Thread Gris Ge
* Indicate user does not have privilege to flush mpath or invoke reconfig. * Bump API version to 0.2.0 for this API addition. Signed-off-by: Gris Ge <f...@redhat.com> --- libdmmp/Makefile | 2 +- libdmmp/libdmmp.c | 8 libdmmp/libdmmp/libdmmp.h | 5 + l

[dm-devel] [PATCH 0/4] multipath-tools: libdmmp improvements.

2017-11-21 Thread Gris Ge
* Patch 1/4 is a resend. * Patch 2/4, 3/4, and 4/4 add new functions to libdmmp library. Gris Ge (4): multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread multipath-tools: libdmmp: Allow log function as NULL. multipath-tools: libdmmp: Add new function dmmp_last_error_msg

[dm-devel] [PATCH 3/3] multipath-tools: libdmmp: New function to flush and reconfig

2017-08-16 Thread Gris Ge
New functions: * dmmp_reconfig() to invoke reconfiguration of multipathd daemon. * dmmp_flush_mpath() to flush/del unused mpath. Signed-off-by: Gris Ge <f...@redhat.com> --- libdmmp/libdmmp.c | 143 +--- libdmmp/libdmmp/libdmmp.h

[dm-devel] [PATCH 2/3] multipath-tools: libdmmp: Improve timeout mechanism

2017-08-16 Thread Gris Ge
infinite, only return when error or pass. * Updated libdmmp.h document to to indicate timeout 0 as infinite. * Increase timeout setting in libdmmp test case to test this mechanism. Signed-off-by: Gris Ge <f...@redhat.com> --- libdmmp/libdmmp.c

[dm-devel] [PATCH V2] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread

2017-08-09 Thread Gris Ge
K_REALTIME for pthread_mutex_timedlock(). Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/cli.c b/multipathd/cli.c index 32d49766..002abe61 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -475,7 +47

Re: [dm-devel] [PATCH] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread

2017-08-09 Thread Gris Ge
use the monotonic clock? See also libmultipath/time-util.c. > > Bart. Hi Bart, I missed the pthread_cond_init_mono(). Will send V2 patch without this change. Thanks. -- Gris Ge signature.asc Description: PGP signature -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread

2017-08-09 Thread Gris Ge
K_REALTIME for pthread_mutex_timedlock() and pthread_cond_timedwait(). Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/cli.c | 2 +- multipathd/main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multipathd/cli.c b/multipathd/cli.c index 32d49766.

[dm-devel] [PATCH] multipath-tools: libdmmp: Fix incorrect use of __attribute__

2017-03-11 Thread Gris Ge
According to https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html , type attributes should be placed immediately after the struct, union or enum keyword. Signed-off-by: Gris Ge <f...@redhat.com> --- libdmmp/libdmmp/libdmmp.h | 8 libdmmp/libdmmp_private.h | 3 ++- 2 files chan

[dm-devel] [PATCH V5] multipath-tools: Introducing multipath C API

2017-02-24 Thread Gris Ge
informations for an initial review. I will send more patches to expose the rest informations afterwords. Thank you. Best regards. [1]: https://www.redhat.com/archives/dm-devel/2016-July/msg00060.html [2]: https://www.redhat.com/archives/dm-devel/2017-January/msg00205.html -- Gris Ge signature.asc

[dm-devel] [PATCH] multipath-tools: multipathd: Fix memory leak on load_config().

2017-01-21 Thread Gris Ge
* Just free_config() before exit. Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multipathd/main.c b/multipathd/main.c index 1e64afc..2f5042e 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -2633,6 +2633,7 @

[dm-devel] [PATCH 5/5] multipath-tools: Perform socket client uid check on IPC commands.

2017-01-20 Thread Gris Ge
root" will be sent otherwise. Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/main.c | 12 +++- multipathd/uxlsnr.c | 19 +++ multipathd/uxlsnr.h | 4 +++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/multipathd/main.c b/multipa

[dm-devel] [PATCH 2/5] multipath-tools: libmultipath: Removed unused functions.

2017-01-20 Thread Gris Ge
* Removed these unused functions from libmultipath: * write_all() * read_all() Signed-off-by: Gris Ge <f...@redhat.com> --- libmultipath/uxsock.c | 60 --- libmultipath/uxsock.h | 2 -- 2 files changed, 62 deletions(-) diff

[dm-devel] [PATCH 4/5] multipath-tools: Set errno mpath_recv_reply() when failure

2017-01-20 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathc

[dm-devel] [PATCH 1/5] multipath-tools: libmultipath: fix gcc link failure on rcu_register_thread_mb.

2017-01-20 Thread Gris Ge
Error: ../libmultipath/libmultipath.so: undefined reference to `rcu_register_thread_mb' ../libmultipath/libmultipath.so: undefined reference to `rcu_unregister_thread_mb' Fix: Link the libmultipath with -lurcu Signed-off-by: Gris Ge <f...@redhat.com> --- libmul

[dm-devel] [PATCH 3/5] multipath-tools: New way to limit the IPC command length.

2017-01-20 Thread Gris Ge
the limitation of MAX_REPLY_LEN in libmpathcmd. * New functions `recv_packet_from_client()` in uxsock.h of libmultipath which enforce the limitation of buffer size to 512(_MAX_CMD_LEN). * Change multipathd socket listener to use `recv_packet_from_client()`. Signed-off-by: Gris Ge

[dm-devel] [PATCH 0/5] [multipath-tools] Misc fixes for JSON API.

2017-01-20 Thread Gris Ge
Patch 5/5 is a resend. Other patches are rework of 'multipath: Introducing multipath C API' patch set. Gris Ge (5): multipath-tools: libmultipath: fix gcc link failure on rcu_register_thread_mb. multipath-tools: libmultipath: Removed unused functions. multipath-tools: New way to limit

Re: [dm-devel] [PATCH V7 0/4] multipath: Introducing multipath C API

2016-08-12 Thread Gris Ge
On Fri, Aug 12, 2016 at 08:12:36PM +0800, Gris Ge wrote: > Changes since V6: > * Add new patch(1/4) to block SIGPIPE when write() in libmpathcmd. > * Patch 2/4 does not have 'send_packet_daemon_only()' as SIGPIPE already >handled by libmpathcmd. The mail list system drop pat

[dm-devel] [PATCH V7 3/4] multipath-tools: Set errno mpath_recv_reply() when failure

2016-08-12 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathc

[dm-devel] [PATCH V7 0/4] multipath: Introducing multipath C API

2016-08-12 Thread Gris Ge
that patch again: https://github.com/cathay4t/multipath-tools/commit/b992056a447b90251a65aa4919055c70aa62a498.patch Changes since V3: * New way to limit the IPC command length. * Treat IPC connection refuse error as DMMP_ERR_NO_DAEMON. Gris Ge (4): libmpathcmd: Block SIGPIPE when write

[dm-devel] [PATCH V7 2/4] multipath-tools: New way to limit the IPC command length.

2016-08-12 Thread Gris Ge
send something like 'fake command' to daemon which lead daemon to allocate a big chunk of memory. * Due to the removal of uxsock.h from libmultipath, all IPC connection except (multipathd daemon) should use libmpathcmd instead. Signed-off-by: Gris Ge &l

[dm-devel] [PATCH V7 1/4] libmpathcmd: Block SIGPIPE when write()

2016-08-12 Thread Gris Ge
* Just block SIGPIPE when write() and restore it when done. * Use 'errno_save()' to preserve the errno of write(). Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libmp

Re: [dm-devel] [PATCH V6 1/3] multipath-tools: New way to limit the IPC command length.

2016-07-18 Thread Gris Ge
On Fri, Jul 15, 2016 at 04:35:45PM -0500, Benjamin Marzinski wrote: > On Tue, Jul 12, 2016 at 02:50:36PM +0800, Gris Ge wrote: > > The only thing that I wonder about with this patch is, when previously > the multipath client code would have failed with EPIPE, and (at least in > s

[dm-devel] [PATCH] multipath-tools: Perform socket client uid check on IPC commands.

2016-07-18 Thread Gris Ge
root" will be sent otherwise. Signed-off-by: Gris Ge <f...@redhat.com> --- multipathd/main.c | 13 +++-- multipathd/uxlsnr.c | 19 +++ multipathd/uxlsnr.h | 4 +++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/multipathd/main.c b/m

[dm-devel] [PATCH V6 0/3] Introducing multipath C API

2016-07-12 Thread Gris Ge
. * Treat IPC connection refuse error as DMMP_ERR_NO_DAEMON. Gris Ge (3): multipath-tools: New way to limit the IPC command length. multipath-tools: Set errno mpath_recv_reply() when failure multipath-tools: Introducing multipath C API .gitignore|4 + Makefile

[dm-devel] [PATCH V6 1/3] multipath-tools: New way to limit the IPC command length.

2016-07-12 Thread Gris Ge
send something like 'fake command' to daemon which lead daemon to allocate a big chunk of memory. * Due to the removal of uxsock.h from libmultipath, all IPC connection except (multipathd daemon) should use libmpathcmd instead. Signed-off-by: Gris Ge &l

[dm-devel] [PATCH V6 2/3] multipath-tools: Set errno mpath_recv_reply() when failure

2016-07-12 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathc

Re: [dm-devel] [PATCH V5 3/3] Introducing multipath C API

2016-07-11 Thread Gris Ge
On Sun, Jul 10, 2016 at 06:23:39PM +0200, Xose Vazquez Perez wrote: > Gris Ge wrote: > > > diff --git a/libdmmp/Makefile b/libdmmp/Makefile > > new file mode 100644 > > index 000..ce7ca3f > > --- /dev/null > > +++ b/libdmmp/Makefile > > @

Re: [dm-devel] [PATCH V5 3/3] Introducing multipath C API

2016-07-04 Thread Gris Ge
On Mon, Jul 04, 2016 at 06:32:56PM +0200, Xose Vazquez Perez wrote: > Gris Ge wrote: > > > + perl -i -pe 's|__INCLUDEDIR__|$(includedir)|g' \ > > + $(DESTDIR)/$(pkgconfdir)/$(PKGFILE) > > Please, replace perl with sed, awk or any other basic tool. > Hi Xos

[dm-devel] [PATCH V5 2/3] multipath-tools: Set errno mpath_recv_reply() when failure

2016-07-04 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathc

[dm-devel] [PATCH V5 1/3] multipath-tools: New way to limit the IPC command length.

2016-07-04 Thread Gris Ge
send something like 'fake command' to daemon which lead daemon to allocate a big chunk of memory. * Due to the removal of uxsock.h from libmultipath, all IPC connection except (multipathd daemon) should use libmpathcmd instead. Signed-off-by: Gris Ge &l

[dm-devel] [PATCH V5 0/3] Introducing multipath C API

2016-07-04 Thread Gris Ge
Changes since V3: * New way to limit the IPC command length. * Treat IPC connection refuse error as DMMP_ERR_NO_DAEMON. Gris Ge (3): multipath-tools: New way to limit the IPC command length. multipath-tools: Set errno mpath_recv_reply() when failure multipath-tools: Introducing multipath

Re: [dm-devel] [PATCH V4 0/3] Introducing multipath C API

2016-07-04 Thread Gris Ge
On Mon, Jul 04, 2016 at 05:17:01PM +0800, Gris Ge wrote: > Changes since V3: > * Replace limitation of MAX_REPLY_LEN with MAX_SEND_CMD_LEN. > * Treat IPC connection refuse error as DMMP_ERR_NO_DAEMON. > > Gris Ge (3): > multipath-tools: New way to limit the IPC command len

[dm-devel] [PATCH V4 1/3] multipath-tools: New way to limit the IPC command length.

2016-07-04 Thread Gris Ge
send something like 'fake command' to daemon which lead daemon to allocate a big chunk of memory. * Due to the removal of uxsock.h from libmultipath, all IPC connection except (multipathd daemon) should use libmpathcmd instead. Signed-off-by: Gris Ge &l

[dm-devel] [PATCH V4 0/3] Introducing multipath C API

2016-07-04 Thread Gris Ge
Changes since V3: * Replace limitation of MAX_REPLY_LEN with MAX_SEND_CMD_LEN. * Treat IPC connection refuse error as DMMP_ERR_NO_DAEMON. Gris Ge (3): multipath-tools: New way to limit the IPC command length. multipath-tools: Set errno mpath_recv_reply() when failure multipath-tools

[dm-devel] [PATCH V4 2/3] multipath-tools: Set errno mpath_recv_reply() when failure

2016-07-04 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmpathc

Re: [dm-devel] [PATCH V3 1/3] multipath-tools: Increase MAX_REPLY_LEN.

2016-07-04 Thread Gris Ge
On Mon, Jul 04, 2016 at 08:05:19AM +0200, Hannes Reinecke wrote: > On 07/02/2016 02:25 AM, Gris Ge wrote: > > On Fri, Jul 01, 2016 at 04:46:53PM +0200, Hannes Reinecke wrote: > >>> -#define MAX_REPLY_LEN65536 > >>> +#define MAX_REPLY_LEN10

[dm-devel] [PATCH V3 0/3] Introducing multipath C API

2016-07-01 Thread Gris Ge
Changes since V2: * Use json interface "show maps json". * Removed the use of enum. * Use libmpathcmd for IPC communication. * Include two trivial fixes for libmpathcmd. Gris Ge (3): multipath-tools: Increase MAX_REPLY_LEN. multipath-tools: Set errno mpath_recv_reply() wh

[dm-devel] [PATCH V3 2/3] multipath-tools: Set errno mpath_recv_reply() when failure.

2016-07-01 Thread Gris Ge
Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for mpath_recv_reply() by set errno and return -1 on failure. Signed-off-by: Gris Ge <f...@redhat.com> --- libmpathcmd/mpath_cmd.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --g

[dm-devel] [PATCH] Multipath: Remove duplicated memset() for multipathd show command.

2016-06-15 Thread Gris Ge
* No need to zero memory before snprintf which will always terminate the string with '\0'. Signed-off-by: Gris Ge <f...@redhat.com> --- libmultipath/print.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/libmultipath/print.c b/libmultipath/print.c index 2d159ed

Re: [dm-devel] [PATCH v4 1/1] add display of map information in JSON format

2016-05-20 Thread Gris Ge
On Fri, May 20, 2016 at 03:59:07PM -0400, Todd Gill wrote: > > Hi Gris, > > On 05/19/2016 09:50 AM, Gris Ge wrote: > > On Wed, May 18, 2016 at 01:26:34PM -0400, Todd Gill wrote: > >> > >> v4: > >> > >> removed space in major_version an

Re: [dm-devel] [PATCH v3 1/1] add display of map information in JSON format

2016-05-18 Thread Gris Ge
" \"minor_version \": %d,\n" Got extra space in json key name: 'major_version ' and 'minor_version ', should be 'major_version' and 'minor_version' -- Gris Ge signature.asc Description: PGP signature -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 1/1] add display of map information in JSON format

2016-05-05 Thread Gris Ge
negligible vote to option B), ideally the wrapper library should be user's first choice instead messing with 'raw format'. Thanks for the patch. Best regards. -- Gris Ge signature.asc Description: PGP signature -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V2] Introducing multipath C API

2016-03-05 Thread Gris Ge
On Fri, Mar 04, 2016 at 10:06:24AM -0600, Benjamin Marzinski wrote: > On Fri, Feb 12, 2016 at 04:10:23PM +0800, Gris Ge wrote: > > This looks good to me. Personally, I would have loved to see > multipathd actually passing structured data across the IPC > connection, and have the m

[dm-devel] [PATCH V2] Introducing multipath C API.

2016-02-12 Thread Gris Ge
of libmultipath. * Removed DMMP_ERR_INVALID_ARGUMENT error, application will be terminated by assert if illegal argument provided. Gris Ge (1): Introducing multipath C API .gitignore|4 + Makefile |1 + Makefile.inc