xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Yufang Zhang <yufang521247@gmail.com>
Cc: Yufang Zhang <yuzhang@redhat.com>,
	lersek@redhat.com, xen-devel@lists.xensource.com,
	Ian.Jackson@eu.citrix.com
Subject: Re: [PATCH V2] xenconsole: add file lock to xenconsole
Date: Fri, 27 May 2011 10:04:05 +0200	[thread overview]
Message-ID: <4DDF5AF5.1040701@redhat.com> (raw)
In-Reply-To: <1306466202-4625-1-git-send-email-yufang521247@gmail.com>

On 05/27/2011 05:16 AM, Yufang Zhang wrote:
> @@ -280,6 +302,7 @@ int main(int argc, char **argv)
>   	int spty, xsfd;
>   	struct xs_handle *xs;
>   	char *end;
> +	char buf[100];
>   	console_type type = CONSOLE_INVAL;
>
>   	while((ch = getopt_long(argc, argv, sopt, lopt,&opt_ind)) != -1) {
> @@ -368,6 +391,13 @@ int main(int argc, char **argv)
>   		exit(EINVAL);
>   	}
>
> +	/* Make sure only one console is attached to guest */
> +	snprintf(buf, strlen("/var/run/xenconsole-%d-%d") + 1, "/var/run/xenconsole-%d-%d", domid, num);
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This should be sizeof(buf).

Otherwise looks good to me.

Paolo

      reply	other threads:[~2011-05-27  8:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27  3:16 [PATCH V2] xenconsole: add file lock to xenconsole Yufang Zhang
2011-05-27  8:04 ` Paolo Bonzini [this message]

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=4DDF5AF5.1040701@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=lersek@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yufang521247@gmail.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).