From: Doug Goldstein <cardoe@cardoe.com>
To: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCHv2] 1/3] libxc: prefer using privcmd character device
Date: Tue, 1 Dec 2015 13:08:30 -0600 [thread overview]
Message-ID: <565DF02E.4010104@cardoe.com> (raw)
In-Reply-To: <1448970397.15768.112.camel@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 1686 bytes --]
On 12/1/15 5:46 AM, Ian Campbell wrote:
> On Tue, 2015-11-24 at 14:14 -0600, Doug Goldstein wrote:
>> Prefer using the character device over the proc file if the character
>> device exists. This follows similar conversions of xenbus to avoid
>> issues with FMODE_ATOMIC_POS added in Linux 3.14 and newer.
>>
>> CC: Ian Jackson <ian.jackson@eu.citrix.com>
>> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> CC: Ian Campbell <ian.campbell@citrix.com>
>> CC: Wei Liu <wei.liu2@citrix.com>
>> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
>> ---
>> tools/libxc/xc_linux_osdep.c | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
>> index 76c55ff..c078b3d 100644
>> --- a/tools/libxc/xc_linux_osdep.c
>> +++ b/tools/libxc/xc_linux_osdep.c
>> @@ -46,7 +46,14 @@
>> static xc_osdep_handle linux_privcmd_open(xc_interface *xch)
>> {
>> int flags, saved_errno;
>> - int fd = open("/proc/xen/privcmd", O_RDWR);
>> + int fd = open("/dev/xen/privcmd", O_RDWR); /* prefer this newer
>> interface */
>> +
>> + if ( fd == -1 && ( errno == ENOENT || errno == ENXIO ||
>> + errno == ENODEV || errno == EACCES ))
>
> This adds EACCESS to the set Ian suggested would be tolerable in his reply
> to v1. I'm leaning towards thinking that if the device is present but not
> openable by the current user then that's a system configuration error which
> should be reported.
>
> Anyone want to argue otherwise?
>
I'll drop EACCES. I was just trying to be proactive for another possible
error.
--
Doug Goldstein
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 959 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2015-12-01 19:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 20:14 [PATCHv2] 1/3] libxc: prefer using privcmd character device Doug Goldstein
2015-11-24 20:14 ` [PATCHv2] 2/3] update outdated header comment on privcmd.h Doug Goldstein
2015-11-24 20:14 ` [PATCHv2] 3/3] xendomains initscript: test for privcmd char device Doug Goldstein
2015-12-01 11:46 ` [PATCHv2] 1/3] libxc: prefer using privcmd character device Ian Campbell
2015-12-01 19:08 ` Doug Goldstein [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=565DF02E.4010104@cardoe.com \
--to=cardoe@cardoe.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.