[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mo
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions |
Date: |
Thu, 27 Jun 2013 15:26:23 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
On 06/26/2013 09:27 PM, 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>
> ---
> @@ -4075,20 +4075,27 @@ static void file_completion(const char *input)
> if (stat(file, &sb) == 0 && S_ISDIR(sb.st_mode)) {
> pstrcat(file, sizeof(file), "/");
> }
> - readline_add_completion(cur_mon->rs, file);
> + readline_add_completion(mon->rs, file);
> }
> }
> closedir(ffs);
Oops, I started reviewing that before noticing you posted a v3. At any
rate, my review of v2 still stands on this patch. Meanwhile, I just
barely noticed that this pre-existing code might cause a -Wshadow
warning in the future if <strings.h> is ever included. I'm not sure
what qemu's policy is on being clean against -Wshadow warnings, but I
personally tend to avoid local variables whose name might conflict with
global functions.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH V3 0/7] monitor: support sub command group in auto completion and help, Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 2/7] monitor: discard global variable *mon_cmds, Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 3/7] monitor: discard global variable *info_cmds in help functions, Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 4/7] monitor: code move for parse_cmdline(), Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 5/7] monitor: support sub commands in auto completion, Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 6/7] monitor: improve "help" in auto completion for sub command, Wenchao Xia, 2013/06/26
- [Qemu-devel] [PATCH V3 7/7] monitor: improve "help" to allow show tip of single command in sub group, Wenchao Xia, 2013/06/26