WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xenconsole: add file lock to xenconsole

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenconsole: add file lock to xenconsole
From: Yufang Zhang <yufang521247@xxxxxxxxx>
Date: Fri, 27 May 2011 11:20:54 +0800
Cc: pbonzini@xxxxxxxxxx, Yufang Zhang <yuzhang@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx
Delivery-date: Fri, 27 May 2011 00:20:21 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=IPPqRp9q17cNkh1v/xDxW65VXDVmyDNfGsZ+x+fbRO0=; b=wHWb1a22t37kNcbbS4PjH+9cvtFaUezZ0d5U5LU/RhFxhnXQqNA+5aBt6bWwBEe8JZ ITn2xI8mSnUgG6VWVyYeWTGbW0EEElwA8QwDvZxG+l9Q572HdqYrSdMHwXRadxVVkYI1 nREAcBpuwYuIb7LPsllXHKIiApIXUbkfZXkho=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=EdY4Ibck0a52nnlGdWVKNn4WfM7wvGEO2ii66ppwCBTsCZOlTC+tBwj74kIqm6oCsn hDWSP5YgAb972tLmUONKtC91o/AxV7MlNzPWmqVxVCV+iRMWFtJ8KjmrlovREk+C+acq +ce3wWNUhnXnHrH5io1+W+9qK5Vyg12h9/WYk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19931.58936.294657.639013@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1306246402-12917-1-git-send-email-yuzhang@xxxxxxxxxx> <19931.58936.294657.639013@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10
On 05/25/2011 01:09 AM, Ian Jackson wrote:
Yufang Zhang writes ("[Xen-devel] [PATCH] xenconsole: add file lock to 
xenconsole"):
This patch add a file lock to xenconsole for each console id, so
that only one console could be attached to a guest at a time.
Otherwise, consoles would get stuck and print strange outputs.
If only we had a better console protocol, it would be possible to
attach multiple times.  Oh well.  In the meantime your semantic change
is sensible.

However:

+static int console_locked(const char *file)
+{
+        int fd;
+
You need to use the same indent level and coding style as the
surrounding code.

+        sprintf(buf, "/tmp/xenconsole-%d-%d", domid, num);
The lockfile should be in /var/run/xen.  You should use snprintf.


Thanks Ian. Version2 patch has been sent, please review.

What arrangements do you plan to make for cleaning up stale lockfiles
(which I think will be left behind if the xenconsole client crashes) ?
Are we just going to rely on them being removed at reboot and apart
from that let them accumulate a bit ?

Ian.
Considering the lock files are just blank and can be reused, leaving them behind is not that bad?

Yufang

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>