From patchwork Sun Mar 19 13:41:12 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: 9632559 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 E1ABD601E9 for ; Sun, 19 Mar 2017 13:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C91C8284CB for ; Sun, 19 Mar 2017 13:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBF8B284D3; Sun, 19 Mar 2017 13:44:02 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID 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 B5BBC284CB for ; Sun, 19 Mar 2017 13:44:01 +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 1cpb5Q-0000Gm-UE; Sun, 19 Mar 2017 13:41:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpb5P-0000Ee-DT for xen-devel@lists.xenproject.org; Sun, 19 Mar 2017 13:41:31 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id CD/D7-01936-A8A8EC85; Sun, 19 Mar 2017 13:41:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNIsWRWlGSWpSXmKPExsVyMfTGId2urnM RBv+XM1t83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm7TroVrOWoaF/RxNTA2M/WxcjJISQwg1Fi y82ELkYuDhaBDywSf+atZAVJSAhMY5U4NFsUwo6RWLhwDzuEXS3R8OIAO0SzksSWyY8ZQZqFB HYxSRy9NglsqrCAnsTkb7cZQWw2AX2Jp2uvMXcxcgA1u0l8usYFEhYRCJQ4t+8xM0gvs0APo8 SdpomsEL0mEkevbgFbwCKgKnHx3kywOK+Aq8Teu7dZII6Qk7h5rpMZxOYEmrn000wWiINcJa6 /e8c+gVFoASPDKkb14tSistQiXVO9pKLM9IyS3MTMHF1DA1O93NTi4sT01JzEpGK95PzcTYzA IGQAgh2MX/qdDzFKcjApifKqCJ6IEOJLyk+pzEgszogvKs1JLT7EKMPBoSTBe2ctUE6wKDU9t SItMwcYDzBpCQ4eJRFe6zVAad7igsTc4sx0iNQpRmOOB6d2vWHi+NR/+A2TEEtefl6qlDjvGp BJAiClGaV5cINgcXqJUVZKmJcR6DQhnoLUotzMElT5V4ziHIxKwryvQKbwZOaVwO17BXQKE9A piT+PgJxSkoiQkmpgNDZWLdl48n3d5Ad3pPZ/koxVub52268bJ34cz3+/7cSFdYuv6B958kT/ xsOLs3wmG37euF9dUea0Yka9zvwit+1Mojq/3j9cFH9vg3jGNkkGbt6Mj2nvFj3TMuN3cI1lf vxbXvDgtGvnXx6x9ZWKv/tstkFZgf+6aJ4ne7yeli1XZQ30SHCZOEGJpTgj0VCLuag4EQA4df ISzgIAAA== X-Env-Sender: ketuzsezr@gmail.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1489930889!87370895!1 X-Originating-IP: [209.85.216.194] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39453 invoked from network); 19 Mar 2017 13:41:29 -0000 Received: from mail-qt0-f194.google.com (HELO mail-qt0-f194.google.com) (209.85.216.194) by server-7.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 19 Mar 2017 13:41:29 -0000 Received: by mail-qt0-f194.google.com with SMTP id r5so14549309qtb.2 for ; Sun, 19 Mar 2017 06:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4rxoYIHCJnE0hrWnKgaTfkEELsn0apiz5znJMtSGtMA=; b=iQHuQ8UWEfYdAQGvaSzd8Qha3MHyOQ26wvrQ20jbTLDihEmRxSrLohN3qvIY6SwRAa PmeOKQTOaivpUUT7fArKHEywyUIaxrYVzGsHIfwU/6o1maHWbsikHyrg3YcWbAMIdyu0 BZetZnO87aKvQ1HrB7NkiiYAQVl5t6uJbSYGliyvdI+ngE95M+4cg7ZIkoRrI3dj6YCL A9D7LhQGLArXL8aMKOPEOWNCcnTAQOulhqCiOASLHQn+BHMdsEBEmMWQX6rPyMJE4gnt zRAWKv39S/evPxWiD9hvQk15vknbD5WiTfs0eNtlllgJUFAvROaBe6rHdgslL+oEkh2a LoRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=4rxoYIHCJnE0hrWnKgaTfkEELsn0apiz5znJMtSGtMA=; b=uhIyHKCl3si1vUmv8W2Hi7DpIb11uJFdAbPFe5y37q60ioshg33vdYvF5AjrH/QdLu pP0/1MZWKfoGdXDp3AFFwtLGaGap1I+r9WpY82pLJgbXiR6sVsTwMEXhQ7Vd/VRoLkbA Z1Jg9SKElpmolIMwIGkP6VId0NW9S4aM+1TINp+97uSDkRUfzah2j503J1tp3GLfNnOO TEIEfl75Y8ZO1bm+54scknZhJzVLw7Wyyli5V9cjeqks3z/qn/gbSbdGf7aj6T96hzON U0He3dsLrgnNtY1JQp87SEHy5vJ0wX7kU0X7TTA70CJdqvdla/AtSyMkERs58gTrpt3i ATWg== X-Gm-Message-State: AFeK/H2Btq42KUa6UG7GGV4xRJREwLiBPTTtptI/rbwDiTrmUXBMcCCpz87jov01Tojgog== X-Received: by 10.200.50.165 with SMTP id z34mr21230834qta.205.1489930888859; Sun, 19 Mar 2017 06:41:28 -0700 (PDT) Received: from build-external.dumpdata.com (209-6-196-81.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com. [209.6.196.81]) by smtp.gmail.com with ESMTPSA id q31sm10286548qta.22.2017.03.19.06.41.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Mar 2017 06:41:28 -0700 (PDT) From: Konrad Rzeszutek Wilk X-Google-Original-From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, ian.jackson@citrix.com, wei.liu2@citrix.com Date: Sun, 19 Mar 2017 09:41:12 -0400 Message-Id: <1489930872-7823-6-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489930872-7823-1-git-send-email-konrad.wilk@oracle.com> References: <1489930872-7823-1-git-send-email-konrad.wilk@oracle.com> Cc: andrew.cooper3@citrix.com, Ian Jackson , jbeulich@suse.com Subject: [Xen-devel] [PATCH v1 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. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Wei Liu --- 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;