* Xen scripts rewrite
@ 2012-03-01 12:38 Mark
2012-03-01 13:29 ` Mark van Dijk
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Mark @ 2012-03-01 12:38 UTC (permalink / raw)
To: xen-devel
Greetings,
I am trying to wrap my head around the xen scripts in /etc/xen/scripts.
I am currently looking at locking.sh but I don't really understand what
it is doing.
I see that claim_lock has a while loop, it seems to wait until it can
write its own PID to $lockdir/owner. If the file $lockdir/owner exists,
check if the pid is still running. If it's still running when the
loop is done, steal the lock by writing $$ to $lockdir/owner anyway.
Anyway. Can someone please further explain this file in plain English
and detail. Am I right with my above assumptions, and when are locks
even used?
As said, I request as much detail as possible - the rewrite is to
improve efficiency, readability and user customisation. As it is now
you have too much functions that confuse me silly.
If I am succesful I will share the outcome, so there's an incentive if
you need one.
Thank you,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 12:38 Xen scripts rewrite Mark
@ 2012-03-01 13:29 ` Mark van Dijk
2012-03-02 19:47 ` Ian Campbell
2012-03-01 13:35 ` Marek Marczykowski
2012-03-02 13:30 ` Roger Pau Monné
2 siblings, 1 reply; 7+ messages in thread
From: Mark van Dijk @ 2012-03-01 13:29 UTC (permalink / raw)
To: xen-devel
> I am trying to wrap my head around the xen scripts
> As said, I request as much detail as possible - the rewrite is to
> improve efficiency, readability and user customisation. As it is now
> you have too much functions that confuse me silly.
I forgot to ask - these scripts in /etc/xen/scripts are used by xl too,
aren't they?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 12:38 Xen scripts rewrite Mark
2012-03-01 13:29 ` Mark van Dijk
@ 2012-03-01 13:35 ` Marek Marczykowski
2012-03-01 17:32 ` Mark
2012-03-02 13:30 ` Roger Pau Monné
2 siblings, 1 reply; 7+ messages in thread
From: Marek Marczykowski @ 2012-03-01 13:35 UTC (permalink / raw)
To: Mark; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1192 bytes --]
On 01.03.2012 13:38, Mark wrote:
> Greetings,
>
> I am trying to wrap my head around the xen scripts in /etc/xen/scripts.
> I am currently looking at locking.sh but I don't really understand what
> it is doing.
>
> I see that claim_lock has a while loop, it seems to wait until it can
> write its own PID to $lockdir/owner. If the file $lockdir/owner exists,
> check if the pid is still running. If it's still running when the
> loop is done, steal the lock by writing $$ to $lockdir/owner anyway.
>
> Anyway. Can someone please further explain this file in plain English
> and detail. Am I right with my above assumptions, and when are locks
> even used?
>
> As said, I request as much detail as possible - the rewrite is to
> improve efficiency, readability and user customisation. As it is now
> you have too much functions that confuse me silly.
>
> If I am succesful I will share the outcome, so there's an incentive if
> you need one.
Current locking mechanism have some problems. I've written about it here:
http://lists.xen.org/archives/html/xen-devel/2011-07/msg00182.html
--
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 13:35 ` Marek Marczykowski
@ 2012-03-01 17:32 ` Mark
2012-03-01 17:50 ` Marek Marczykowski
0 siblings, 1 reply; 7+ messages in thread
From: Mark @ 2012-03-01 17:32 UTC (permalink / raw)
To: Marek Marczykowski; +Cc: xen-devel
> > I am trying to wrap my head around the xen scripts
> > in /etc/xen/scripts. I am currently looking at locking.sh but I
> > don't really understand what it is doing.
> >
> > I see that claim_lock has a while loop, it seems to wait until it
> > can write its own PID to $lockdir/owner. If the file $lockdir/owner
> > exists, check if the pid is still running. If it's still running
> > when the loop is done, steal the lock by writing $$ to
> > $lockdir/owner anyway.
> >
> > Anyway. Can someone please further explain this file in plain
> > English and detail. Am I right with my above assumptions, and when
> > are locks even used?
> >
> > As said, I request as much detail as possible - the rewrite is to
> > improve efficiency, readability and user customisation. As it is now
> > you have too much functions that confuse me silly.
> >
> > If I am succesful I will share the outcome, so there's an incentive
> > if you need one.
>
> Current locking mechanism have some problems. I've written about it
> here:
> http://lists.xen.org/archives/html/xen-devel/2011-07/msg00182.html
>
Alright, thanks.
I really do need to understand the purpose of locking and when Xen
does what with regards to locking. So, my request for a detailed
explanation still stands. And I have yet to understand whether xl uses
these scripts, because I am still using xm for the moment.
I have a bit of success already because with a little bit of hacking
here and there I have managed to write a script for use with
openvswitch. But I don't want to release my patches in small steps, a
lot has to be done first.
So who's gonna shed some light on this? And is anyone interested to
join the fun? :)
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 17:32 ` Mark
@ 2012-03-01 17:50 ` Marek Marczykowski
0 siblings, 0 replies; 7+ messages in thread
From: Marek Marczykowski @ 2012-03-01 17:50 UTC (permalink / raw)
To: Mark; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 2431 bytes --]
On 01.03.2012 18:32, Mark wrote:
>>> I am trying to wrap my head around the xen scripts
>>> in /etc/xen/scripts. I am currently looking at locking.sh but I
>>> don't really understand what it is doing.
>>>
>>> I see that claim_lock has a while loop, it seems to wait until it
>>> can write its own PID to $lockdir/owner. If the file $lockdir/owner
>>> exists, check if the pid is still running. If it's still running
>>> when the loop is done, steal the lock by writing $$ to
>>> $lockdir/owner anyway.
>>>
>>> Anyway. Can someone please further explain this file in plain
>>> English and detail. Am I right with my above assumptions, and when
>>> are locks even used?
>>>
>>> As said, I request as much detail as possible - the rewrite is to
>>> improve efficiency, readability and user customisation. As it is now
>>> you have too much functions that confuse me silly.
>>>
>>> If I am succesful I will share the outcome, so there's an incentive
>>> if you need one.
>>
>> Current locking mechanism have some problems. I've written about it
>> here:
>> http://lists.xen.org/archives/html/xen-devel/2011-07/msg00182.html
>>
>
> Alright, thanks.
>
> I really do need to understand the purpose of locking and when Xen
> does what with regards to locking.
These scripts are called by udev (from /etc/udev/rules.d/xen-backend.rules) as
result of appearing new backend device. Toolstack (eg. xend) uses it to finish
setup backend (eg. attach vif interface to brigde, or prepare /dev/loopX for
block backend). They are called simultaneously, so some locking is required
(eg. to ensure that no two script choose same loop device number).
With xl it is similar, at least for network backend. AFAIK xl doesn't support
hotplug script for block backend yet (all setup is done by libxl internally).
> So, my request for a detailed
> explanation still stands. And I have yet to understand whether xl uses
> these scripts, because I am still using xm for the moment.
>
> I have a bit of success already because with a little bit of hacking
> here and there I have managed to write a script for use with
> openvswitch. But I don't want to release my patches in small steps, a
> lot has to be done first.
>
> So who's gonna shed some light on this? And is anyone interested to
> join the fun? :)
>
> Mark
--
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 12:38 Xen scripts rewrite Mark
2012-03-01 13:29 ` Mark van Dijk
2012-03-01 13:35 ` Marek Marczykowski
@ 2012-03-02 13:30 ` Roger Pau Monné
2 siblings, 0 replies; 7+ messages in thread
From: Roger Pau Monné @ 2012-03-02 13:30 UTC (permalink / raw)
To: Mark; +Cc: xen-devel
2012/3/1 Mark <mark+lists@internecto.net>:
> Greetings,
>
> I am trying to wrap my head around the xen scripts in /etc/xen/scripts.
> I am currently looking at locking.sh but I don't really understand what
> it is doing.
>
> I see that claim_lock has a while loop, it seems to wait until it can
> write its own PID to $lockdir/owner. If the file $lockdir/owner exists,
> check if the pid is still running. If it's still running when the
> loop is done, steal the lock by writing $$ to $lockdir/owner anyway.
>
> Anyway. Can someone please further explain this file in plain English
> and detail. Am I right with my above assumptions, and when are locks
> even used?
>
> As said, I request as much detail as possible - the rewrite is to
> improve efficiency, readability and user customisation. As it is now
> you have too much functions that confuse me silly.
>
> If I am succesful I will share the outcome, so there's an incentive if
> you need one.
If you can, could you also clean the scripts of bashisms? so all of
them use /bin/sh. Now some of them use /bin/sh and some use /bin/bash
and I don't really like to install bash just for launching some
hotplug scripts.
> Thank you,
> Mark
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Xen scripts rewrite
2012-03-01 13:29 ` Mark van Dijk
@ 2012-03-02 19:47 ` Ian Campbell
0 siblings, 0 replies; 7+ messages in thread
From: Ian Campbell @ 2012-03-02 19:47 UTC (permalink / raw)
To: mark+list@internecto.net; +Cc: xen-devel@lists.xen.org
On Thu, 2012-03-01 at 13:29 +0000, Mark van Dijk wrote:
> > I am trying to wrap my head around the xen scripts
> > As said, I request as much detail as possible - the rewrite is to
> > improve efficiency, readability and user customisation. As it is now
> > you have too much functions that confuse me silly.
>
> I forgot to ask - these scripts in /etc/xen/scripts are used by xl too,
> aren't they?
Correct. At least the vif-* ones are. The block-* ones will be once that
feature is implemented in libxl/xl.
There have been some discussions about changing the mechanism by which
they are called (see recent threads on list from Roger Pau Monné) but
the interface to the scripts themselves sould be retained for backwards
compatibility.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-03-02 19:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 12:38 Xen scripts rewrite Mark
2012-03-01 13:29 ` Mark van Dijk
2012-03-02 19:47 ` Ian Campbell
2012-03-01 13:35 ` Marek Marczykowski
2012-03-01 17:32 ` Mark
2012-03-01 17:50 ` Marek Marczykowski
2012-03-02 13:30 ` Roger Pau Monné
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).