[xen master] gdbsx: prefer privcmd character device

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] gdbsx: prefer privcmd character device

patchbot
commit 9f592d103014e9e63119d52dac19ba20c3574922
Author:     Doug Goldstein <[hidden email]>
AuthorDate: Tue Oct 31 10:20:11 2017 -0500
Commit:     Wei Liu <[hidden email]>
CommitDate: Thu Nov 2 16:42:40 2017 +0000

    gdbsx: prefer privcmd character device
   
    Prefer using the character device over the proc file if the character
    device exists.
   
    CC: Elena Ufimtseva <[hidden email]>
    CC: Ian Jackson <[hidden email]>
    CC: Stefano Stabellini <[hidden email]>
    CC: Wei Liu <[hidden email]>
    Signed-off-by: Doug Goldstein <[hidden email]>
    Reviewed-by: Elena Ufimtseva <[hidden email]>
    Release-acked-by: Julien Grall <[hidden email]>
---
 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 7ebf914..cc640d1 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
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog