From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsJi1-0002OD-8T for qemu-devel@nongnu.org; Thu, 27 Jun 2013 17:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsJi0-0000aA-1f for qemu-devel@nongnu.org; Thu, 27 Jun 2013 17:26:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsJhz-0000a3-QD for qemu-devel@nongnu.org; Thu, 27 Jun 2013 17:26:27 -0400 Message-ID: <51CCADFF.4040805@redhat.com> Date: Thu, 27 Jun 2013 15:26:23 -0600 From: Eric Blake MIME-Version: 1.0 References: <1372303666-12323-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1372303666-12323-2-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1372303666-12323-2-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2KTNAOKLKALSBAGNAJWNS" Subject: Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: pbonzini@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2KTNAOKLKALSBAGNAJWNS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Wenchao Xia > --- > @@ -4075,20 +4075,27 @@ static void file_completion(const char *input) > if (stat(file, &sb) =3D=3D 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 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2KTNAOKLKALSBAGNAJWNS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRzK3/AAoJEKeha0olJ0NqVXkH/2gaDXS2SGfeQ72gMC79A2CV doCHzMzEPrLaBaAvBDQhAo/tMXTbbTyyJug3z2t6ksKbZbzwplnIgzYUBT1dXUME lPoS8Vgk09QxFjceMkGgebn9EIO+a+4uiSNlAxR+SqlHXkOmyxV/nz/3P3tke61P mGVaKK7cFrirMvvGOgecjUbDz9p4xMbIeAAdhdy874XiKzMFgU/Mk3g1F0dL5R/b diPkoZtqYrApeb8qup1aba1riAvb3buYYOPKNCn2yC7jI9ALulXmnxGoPqUEtcji FyWnii78YUEMKUB360gSU49nNqhg9vHP4F98SwcBXgkU4/OhTWikIzCzTkKYtxQ= =IpUO -----END PGP SIGNATURE----- ------enig2KTNAOKLKALSBAGNAJWNS--