From patchwork Tue Apr 4 19:10:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9662453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C5BA60353 for ; Tue, 4 Apr 2017 19:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2043428546 for ; Tue, 4 Apr 2017 19:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1511A28551; Tue, 4 Apr 2017 19:12:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AE45328549 for ; Tue, 4 Apr 2017 19:12:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvTqg-0007lv-Mi; Tue, 04 Apr 2017 19:10:38 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvTqf-0007ki-Au for xen-devel@lists.xenproject.org; Tue, 04 Apr 2017 19:10:37 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id F4/CC-04817-CAFE3E85; Tue, 04 Apr 2017 19:10:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsUyZ7p8oO6a948 jDHa85bf4vmUykwOjx+EPV1gCGKNYM/OS8isSWDManqcVvOOoaJ3xiK2B8ShbFyMXh5DABCaJ L2fOMUE4fxgl+q7tY4VwNjBKXF19mAXC6WOUWL38HmMXIwcHm4CJxJtVjl2MnBwiAkoS91ZNZ gKxmQUmM0q8WyEEUiIMVLLyqBRImEVAVeLjhucsIDavgLXE8alTWEFsCQE5iUvbvjCDlHMK2E j8X1IGEhYCKtk+dQ9UiaHE6YfbGCcw8i1gZFjFqF6cWlSWWqRrqJdUlJmeUZKbmJmja2hgppe bWlycmJ6ak5hUrJecn7uJERgiDECwg3Hnc6dDjJIcTEqivIw3H0cI8SXlp1RmJBZnxBeV5qQW H2KU4eBQkuDNfweUEyxKTU+tSMvMAQYrTFqCg0dJhHc+SJq3uCAxtzgzHSJ1ilFRSpzXGSQhA JLIKM2Da4NFyCVGWSlhXkagQ4R4ClKLcjNLUOVfMYpzMCoJ8zaATOHJzCuBm/4KaDET0OIndx 6CLC5JREhJNTB2vP3dO41l9wutgykdLTvXzUgMcT/Svz//xNzHawplTvx6u2j+3dP/Fqpwpy7 4/Pxvw9PVU35OVC6Me5pxsW3tZu8nNye+j4ta3ln1cG2k+M+yH5eMJ6jGHMv9alua/NZY32/v 2lkus9c3L7H+xejkOmnd9OMOzgZPz3rapuxdxsftzKNhFKQgocRSnJFoqMVcVJwIADzlxpuLA gAA X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1491333034!95785402!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22939 invoked from network); 4 Apr 2017 19:10:36 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Apr 2017 19:10:36 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v34JAW3i021311 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Apr 2017 19:10:32 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v34JAVi2011676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Apr 2017 19:10:32 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v34JAVl3005689; Tue, 4 Apr 2017 19:10:31 GMT Received: from x230.dumpdata.com.com (/10.154.163.250) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 04 Apr 2017 12:10:31 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org Date: Tue, 4 Apr 2017 15:10:17 -0400 Message-Id: <20170404191017.19584-6-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170404191017.19584-1-konrad.wilk@oracle.com> References: <20170404191017.19584-1-konrad.wilk@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Ian Jackson , wei.liu2@citrix.com, jbeulich@suse.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v2 5/5] tmem: Parse UUIDs correctly. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP A simple xl tmem-shared-auth -u 00000000-0000-000A-0000-000000000001 -A 0 0 resulted in uuid_low = 1 (correct) and uuid_high = 0 (umm?). The issue was that for hex values above 'A' (or 'a') we forgot to add 10. Acked-by: Wei Liu Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ian Jackson Cc: Wei Liu v2: - Added Wei's Ack. --- tools/libxc/xc_tmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_tmem.c b/tools/libxc/xc_tmem.c index 5f5e18f..9bf5cc3 100644 --- a/tools/libxc/xc_tmem.c +++ b/tools/libxc/xc_tmem.c @@ -138,9 +138,9 @@ static int xc_tmem_uuid_parse(char *uuid_str, uint64_t *uuid_lo, uint64_t *uuid_ else if ( *p >= '0' && *p <= '9' ) digit = *p - '0'; else if ( *p >= 'A' && *p <= 'F' ) - digit = *p - 'A'; + digit = *p - 'A' + 10; else if ( *p >= 'a' && *p <= 'f' ) - digit = *p - 'a'; + digit = *p - 'a' + 10; else return -1; *x = (*x << 4) | digit;