From: Gris Ge <fge@redhat.com>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [PATCH V2] Introducing multipath C API <libdmmp/libdmmp.h>
Date: Sat, 5 Mar 2016 17:46:49 +0800 [thread overview]
Message-ID: <20160305094649.GA948@redhat.com> (raw)
In-Reply-To: <20160304160624.GN2915@octiron.msp.redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 2942 bytes --]
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 multipath client code responsible for
> making it pretty, but making that happen is a lot more invasive.
Hi Benjamin,
Thanks for the review.
I believe Todd is trying to patch multipathd IPC to provide JSON
output like:
multipathd -k'show topology json'
>
> A couple of thoughts:
>
> I'm wrote a library interface for the multipath IPC code that wasn't
> included the upstream code, although nobody ever voiced a
> disagreement with it, and Hannes sounded supportive of it the last
> time I posted it.
>
> https://www.redhat.com/archives/dm-devel/2015-June/msg00033.html
> https://www.redhat.com/archives/dm-devel/2015-October/msg00062.html
>
> I plan on resending it with my next batch of patches, unless someone
> wants to tell me why it hasn't been accepted before. It doesn't
> effect your code at all, but assuming that it does get in this time,
> we may want to make some of your IPC functions wrappers around it
> (possibly modifying my library code to work with it better), so that
> we aren't duplicating work.
It's good to remove duplicate code between daemon and client on the
IPC communication.
I will update my patch to unitize libmpath_cmd once it has been
committed.
>
> Also, why use the assert, instead of returning an error? I know some
> library's don't protect you from passing in NULL pointers, and just let
> you segfault. I didn't find any cases where you would return junk if
> the asserts were disabled, but I didn't follow through all of the logic
> to verify that you wouldn't ever return junk if you passed in junk and
> the asserts were disabled.
Without assert, I have to provide a return code
(for example: DMMP_ERR_INVALID_ARGUMENT) and clean up all possible
messes.
Example:
int dmmp_mpath_array_get(struct dmmp_context *ctx,
struct dmmp_mpath ***dmmp_mps,
uint32_t *dmmp_mp_count);
If any of three argument is NULL, I have to set output pointer as
NULL(if not NULL) just in case user use them without checking return
code.
Meanwhile, I have to set error message to indicate so when ctx is not
NULL.
IMHO, using error handling on this simple programmer fault is waste of
time. It seems assert is enough for this.
>
> Lastly, and this is even more nit-picky, in _dmmp_all_get_func_gen,
> why to you need to pass in a specific name for the array and the
> item_count?
It's my bad habit of keeping function prototype identical(including
argument name) to implementation.
I will purge them in V3 patch.
>
> But regardless of these nit-picks, ACK.
>
> -Ben
Best regards.
--
Gris Ge
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2016-03-05 9:46 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 3:52 [PATCH] Introducing multipath C API <libdmmp/libdmmp.h> Gris Ge
2016-01-28 9:15 ` Hannes Reinecke
2016-01-28 9:40 ` Gris Ge
2016-02-01 13:13 ` Todd Gill
2016-02-01 13:36 ` Hannes Reinecke
2016-02-12 8:10 ` [PATCH V2] Introducing multipath C API Gris Ge
2016-02-12 8:10 ` [PATCH V2] Introducing multipath C API <libdmmp/libdmmp.h> Gris Ge
2016-03-04 16:06 ` Benjamin Marzinski
2016-03-05 9:46 ` Gris Ge [this message]
2016-07-01 12:46 ` [PATCH V3 0/3] Introducing multipath C API Gris Ge
2016-07-01 12:46 ` [PATCH V3 1/3] multipath-tools: Increase MAX_REPLY_LEN Gris Ge
2016-07-01 14:46 ` Hannes Reinecke
2016-07-02 0:25 ` Gris Ge
2016-07-04 6:05 ` Hannes Reinecke
2016-07-04 9:11 ` Gris Ge
2016-07-04 9:17 ` [PATCH V4 0/3] Introducing multipath C API Gris Ge
2016-07-04 9:17 ` [PATCH V4 1/3] multipath-tools: New way to limit the IPC command length Gris Ge
2016-07-04 9:17 ` [PATCH V4 2/3] multipath-tools: Set errno mpath_recv_reply() when failure Gris Ge
2016-07-04 9:17 ` [PATCH V4 3/3] multipath-tools: Introducing multipath C API Gris Ge
2016-07-04 9:27 ` [PATCH V4 0/3] " Gris Ge
2016-07-04 9:29 ` Please ignore this patch set. ([PATCH V4 0/3] Introducing multipath C API) Gris Ge
2016-07-04 9:40 ` [PATCH V5 0/3] Introducing multipath C API Gris Ge
2016-07-04 9:40 ` [PATCH V5 1/3] multipath-tools: New way to limit the IPC command length Gris Ge
2016-07-04 9:40 ` [PATCH V5 2/3] multipath-tools: Set errno mpath_recv_reply() when failure Gris Ge
2016-07-04 9:40 ` [PATCH V5 3/3] multipath-tools: Introducing multipath C API Gris Ge
2016-07-01 12:46 ` [PATCH V3 2/3] multipath-tools: Set errno mpath_recv_reply() when failure Gris Ge
2016-07-01 12:46 ` [PATCH V3 3/3] multipath-tools: Introducing multipath C API <libdmmp/libdmmp.h> Gris Ge
2016-07-01 12:55 ` [PATCH " Gris Ge
2016-07-01 13:06 ` [PATCH V3 " Gris Ge
2016-07-12 6:50 ` [PATCH V6 0/3] Introducing multipath C API Gris Ge
2016-07-12 6:50 ` [PATCH V6 1/3] multipath-tools: New way to limit the IPC command length Gris Ge
2016-07-15 21:35 ` Benjamin Marzinski
2016-07-18 12:38 ` Gris Ge
2016-08-12 15:57 ` Bart Van Assche
2016-08-12 21:35 ` Benjamin Marzinski
2016-08-12 21:49 ` Bart Van Assche
2016-07-12 6:50 ` [PATCH V6 2/3] multipath-tools: Set errno mpath_recv_reply() when failure Gris Ge
2016-07-12 6:50 ` [PATCH V6 3/3] multipath-tools: Introducing multipath C API Gris Ge
2016-07-15 21:36 ` [PATCH V6 0/3] " Benjamin Marzinski
2016-08-12 12:12 ` [PATCH V7 0/4] multipath: " Gris Ge
2016-08-12 12:12 ` [PATCH V7 1/4] libmpathcmd: Block SIGPIPE when write() Gris Ge
2016-08-12 16:01 ` Bart Van Assche
2016-08-12 12:12 ` [PATCH V7 2/4] multipath-tools: New way to limit the IPC command length Gris Ge
2016-08-12 15:48 ` Bart Van Assche
2016-08-12 21:53 ` Benjamin Marzinski
2016-08-12 12:12 ` [PATCH V7 3/4] multipath-tools: Set errno mpath_recv_reply() when failure Gris Ge
2016-08-12 12:12 ` [PATCH V7 4/4] multipath-tools: Introducing multipath C API Gris Ge
2017-02-24 12:50 ` [PATCH V5] " Gris Ge
2017-02-27 5:56 ` Christophe Varoqui
2017-02-24 13:07 ` Gris Ge
2016-08-12 13:26 ` [PATCH V7 0/4] multipath: " Gris Ge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160305094649.GA948@redhat.com \
--to=fge@redhat.com \
--cc=bmarzins@redhat.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).