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-users] xm create of a VMX fails - qemu-dm gets SIGSEGV

To: "Yu, Ping Y" <ping.y.yu@xxxxxxxxx>, "Daniel Stekloff" <dsteklof@xxxxxxxxxx>, <xen-users@xxxxxxxxxxxxxxxxxxx>, "Steve Dobbelstein" <steved@xxxxxxxxxx>
Subject: RE: [Xen-users] xm create of a VMX fails - qemu-dm gets SIGSEGV
From: "Yu, Ping Y" <ping.y.yu@xxxxxxxxx>
Date: Thu, 1 Dec 2005 17:41:05 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 01 Dec 2005 09:41:12 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcX2TO/vZ5zn+9oXQkynu+FFqCYQCgAB9obgAAGZYOA=
Thread-topic: [Xen-users] xm create of a VMX fails - qemu-dm gets SIGSEGV
Add a signed-off line in attachment.


>-----Original Message-----
>From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Yu, Ping Y
>Sent: Thursday, December 01, 2005 5:02 PM
>To: Daniel Stekloff; xen-users@xxxxxxxxxxxxxxxxxxx; Steve Dobbelstein
>Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: RE: [Xen-users] xm create of a VMX fails - qemu-dm gets SIGSEGV
>
>Thanks Daniel. :-)
>The protection mechanism is a little weak.  Here is my patch.
>
>diff -r 28ce48573771 tools/ioemu/vl.c
>--- a/tools/ioemu/vl.c  Wed Nov 30 19:55:08 2005
>+++ b/tools/ioemu/vl.c  Thu Dec  1 17:00:21 2005
>@@ -1218,17 +1218,22 @@
> CharDriverState *qemu_chr_open_pty(void)
> {
>     int master_fd, slave_fd;
>+    char *slave_name;
>     struct termios term;
>
>     if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) < 0)
>         return NULL;
>
>-    /* Set raw attributes on the pty. */
>-    cfmakeraw(&term);
>-    tcsetattr(slave_fd, TCSAFLUSH, &term);
>-
>-    fprintf(stderr, "char device redirected to %s\n", ptsname(slave_fd));
>-    store_console_dev(domid, ptsname(slave_fd));
>+    slave_name = ptsname(master_fd);
>+    if (slave_name) {
>+       fprintf(stderr, "char device redirected to %s\n", slave_name);
>+       store_console_dev(domid, slave_name);
>+       /* Set raw attributes on the pty. */
>+        cfmakeraw(&term);
>+        tcsetattr(slave_fd, TCSAFLUSH, &term);
>+    } else {
>+        fprintf(logfile, "failed to redirect char device to pty");
>+    }
>
>     return qemu_chr_open_fd(master_fd, master_fd);
> }
>
>
>
>>-----Original Message-----
>>From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
>>[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Daniel Stekloff
>>Sent: Thursday, December 01, 2005 3:57 PM
>>To: xen-users@xxxxxxxxxxxxxxxxxxx; Steve Dobbelstein
>>Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>>Subject: Re: [Xen-users] xm create of a VMX fails - qemu-dm gets SIGSEGV
>>
>>On Wednesday 30 November 2005 16:09, Steve Dobbelstein wrote:
>>> Greetings, all.
>>>
>>> I'm having trouble getting a VMX domain started.  I'm running on changeset
>>> 8119.  Shortly after the "xm create" finishes the qemu-dm process goes
>>> defunct.  I wrote a little script so that strace could attach to the
>>> qemu-dm process right after the "xm create" finishes:
>>
>>The problem is ptsname(slave_fd) is returning NULL in the ioemu/vl.c code that
>>was introduced in changeset 8118:590915af8117.
>>
>>I've changed ptsname to ttyname() and it works. Not sure if this is the right
>>fix.
>>
>>Signed-off-by: Daniel Stekloff <dsteklof@xxxxxxxxxx>

Attachment: qemu_ptyname.patch
Description: qemu_ptyname.patch

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