From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Het Gala <het.gala@nutanix.com>
Cc: qemu-devel@nongnu.org, prerna.saxena@nutanix.com,
quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com,
armbru@redhat.com, eblake@redhat.com, manish.mishra@nutanix.com,
aravind.retnakaran@nutanix.com
Subject: Re: [PATCH v3 1/6] migration: moved hmp_split_at_commma() helper func to qapi-util.c file
Date: Thu, 9 Feb 2023 11:57:32 +0000 [thread overview]
Message-ID: <Y+TfrIyM3XCpIf2a@redhat.com> (raw)
In-Reply-To: <20230209102754.81578-2-het.gala@nutanix.com>
On Thu, Feb 09, 2023 at 10:27:49AM +0000, Het Gala wrote:
> renamed hmp_split_at_comma() --> str_split_at_comma()
> Shifted helper function to qapi-util.c file. Give external linkage, as
> this function will be handy in coming commit for migration.
>
> Minor correction:
> g_strsplit(str ?: "", ",", -1) --> g_strsplit(str ? str : "", ",", -1)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Why have these Reviewed-by tags been added to this patch and all
others in the series ?
In the v2 posting all I see are some comments from Eric, and he
didn't give a Reviewed-by approval. I don't see any feedback from
Markus or David on list for the v2 posting.
> Suggested-by: Daniel P. Berrange <berrange@redhat.com>
> Suggested-by: Manish Mishra <manish.mishra@nutanix.com>
> Suggested-by: Aravind Retnakaran <aravind.retnakaran@nutanix.com>
> Signed-off-by: Het Gala <het.gala@nutanix.com>
> ---
> include/monitor/hmp.h | 1 -
> include/qapi/util.h | 1 +
> monitor/hmp-cmds.c | 19 -------------------
> net/net-hmp-cmds.c | 2 +-
> qapi/qapi-util.c | 19 +++++++++++++++++++
> stats/stats-hmp-cmds.c | 2 +-
> 6 files changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
> index 2220f14fc9..e80848fbd0 100644
> --- a/include/monitor/hmp.h
> +++ b/include/monitor/hmp.h
> @@ -19,7 +19,6 @@
>
> bool hmp_handle_error(Monitor *mon, Error *err);
> void hmp_help_cmd(Monitor *mon, const char *name);
> -strList *hmp_split_at_comma(const char *str);
>
> void hmp_info_name(Monitor *mon, const QDict *qdict);
> void hmp_info_version(Monitor *mon, const QDict *qdict);
> diff --git a/include/qapi/util.h b/include/qapi/util.h
> index 81a2b13a33..6c8d8575e3 100644
> --- a/include/qapi/util.h
> +++ b/include/qapi/util.h
> @@ -29,6 +29,7 @@ bool qapi_bool_parse(const char *name, const char *value, bool *obj,
> Error **errp);
>
> int parse_qapi_name(const char *name, bool complete);
> +struct strList *str_split_at_comma(const char *str);
>
> /*
> * For any GenericList @list, insert @element at the front.
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 34bd8c67d7..9665e6e0a5 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -39,25 +39,6 @@ bool hmp_handle_error(Monitor *mon, Error *err)
> return false;
> }
>
> -/*
> - * Split @str at comma.
> - * A null @str defaults to "".
> - */
> -strList *hmp_split_at_comma(const char *str)
> -{
> - char **split = g_strsplit(str ?: "", ",", -1);
> - strList *res = NULL;
> - strList **tail = &res;
> - int i;
> -
> - for (i = 0; split[i]; i++) {
> - QAPI_LIST_APPEND(tail, split[i]);
> - }
> -
> - g_free(split);
> - return res;
> -}
> -
> void hmp_info_name(Monitor *mon, const QDict *qdict)
> {
> NameInfo *info;
> diff --git a/net/net-hmp-cmds.c b/net/net-hmp-cmds.c
> index 41d326bf5f..a3c597a727 100644
> --- a/net/net-hmp-cmds.c
> +++ b/net/net-hmp-cmds.c
> @@ -72,7 +72,7 @@ void hmp_announce_self(Monitor *mon, const QDict *qdict)
> migrate_announce_params());
>
> qapi_free_strList(params->interfaces);
> - params->interfaces = hmp_split_at_comma(interfaces_str);
> + params->interfaces = str_split_at_comma(interfaces_str);
> params->has_interfaces = params->interfaces != NULL;
> params->id = g_strdup(id);
> qmp_announce_self(params, NULL);
> diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
> index 63596e11c5..e26b9d957b 100644
> --- a/qapi/qapi-util.c
> +++ b/qapi/qapi-util.c
> @@ -152,3 +152,22 @@ int parse_qapi_name(const char *str, bool complete)
> }
> return p - str;
> }
> +
> +/*
> + * Split @str at comma.
> + * A null @str defaults to "".
> + */
> +strList *str_split_at_comma(const char *str)
> +{
> + char **split = g_strsplit(str ? str : "", ",", -1);
> + strList *res = NULL;
> + strList **tail = &res;
> + int i;
> +
> + for (i = 0; split[i]; i++) {
> + QAPI_LIST_APPEND(tail, split[i]);
> + }
> +
> + g_free(split);
> + return res;
> +}
> diff --git a/stats/stats-hmp-cmds.c b/stats/stats-hmp-cmds.c
> index 531e35d128..cfee05a076 100644
> --- a/stats/stats-hmp-cmds.c
> +++ b/stats/stats-hmp-cmds.c
> @@ -174,7 +174,7 @@ static StatsFilter *stats_filter(StatsTarget target, const char *names,
> request->provider = provider_idx;
> if (names && !g_str_equal(names, "*")) {
> request->has_names = true;
> - request->names = hmp_split_at_comma(names);
> + request->names = str_split_at_comma(names);
> }
> QAPI_LIST_PREPEND(request_list, request);
> }
> --
> 2.22.3
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-02-09 11:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 10:27 [PATCH v3 0/6] migration: Modified 'migrate' QAPI command for migration Het Gala
2023-02-09 10:27 ` [PATCH v3 1/6] migration: moved hmp_split_at_commma() helper func to qapi-util.c file Het Gala
2023-02-09 11:56 ` Juan Quintela
2023-02-09 11:57 ` Daniel P. Berrangé [this message]
2023-02-09 12:04 ` Alex Bennée
2023-02-09 10:27 ` [PATCH v3 2/6] migration: Updated QAPI format for 'migrate' qemu monitor command Het Gala
2023-02-10 9:07 ` Markus Armbruster
2023-02-09 10:27 ` [PATCH v3 3/6] migration: HMP side changes for modified 'migrate' QAPI design Het Gala
2023-02-09 10:27 ` [PATCH v3 4/6] migration: Avoid multiple parsing of uri in migration code flow Het Gala
2023-02-09 10:27 ` [PATCH v3 5/6] migration: Modified 'migrate-incoming' QAPI and HMP side changes on the destination interface Het Gala
2023-02-09 10:27 ` [PATCH v3 6/6] migration: Established connection for listener sockets on the dest interface Het Gala
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=Y+TfrIyM3XCpIf2a@redhat.com \
--to=berrange@redhat.com \
--cc=aravind.retnakaran@nutanix.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=het.gala@nutanix.com \
--cc=manish.mishra@nutanix.com \
--cc=pbonzini@redhat.com \
--cc=prerna.saxena@nutanix.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.