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

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

To: Yufang Zhang <yufang521247@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH V2] xenconsole: add file lock to xenconsole
From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Date: Fri, 27 May 2011 10:04:05 +0200
Cc: Yufang Zhang <yuzhang@xxxxxxxxxx>, lersek@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian.Jackson@xxxxxxxxxxxxx
Delivery-date: Fri, 27 May 2011 01:05:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1306466202-4625-1-git-send-email-yufang521247@xxxxxxxxx>
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: <1306466202-4625-1-git-send-email-yufang521247@xxxxxxxxx>
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 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
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

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

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