From: Ian Campbell <ian.campbell@citrix.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Alex Velazquez <alex.j.velazquez@gmail.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH for-4.6 1/2] libxl: fix devd removal path
Date: Wed, 23 Sep 2015 10:50:42 +0100 [thread overview]
Message-ID: <1443001842.10338.225.camel@citrix.com> (raw)
In-Reply-To: <56027284.4080703@citrix.com>
On Wed, 2015-09-23 at 11:36 +0200, Roger Pau Monné wrote:
> El 23/09/15 a les 10.46, Ian Campbell ha escrit:
> > On Tue, 2015-09-22 at 18:23 +0200, Roger Pau Monne wrote:
> > >
> > > - /* Check if event_path ends with "state" and truncate it */
> > > - if (strlen(event_path) < strlen("state"))
> > > + /* Check if event_path ends with "state" or "online" and
> > > truncate it. */
> > > + if (strlen(event_path) < strlen("state") ||
> > > + strlen(event_path) < strlen("online"))
> >
> > This is the same as strlen(...) < strlen("state") (or more formaly <
> > min(strlen("state"),strlen("online")).
> >
> > Which is a bit dangerous because one might be tricked into thinking
> > that
> > path - strlen("online") was safe to do after this check when it's not.
> > (The
> > new code seems to have avoided this particular pattern which the old
> > code
> > used though)
>
> With the new code this is no longer needed, so I'm tempted to just
> remove it.
>
> > I think I agree with Ian's suggestion to use strrchr.
> >
> > Alternatively you could register two watches on the two specific paths
> > you
> > care about and point them at wrappers which trivially strip the
> > appropriate
> > trailing text and pass the base onto the current code?
> >
> > BTW, what is watch_path passed to this function, is it not the watched
> > path
> > i.e. the exact truncated event_path that you are looking for?
>
> Watch path is /local/domain/<domid>/backend so we can get an event for
> any backend that is added to the domain. We could add specific watches
> once we have identified backends that the driver domain needs to serve,
> but it's going to make the code more complex and at this point in the
> release I don't think that's a good idea.
Ah, my mistake I thought we were already watching the actual backend dirs
one by one. Since we aren't I don't think it makes sense to change, and
having a single global watch is preferable anyway.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-09-23 10:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 16:23 [PATCH for-4.6 0/2] libxl: devd fixes Roger Pau Monne
2015-09-22 16:23 ` [PATCH for-4.6 1/2] libxl: fix devd removal path Roger Pau Monne
2015-09-22 16:35 ` Ian Jackson
2015-09-23 8:46 ` Ian Campbell
2015-09-23 9:36 ` Roger Pau Monné
2015-09-23 9:50 ` Ian Campbell [this message]
2015-09-22 16:23 ` [PATCH for-4.6 2/2] libxl: fix the cleanup of the backend path when using driver domains Roger Pau Monne
2015-09-22 16:45 ` Ian Jackson
2015-09-23 8:52 ` Ian Campbell
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=1443001842.10338.225.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=alex.j.velazquez@gmail.com \
--cc=ian.jackson@eu.citrix.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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.