Daniel P. Berrange
2007-Jun-01 00:55 UTC
[Xen-devel] PATCH: Use name instead of pid in QEMU logs
The attached patch changes the logfile name generated by qemu-dm to use the pattern qemu-dm-[NAME].log instead of qemu-dm-[PID].log. This makes it easier for the adminsitrator to figure out which log corresponds to which guest (particularly after a crash where you no long know what PID the qemu-dm process for your guest had). It also prevents the number of log files from growing unbounded. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2007-Jun-01 01:00 UTC
Re: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
Hurrah! Sounds like a brilliant idea to me (shuddering as remember the hundreds of qemu dm log files sitting around on my system). Cheers, Mark On Friday 01 June 2007, Daniel P. Berrange wrote:> The attached patch changes the logfile name generated by qemu-dm to use the > pattern qemu-dm-[NAME].log instead of qemu-dm-[PID].log. This makes it > easier for the adminsitrator to figure out which log corresponds to which > guest (particularly after a crash where you no long know what PID the > qemu-dm process for your guest had). It also prevents the number of log > files from growing unbounded. > > Signed-off-by: Daniel P. Berrange <berrange@redhat.com> > > Dan.-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Petersson, Mats
2007-Jun-01 08:39 UTC
RE: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Daniel P. Berrange > Sent: 01 June 2007 01:56 > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] PATCH: Use name instead of pid in QEMU logs > > The attached patch changes the logfile name generated by > qemu-dm to use the > pattern qemu-dm-[NAME].log instead of qemu-dm-[PID].log. > This makes it > easier for the adminsitrator to figure out which log > corresponds to which > guest (particularly after a crash where you no long know what PID the > qemu-dm process for your guest had). It also prevents the > number of log > files from growing unbounded.Great stuff. I''ll buy you a beer (or alternative beverage of your choice) next time we''re in the same place... -- Mats> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com> > > Dan. > -- > |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 > 978 392 2496 -=| > |=- Perl modules: http://search.cpan.org/~danberr/ > -=| > |=- Projects: http://freshmeat.net/~danielpb/ > -=| > |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF > F742 7D3B 9505 -=| >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2007-Jun-12 14:59 UTC
Re: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
On Fri, Jun 01, 2007 at 01:55:30AM +0100, Daniel P. Berrange wrote:> The attached patch changes the logfile name generated by qemu-dm to use the > pattern qemu-dm-[NAME].log instead of qemu-dm-[PID].log. This makes it > easier for the adminsitrator to figure out which log corresponds to which > guest (particularly after a crash where you no long know what PID the > qemu-dm process for your guest had). It also prevents the number of log > files from growing unbounded. > > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>I''ve just seen that this patch having been included in 15212:fc8e40692690 was then effectively reverted in 15219:f45c84dd5f41 by switching QEMU to use Domain ID in log files. This causes just as much pain for support purposes as the original naming based on PID. Now when a user reports problems with domain ''foo'' crashing, instead of just asking them to send /var/log/xen/qemu-foo.log we''re back to having users to dig around in /var/log/xen/xend.log to try and figure out what domain ID their guest was running with before it crashed and then find the qemu-[DOMAIN ID].log file that matches. changeset: 15219:f45c84dd5f41 user: kfraser@localhost.localdomain date: Tue Jun 05 09:59:34 2007 +0100 files: tools/ioemu/vl.c description: qemu: Use domid in qemu log name. Can be related back to domain name or uuid via xend logs, less unique than pids to prevent excessive number of log files hanging around, yet not immediately reused (unlike e.g., after domain crash or reboot) where previous log file is immediately overwritten. Not using domain names in logs avoids and chance of unprintable charcatres becoming embedded in filenames. Signed-off-by: Keir Fraser <keir@xensource.com> All domain names should be validated by XenD to contain printable characters only - they are displayed & used all over the place in numerous tools where having non-printale characters will cause plenty of trouble. As for overwriting the log file with a domain autorestart after a crash, the logfile ought to be opened in append mode (w+ instead of w) - logrotate scripts can handle cleanup of logfiles I am happy to submit further patches to validate domain names in XenD and switch to opening the file in append mode, if changeset 15219 were to be reverted. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mark Williamson
2007-Jun-12 15:44 UTC
Re: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
> This causes just as much pain for support purposes as the original naming > based on PID. Now when a user reports problems with domain ''foo'' crashing, > instead of just asking them to send /var/log/xen/qemu-foo.log we''re back to > having users to dig around in /var/log/xen/xend.log to try and figure out > what domain ID their guest was running with before it crashed and then > find the qemu-[DOMAIN ID].log file that matches.+1 to that> As for overwriting the log file with a domain autorestart after a crash, > the logfile ought to be opened in append mode (w+ instead of w) - logrotate > scripts can handle cleanup of logfilesOr just rename on restart e.g. mydomain.log -> mydomain.log.old or mydomain.log.1 etc.> I am happy to submit further patches to validate domain names in XenD and > switch to opening the file in append mode, if changeset 15219 were to be > reverted.I think this is a better solution for users, plus I''d find it handy during debugging. Sure, I''m more than qualified to poke in the xend.log file to figure out the domain ID, but it''d be nice to not need to bother. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Jun-12 16:04 UTC
Re: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
On 12/6/07 15:59, "Daniel P. Berrange" <berrange@redhat.com> wrote:> All domain names should be validated by XenD to contain printable characters > only - they are displayed & used all over the place in numerous tools where > having non-printale characters will cause plenty of trouble. > > As for overwriting the log file with a domain autorestart after a crash, the > logfile ought to be opened in append mode (w+ instead of w) - logrotate > scripts can handle cleanup of logfiles > > I am happy to submit further patches to validate domain names in XenD and > switch to opening the file in append mode, if changeset 15219 were to be > reverted.Personally I don''t much care either way. Christian didn''t like the names in log filenames, and he maintains the qemu patchset. :-) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Jun-12 16:36 UTC
Re: [Xen-devel] PATCH: Use name instead of pid in QEMU logs
On 12/6/07 17:04, "Keir Fraser" <Keir.Fraser@cl.cam.ac.uk> wrote:>> I am happy to submit further patches to validate domain names in XenD and >> switch to opening the file in append mode, if changeset 15219 were to be >> reverted. > > Personally I don''t much care either way. Christian didn''t like the names in > log filenames, and he maintains the qemu patchset. :-)I''ll elaborate a bit: imo the qemu logs are second only to xend-debug.log for uselessness, particularly for ordinary users. I would support sending the few lines of output that usually get written there to /dev/null instead by default. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Apparently Analagous Threads
- Writing a tool for Shared Persistent Windows Boot Image
- Writing a tool for Shared Persistent Windows Boot Image
- [PATCH]Add free memory size of every NUMA node in phsical info
- [PATCH][VNC Auth] Fix qemu-dm becomes defunct when rebooting hvm domain
- 2.6.20-1-amd64 Xen with RHEL5 guest