xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Question: Redirect guest kernel's message via serial port to a file on dom0
Date: Tue, 25 Aug 2015 08:42:56 +0100	[thread overview]
Message-ID: <55DC1C80.8070809@citrix.com> (raw)
In-Reply-To: <CAENZ-+n0V8ztXdWNDfJJvXkvFH-_zeGL-Gukv0hFHt2HTEVWpw@mail.gmail.com>

On 25/08/2015 03:48, Meng Xu wrote:
> Hi Andrew,
>
> Thank you so much for your suggestion! I tried but have some questions.
>
> 2015-08-24 4:10 GMT-04:00 Andrew Cooper <andrew.cooper3@citrix.com>:
>> On 24/08/2015 04:01, Meng Xu wrote:
>>
>> Hi,
>>
>> I'm trying to use a PV guest VM on Xen to help debug Linux.
>> I was using VirtualBox to help debug Linux kernel by redirecting the output of the serial port of the VM to a file in the host. I can do it in VirtualBox.
>>
>> [Why do I want to achieve this?]
>> It is much faster to reboot a VM than rebooting the physical machine.
>> I don't need another machine to physically connect to the serial port of the development machine.
>> I want to use Xen for as many things as possible. ;-)
>>
>> I tried to google a tutorial or manual about how to configure it, but didn't find any. :-(
>>
>> In my understanding, I need to do the following things:
>> 1) I need to add a line (something like "serial=") in the guest's configuration file to specify the serial port device to the VM;
>> 2) I need some configuration to redirect the output of the serial device to a file in domU;
>> 3) After that, I can configure the kernel command line in the VM to dump the kernel message via the serial port of the VM. (I know how to do this step.)
>>
>> Did anyone have tried this before and have some configuration I can refer to? or
>> Could anyone give me some references that describes how to configure the above three steps?
>>
>> I really appreciate any help or suggestion or comment.
>>
>>
>> Configure xenconsoled to log guest consoles to file "--log=guest" at which point anything sent to hvc0 will be logged to files in /var/log/xen/guest/console (configurable with "--log-dir=")
>
> I set "XENCONSOLED_TRACE=guest" under /etc/default/xencommons ,
> because in /etc/init.d/xencommons, it has: test -z
> "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
>
> So I think this is what you mean by "--log=guest"; After I set this
> variable and restart the xencommons by "service xencommons restart" on
> dom0 (Ubuntu 12.04LTS), I still couldn't find the file in
> /var/log/xen/guest/console when I reboot the VM.
> Actually, "find /var -name console" returns no result.
>
> **My question is:**
> Is there anything else I need to configure to get the
> /var/log/xen/guest/console?
>
> I don't see the folder under /var/log/xen. :-(

You probably need to mkdir it then, or extend the args list with
--log-dir=/var/log/xen

~Andrew

  reply	other threads:[~2015-08-25  7:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  3:01 Question: Redirect guest kernel's message via serial port to a file on dom0 Meng Xu
2015-08-24  8:10 ` Andrew Cooper
2015-08-25  2:48   ` Meng Xu
2015-08-25  7:42     ` Andrew Cooper [this message]
2015-08-25 13:04       ` Meng Xu
2015-09-01 10:52         ` Ian Campbell
2015-09-01 15:15           ` Meng Xu
2015-09-01 15:26             ` Ian Campbell
2015-09-01 15:47               ` Meng Xu
2015-09-01 16:01                 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DC1C80.8070809@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xumengpanda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).