xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, Doug Goldstein <cardoe@cardoe.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCHv3] 1/3] libxc: prefer using privcmd character device
Date: Wed, 2 Dec 2015 15:52:10 +0000	[thread overview]
Message-ID: <1449071530.4424.87.camel@citrix.com> (raw)
In-Reply-To: <20151202114249.GE21588@citrix.com>

On Wed, 2015-12-02 at 11:42 +0000, Wei Liu wrote:
> On Tue, Dec 01, 2015 at 01:27:53PM -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>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

I believe this version also satisfies Ian's comments on v1, so I've applied
all 3 patches.

NB the extra "]" in the subject meant git am produced things like "1/3]
libxc: prefer using privcmd character device". I've fixed that up.

> 
> > ---
> >  tools/libxc/xc_linux_osdep.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/libxc/xc_linux_osdep.c
> > b/tools/libxc/xc_linux_osdep.c
> > index 76c55ff..c3a3a14 100644
> > --- a/tools/libxc/xc_linux_osdep.c
> > +++ b/tools/libxc/xc_linux_osdep.c
> > @@ -46,7 +46,13 @@
> >  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 ))
> > +    {
> > +        /* Fallback to /proc/xen/privcmd */
> > +        fd = open("/proc/xen/privcmd", O_RDWR);
> > +    }
> >  
> >      if ( fd == -1 )
> >      {

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-12-02 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 19:27 [PATCHv3] 1/3] libxc: prefer using privcmd character device Doug Goldstein
2015-12-01 19:27 ` [PATCHv3] 2/3] update outdated header comment on privcmd.h Doug Goldstein
2015-12-01 19:27 ` [PATCHv3] 3/3] xendomains initscript: test for privcmd char device Doug Goldstein
2015-12-02 11:42 ` [PATCHv3] 1/3] libxc: prefer using privcmd character device Wei Liu
2015-12-02 15:52   ` Ian Campbell [this message]
2016-01-27 14:40 ` Doug Goldstein
2016-01-27 14:45   ` Processed: " xen

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=1449071530.4424.87.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=cardoe@cardoe.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).