From patchwork Mon May 24 16:15:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prerna Saxena X-Patchwork-Id: 53435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D4A5AB7D1E for ; Tue, 25 May 2010 02:16:43 +1000 (EST) Received: from localhost ([127.0.0.1]:36738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGaKW-0007F5-32 for incoming@patchwork.ozlabs.org; Mon, 24 May 2010 12:16:40 -0400 Received: from [140.186.70.92] (port=38789 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGaJF-0006xC-Ju for qemu-devel@nongnu.org; Mon, 24 May 2010 12:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGaJA-0008KT-VC for qemu-devel@nongnu.org; Mon, 24 May 2010 12:15:21 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:44292) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGaJA-0008KK-Au for qemu-devel@nongnu.org; Mon, 24 May 2010 12:15:16 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp01.au.ibm.com (8.14.3/8.13.1) with ESMTP id o4OGCl2f015515 for ; Tue, 25 May 2010 02:12:47 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4OGFD791572992 for ; Tue, 25 May 2010 02:15:13 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o4OGFCk6003287 for ; Tue, 25 May 2010 02:15:12 +1000 Received: from [9.77.197.60] ([9.77.197.60]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o4OGFAHb003266; Tue, 25 May 2010 02:15:10 +1000 Message-ID: <4BFAA60D.6080308@linux.vnet.ibm.com> Date: Mon, 24 May 2010 21:45:09 +0530 From: Prerna Saxena User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Thunderbird/3.0.4 MIME-Version: 1.0 To: qemu-devel@nongnu.org References: <4BFAA3BB.5030207@linux.vnet.ibm.com> In-Reply-To: <4BFAA3BB.5030207@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Maneesh Soni , Anthony Liguori , Ananth , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 1/3]make tdb_hash available X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This function is used for hash table lookups by tracepoint framework. The patch adds trivial changes to reuse it. Regards, Signed-off by : Prerna (prerna@linux.vnet.ibm.com) Index: qemu/qdict.c =================================================================== --- qemu.orig/qdict.c +++ qemu/qdict.c @@ -56,7 +56,7 @@ QDict *qobject_to_qdict(const QObject *o * tdb_hash(): based on the hash agorithm from gdbm, via tdb * (from module-init-tools) */ -static unsigned int tdb_hash(const char *name) +unsigned int tdb_hash(const char *name) { unsigned value; /* Used to compute the hash value. */ unsigned i; /* Used to cycle through random values. */ Index: qemu/qdict.h =================================================================== --- qemu.orig/qdict.h +++ qemu/qdict.h @@ -46,5 +46,7 @@ const char *qdict_get_str(const QDict *q int64_t qdict_get_try_int(const QDict *qdict, const char *key, int64_t err_value); const char *qdict_get_try_str(const QDict *qdict, const char *key); +/* Export tdb_hash() for use by trace-framework */ +unsigned int tdb_hash(const char *name); #endif /* QDICT_H */