From patchwork Tue Oct 31 15:20:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 10034751 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 7FB77600C5 for ; Tue, 31 Oct 2017 15:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7139028B71 for ; Tue, 31 Oct 2017 15:22:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 660F328BA5; Tue, 31 Oct 2017 15:22:52 +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 DBF6828B9C for ; Tue, 31 Oct 2017 15:22:51 +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 1e9YL2-0003dA-Fw; Tue, 31 Oct 2017 15:20:24 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9YL0-0003d4-Gs for xen-devel@lists.xenproject.org; Tue, 31 Oct 2017 15:20:22 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 31/A6-08608-5B498F95; Tue, 31 Oct 2017 15:20:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsVyMfTGEd2tU35 EGkxYxGHxfctkJgdGj8MfrrAEMEaxZuYl5VcksGYceruLpWAeT0XTzv/sDYxtXF2MnBxCArMY JdZNje1i5OJgEWhnlnh2+TgLiCMh8I5F4seDDYwgVRICeRK7Xmxjh7DTJCbOPcQKYVdKLJvTz ggxSUHi94RDTCDNQgLLmCTOXHoLlmAT0JB48msGG4gtIqAkcW/VZCYQm1ngOqPEih3FXYwcHM IC5hI7FgWAhFkEVCVen5gAVsIrYCbR9e8G1A3yEot7VjNPYORfwMiwilG9OLWoLLVI11IvqSg zPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyMwfBiAYAfj3U0BhxglOZiURHl3On6PFOJL yk+pzEgszogvKs1JLT7EKMPBoSTBO33yj0ghwaLU9NSKtMwcYCDDpCU4eJREeH1B0rzFBYm5x ZnpEKlTjPYcF+5c+sPEcWDPLSDZcfMukHw283UDsxBLXn5eqpQ473qQNgGQtozSPLihsMi7xC grJczLCHSmEE9BalFuZgmq/CtGcQ5GJWHeIyBTeDLzSuB2vwI6iwnoLC8JsLNKEhFSUg2MU9n L90305b9ZoVNudOqBz9qqnStz3MOfnwiPeLAxPDWLP9j186Fqt9z5U0SD8mTrv/2cZDjP5r1Z 6zz5EzGRTWymYpp8pzbkLYv05b454/BRrfd7+d/vV1lk6WoyJe5h9hnFuNDgfG3vatHuNoOnX M4y74JjPZ367ERS70U8YFkbes/g5lclluKMREMt5qLiRAAptNdMtwIAAA== X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1509463220!69517273!1 X-Originating-IP: [209.85.216.196] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13476 invoked from network); 31 Oct 2017 15:20:21 -0000 Received: from mail-qt0-f196.google.com (HELO mail-qt0-f196.google.com) (209.85.216.196) by server-5.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 31 Oct 2017 15:20:21 -0000 Received: by mail-qt0-f196.google.com with SMTP id z28so21117735qtz.13 for ; Tue, 31 Oct 2017 08:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id; bh=OLGNS7P+XZBeSFmA8deotpb0OAAtlc2lDsJYYwW4Dnc=; b=ZDpSlNt0sG1ZSZbhRv78VZb9WnEkvfbT+D1qcqMhO/QflXA5yMgWMoNDG+CAaj3RNz +Frs6iMlCdNSJOUaor2d2VNgRuTCUbRkUuwn0E3GlemOADHpSQ8WnHdcYnZdbyUUQxFF UXllb8vGzulneFDDwuICWa6BIMFIKOQT/yBbs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OLGNS7P+XZBeSFmA8deotpb0OAAtlc2lDsJYYwW4Dnc=; b=nF8JaOMUFfvf9tnVXUbw96PGPGyDHyP3Z/mRpd9iU3yP/bWxsPKezjihBoVWkeLurs tM//i63bL8U8IJHNq0afwmkVyaLkXm1khhtpILD3ZnHSY1AK/7Kwk8QB70WLxKYfeNOP +3RGCTDWDYbFC1H5bFQ4cT7JKCgxGFIJRMR0JoNo0OckMDcrloq6cDohn92R0GqiusfO svW1PAlDeIS/T8GkpyaB4Gc18rm4QB4xwgA+AeI1aiFNX0dEh5+4tY/M2j5Efdwh5Mdm Es56dgaL5J6NGtwtiI2n4LjGro1+bn27F5YqJ2nfI2HRJ+L/3BV28j2+Rn1lrTQKzNh7 zasg== X-Gm-Message-State: AMCzsaWb9GhdiZdLn2lyWO3nTmvsHCh0zHBlxmDg/i8zsp+n4DXMV/D4 JOdmkLeg/5fJ38BEgyrQVdR7cj31RiA= X-Google-Smtp-Source: ABhQp+QwJ7gn11Aj+JjmcwJbknSSuKF5/pIfbBoxA2Hl3DBwgZlVLWdcJeArUzXTtnPQZDMKYZlBug== X-Received: by 10.200.3.111 with SMTP id w47mr3465486qtg.312.1509463220029; Tue, 31 Oct 2017 08:20:20 -0700 (PDT) Received: from swanson.localdomain (104-179-196-18.lightspeed.brhmal.sbcglobal.net. [104.179.196.18]) by smtp.gmail.com with ESMTPSA id 42sm1030192qkx.27.2017.10.31.08.20.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Oct 2017 08:20:19 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xenproject.org Date: Tue, 31 Oct 2017 10:20:11 -0500 Message-Id: <20171031152011.29809-1-cardoe@cardoe.com> X-Mailer: git-send-email 2.13.6 Cc: Elena Ufimtseva , Ian Jackson , Doug Goldstein , Wei Liu , Stefano Stabellini Subject: [Xen-devel] [PATCH] gdbsx: prefer privcmd character device 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 Prefer using the character device over the proc file if the character device exists. CC: Elena Ufimtseva CC: Ian Jackson CC: Stefano Stabellini CC: Wei Liu Signed-off-by: Doug Goldstein Reviewed-by: Elena Ufimtseva --- So this was originally submitted with 9c89dc95201 and 7d418eab3b6 and was rejected since the goal was to convert gdbsx to use libxc but that hasn't happened. /dev/xen/privcmd should be preferred and this change makes that happen. It would be nice if we landed this with the plan to convert gdbsx happening when it happens. --- tools/debugger/gdbsx/xg/xg_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c index 7ebf91435b..cc640d1d82 100644 --- a/tools/debugger/gdbsx/xg/xg_main.c +++ b/tools/debugger/gdbsx/xg/xg_main.c @@ -126,9 +126,11 @@ xg_init() int flags, saved_errno; XGTRC("E\n"); - if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) { - perror("Failed to open /proc/xen/privcmd\n"); - return -1; + if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1) { + if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) { + perror("Failed to open /dev/xen/privcmd or /proc/xen/privcmd\n"); + return -1; + } } /* Although we return the file handle as the 'xc handle' the API * does not specify / guarentee that this integer is in fact