From patchwork Thu Jul 11 03:13:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 258286 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 312C12C02CD for ; Thu, 11 Jul 2013 13:16:46 +1000 (EST) Received: from localhost ([::1]:37797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux7N6-0002rd-3y for incoming@patchwork.ozlabs.org; Wed, 10 Jul 2013 23:16:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux7Ma-0002lz-Ty for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ux7MZ-0000wz-SB for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:12 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:50782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ux7MZ-0000wJ-7g for qemu-devel@nongnu.org; Wed, 10 Jul 2013 23:16:11 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Jul 2013 13:13:15 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Jul 2013 13:13:14 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 44B062BB0053 for ; Thu, 11 Jul 2013 13:16:07 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6B30nhx50987222 for ; Thu, 11 Jul 2013 13:00:50 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6B3G69Y016126 for ; Thu, 11 Jul 2013 13:16:06 +1000 Received: from RH63Wenchao.localdomain ([9.125.25.246]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6B3DtfN011597; Thu, 11 Jul 2013 13:16:04 +1000 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Thu, 11 Jul 2013 11:13:38 +0800 Message-Id: <1373512429-17865-3-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1373512429-17865-1-git-send-email-xiawenc@linux.vnet.ibm.com> References: <1373512429-17865-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13071103-5140-0000-0000-00000380A377 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.141 Cc: pbonzini@redhat.com, Wenchao Xia , armbru@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH V6 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 --- monitor.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 7398d00..181d5b0 100644 --- a/monitor.c +++ b/monitor.c @@ -4022,7 +4022,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; @@ -4045,7 +4045,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); @@ -4072,7 +4072,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); @@ -4183,7 +4183,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 */