diff mbox

gdbsx: prefer privcmd character device

Message ID 20171031152011.29809-1-cardoe@cardoe.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Goldstein Oct. 31, 2017, 3:20 p.m. UTC
Prefer using the character device over the proc file if the character
device exists.

CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
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(-)

Comments

Wei Liu Oct. 31, 2017, 3:25 p.m. UTC | #1
On Tue, Oct 31, 2017 at 10:20:11AM -0500, Doug Goldstein wrote:
> Prefer using the character device over the proc file if the character
> device exists.
> 
> CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
> ---
> 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.

Oh well... I think this is fine.

Elena has the final verdict.
Elena Ufimtseva Oct. 31, 2017, 8:58 p.m. UTC | #2
On Tue, Oct 31, 2017 at 03:25:39PM +0000, Wei Liu wrote:
> On Tue, Oct 31, 2017 at 10:20:11AM -0500, Doug Goldstein wrote:
> > Prefer using the character device over the proc file if the character
> > device exists.
> > 
> > CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> > CC: Ian Jackson <ian.jackson@eu.citrix.com>
> > CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > CC: Wei Liu <wei.liu2@citrix.com>
> > Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
> > ---
> > 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.
> 
> Oh well... I think this is fine.
> 
> Elena has the final verdict.

I think this is fine.
I will look into the conversion and relevant discussions if I find them and
see what can be done.

Thanks!

Meanwhile,
Reviewed-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>

Elena
Wei Liu Nov. 1, 2017, 10:20 a.m. UTC | #3
Cc Julien and change tag. I think this is safe to be applied to 4.10.

On Tue, Oct 31, 2017 at 01:58:07PM -0700, Elena Ufimtseva wrote:
> On Tue, Oct 31, 2017 at 03:25:39PM +0000, Wei Liu wrote:
> > On Tue, Oct 31, 2017 at 10:20:11AM -0500, Doug Goldstein wrote:
> > > Prefer using the character device over the proc file if the character
> > > device exists.
> > > 
> > > CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> > > CC: Ian Jackson <ian.jackson@eu.citrix.com>
> > > CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > CC: Wei Liu <wei.liu2@citrix.com>
> > > Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
> > > ---
> > > 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.
> > 
> > Oh well... I think this is fine.
> > 
> > Elena has the final verdict.
> 
> I think this is fine.
> I will look into the conversion and relevant discussions if I find them and
> see what can be done.
> 
> Thanks!
> 
> Meanwhile,
> Reviewed-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> 
> Elena
Julien Grall Nov. 2, 2017, 3:16 p.m. UTC | #4
Hi Wei,

On 01/11/17 10:20, Wei Liu wrote:
> Cc Julien and change tag. I think this is safe to be applied to 4.10.

I agree.

Release-acked-by: Julien Grall <julien.grall@linaro.org>

Cheers,

> 
> On Tue, Oct 31, 2017 at 01:58:07PM -0700, Elena Ufimtseva wrote:
>> On Tue, Oct 31, 2017 at 03:25:39PM +0000, Wei Liu wrote:
>>> On Tue, Oct 31, 2017 at 10:20:11AM -0500, Doug Goldstein wrote:
>>>> Prefer using the character device over the proc file if the character
>>>> device exists.
>>>>
>>>> CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
>>>> CC: Ian Jackson <ian.jackson@eu.citrix.com>
>>>> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>>> CC: Wei Liu <wei.liu2@citrix.com>
>>>> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
>>>> ---
>>>> 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.
>>>
>>> Oh well... I think this is fine.
>>>
>>> Elena has the final verdict.
>>
>> I think this is fine.
>> I will look into the conversion and relevant discussions if I find them and
>> see what can be done.
>>
>> Thanks!
>>
>> Meanwhile,
>> Reviewed-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
>>
>> Elena
diff mbox

Patch

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