From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Marczykowski Subject: Re: Xen scripts rewrite Date: Thu, 01 Mar 2012 18:50:31 +0100 Message-ID: <4F4FB6E7.4010001@invisiblethingslab.com> References: <20120301124243.9B202298942@mx1.internecto.net> <4F4F7B0B.5000808@invisiblethingslab.com> <20120301173410.53D3B29896D@mx1.internecto.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1679570008985261139==" Return-path: In-Reply-To: <20120301173410.53D3B29896D@mx1.internecto.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mark Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1679570008985261139== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFCCD9A9E3E85C6CEC1C99638" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFCCD9A9E3E85C6CEC1C99638 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 >> >=20 > Alright, thanks. >=20 > I really do need to understand the purpose of locking and when Xen > does what with regards to locking.=20 These scripts are called by udev (from /etc/udev/rules.d/xen-backend.rule= s) as result of appearing new backend device. Toolstack (eg. xend) uses it to f= inish setup backend (eg. attach vif interface to brigde, or prepare /dev/loopX = for block backend). They are called simultaneously, so some locking is requir= ed (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 sup= port hotplug script for block backend yet (all setup is done by libxl internal= ly). > 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. >=20 > 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. >=20 > So who's gonna shed some light on this? And is anyone interested to > join the fun? :) >=20 > Mark --=20 Best Regards / Pozdrawiam, Marek Marczykowski Invisible Things Lab --------------enigFCCD9A9E3E85C6CEC1C99638 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPT7brAAoJENuP0xzK19csYfIH/idC94PYMOS0ApIy52CNA/UY /ZLyYzpKg/sIq8lIfdFvGEUpA3M9hdJo/YI0YGG2S1om+OIIC394vJZVE6TgNCEz ngwa4tk425S1M2W7lf3zTUj/lZWXp09HVq3C5fpPDMYhAaFAreb7HdXLt9aQGutB 9mw+QMeGFve6vamfngluIxY4znJuv0foq5LIy+p9Ds2Q7t188iq9N8P+o5Od2cXn Vgma//nU3MlskMQtuas6g5naJkCMKPb1+JcL3+BdhkNS+pWE1vrbHqqWRsI+ALmC DBScdDUx1tuErulQXIBP9NU8vRxFjtfjp56yxF5Q1qooExoWLdM6coj3pS/H4Ck= =2q5j -----END PGP SIGNATURE----- --------------enigFCCD9A9E3E85C6CEC1C99638-- --===============1679570008985261139== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============1679570008985261139==--