From patchwork Sat Jul 20 01:44:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 260382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 70E962C009C for ; Sat, 20 Jul 2013 11:46:44 +1000 (EST) Received: from localhost ([::1]:36776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MFt-0002xU-IP for incoming@patchwork.ozlabs.org; Fri, 19 Jul 2013 21:46:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MFW-0002w5-Qf for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0MFV-0002ev-Vh for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:18 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:58361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0MFV-0002eh-9p for qemu-devel@nongnu.org; Fri, 19 Jul 2013 21:46:17 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 20 Jul 2013 07:09:15 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 20 Jul 2013 07:09:14 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 6DB8F394002D for ; Sat, 20 Jul 2013 07:16:08 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6K1k9T926411040 for ; Sat, 20 Jul 2013 07:16:09 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6K1kBla021611 for ; Sat, 20 Jul 2013 01:46:11 GMT Received: from RH63Wenchao ([9.77.181.206]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6K1iXRo018239; Sat, 20 Jul 2013 01:46:09 GMT From: Wenchao Xia To: qemu-devel@nongnu.org Date: Sat, 20 Jul 2013 09:44:04 +0800 Message-Id: <1374284656-12025-3-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1374284656-12025-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1374284656-12025-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13072001-5564-0000-0000-000008E10BCE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.4 Cc: pbonzini@redhat.com, Wenchao Xia , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH V7 02/13] monitor: avoid use of global *cur_mon in file_completion() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- monitor.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index b88c02b..0f92bca 100644 --- a/monitor.c +++ b/monitor.c @@ -4030,7 +4030,7 @@ static void cmd_completion(Monitor *mon, const char *name, const char *list) } } -static void file_completion(const char *input) +static void file_completion(Monitor *mon, const char *input) { DIR *ffs; struct dirent *d; @@ -4053,7 +4053,7 @@ static void file_completion(const char *input) pstrcpy(file_prefix, sizeof(file_prefix), p + 1); } #ifdef DEBUG_COMPLETION - monitor_printf(cur_mon, "input='%s' path='%s' prefix='%s'\n", + monitor_printf(mon, "input='%s' path='%s' prefix='%s'\n", input, path, file_prefix); #endif ffs = opendir(path); @@ -4080,7 +4080,7 @@ 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); @@ -4191,7 +4191,7 @@ static void monitor_find_completion(const char *cmdline) case 'F': /* file completion */ readline_set_completion_index(cur_mon->rs, strlen(str)); - file_completion(str); + file_completion(mon, str); break; case 'B': /* block device name completion */