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/
Home Products Support Community News


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

Yufang Zhang writes ("[Xen-devel] [PATCH] xenconsole: add file lock to 
> 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.


> +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.

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 ?


Xen-devel mailing list

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