From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosuke Iwamatsu Subject: [PATCH] xend: open qemu-dm log files in append mode Date: Thu, 26 Jun 2008 14:06:43 +0900 Message-ID: <486323E3.3000407@ab.jp.nec.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010500060306010905040907" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Yuji Shimada List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010500060306010905040907 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit qemu-dm log files would be easily overwritten if domains reboot several times. With this patch, a single qemu-dm log file is used per domain and log messages will be continuously appended to it. Signed-off-by: Yosuke Iwamatsu Regards, ----------------------- Yosuke Iwamatsu NEC Corporation --------------010500060306010905040907 Content-Type: all/allfiles; name="qemu-dm-log-append.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-dm-log-append.patch" xend: Open the qemu-dm log file in append mode. Signed-off-by: Yosuke Iwamatsu diff -r 926a366ca82f tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Fri Jun 20 15:21:26 2008 +0100 +++ b/tools/python/xen/xend/image.py Wed Jun 25 16:13:55 2008 +0900 @@ -378,13 +378,9 @@ class ImageHandler: # keep track of pid and spawned options to kill it later self.logfile = "/var/log/xen/qemu-dm-%s.log" % str(self.vm.info['name_label']) - if os.path.exists(self.logfile): - if os.path.exists(self.logfile + ".1"): - os.unlink(self.logfile + ".1") - os.rename(self.logfile, self.logfile + ".1") null = os.open("/dev/null", os.O_RDONLY) - logfd = os.open(self.logfile, os.O_WRONLY|os.O_CREAT|os.O_TRUNC|os.O_APPEND) + logfd = os.open(self.logfile, os.O_WRONLY|os.O_CREAT|os.O_APPEND) sys.stderr.flush() pid = os.fork() --------------010500060306010905040907 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010500060306010905040907--