xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Yufang Zhang <yufang521247@gmail.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: pbonzini@redhat.com, Yufang Zhang <yuzhang@redhat.com>,
	xen-devel@lists.xensource.com, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] xenconsole: add file lock to xenconsole
Date: Fri, 27 May 2011 11:20:54 +0800	[thread overview]
Message-ID: <4DDF1896.5000704@gmail.com> (raw)
In-Reply-To: <19931.58936.294657.639013@mariner.uk.xensource.com>

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

  reply	other threads:[~2011-05-27  3:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 14:13 [PATCH] xenconsole: add file lock to xenconsole Yufang Zhang
2011-05-24 17:09 ` Ian Jackson
2011-05-27  3:20   ` Yufang Zhang [this message]
2011-05-27  8:09     ` 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=4DDF1896.5000704@gmail.com \
    --to=yufang521247@gmail.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=pbonzini@redhat.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yuzhang@redhat.com \
    /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).