[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 1/7] monitor: discard global variable *cur_mo
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V2 1/7] monitor: discard global variable *cur_mon in completion functions |
Date: |
Thu, 27 Jun 2013 11:45:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
On 06/24/2013 06:48 AM, Wenchao Xia wrote:
> Parameter *mon is added to replace *cur_mon, and readline_completion()
> pass rs->mon as value, which should be initialized in readline_init()
> called by monitor_init(). In short, structure ReadLineState controls
> where the action would be taken now.
>
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
> +static void monitor_find_completion(Monitor *mon,
> + const char *cmdline)
> {
> const char *cmdname;
> char *args[MAX_ARGS];
> int nb_args, i, len;
> const char *ptype, *str;
> const mon_cmd_t *cmd;
> + MonitorBlockComplete mbs;
>
> parse_cmdline(cmdline, &nb_args, args);
> #ifdef DEBUG_COMPLETION
> for(i = 0; i < nb_args; i++) {
> - monitor_printf(cur_mon, "arg%d = '%s'\n", i, (char *)args[i]);
> + monitor_printf(mon, "arg%d = '%s'\n", i, (char *)args[i]);
Pre-existing, but that cast to (char*) looks pointless, since args[i] is
already typed as 'char *'. Might as well remove it while touching this
line.
Looks like a decent refactor;
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature