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] [PATCH] rename QEMU device model log file by dom id and redi

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] rename QEMU device model log file by dom id and redirect stdout/stderr only if spawning device model background.
From: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Date: Mon, 23 Jan 2006 11:11:37 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 23 Jan 2006 03:21:45 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.8i
rename QEMU device model log file by dom id and redirect stdout/stderr only if 
spawning device model background.
Signed-off-by: Zhai Edwin <edwin.zhai@xxxxxxxxx>
diff -r c4ae9456a459 tools/ioemu/exec.c
--- a/tools/ioemu/exec.c        Fri Jan 20 20:31:09 2006 +0100
+++ b/tools/ioemu/exec.c        Mon Jan 23 11:02:47 2006 +0800
@@ -143,8 +143,10 @@
         setvbuf(logfile, NULL, _IOLBF, 0);
 #endif
 
-        stdout = logfile;
-        stderr = logfile;
+        if ( !isatty( fileno(stdout))) {
+            stdout = logfile;
+            stderr = logfile;
+        }
     }
 }
 
diff -r c4ae9456a459 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Fri Jan 20 20:31:09 2006 +0100
+++ b/tools/ioemu/vl.c  Mon Jan 23 11:02:47 2006 +0800
@@ -2699,11 +2699,6 @@
     macaddr[4] = 0x34;
     macaddr[5] = 0x56;
 
-    /* init debug */
-    sprintf(qemu_dm_logfilename, "/var/log/qemu-dm.%d.log", getpid());
-    cpu_set_log_filename(qemu_dm_logfilename);
-    cpu_set_log(0);
-
     optind = 1;
     for(;;) {
         if (optind >= argc)
@@ -2913,6 +2908,12 @@
             case QEMU_OPTION_d:
                 {
                     domid = atoi(optarg);
+
+                    /* init debug */
+                    sprintf(qemu_dm_logfilename, "/var/log/qemu-dm.dom%d.log", 
domid);
+                    cpu_set_log_filename(qemu_dm_logfilename);
+                    cpu_set_log(0);
+
                     fprintf(logfile, "domid: %d\n", domid);
                 }
                 break;


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] rename QEMU device model log file by dom id and redirect stdout/stderr only if spawning device model background., Edwin Zhai <=