From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCDRE-0004Qv-H9 for qemu-devel@nongnu.org; Tue, 29 Jul 2014 15:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCDR8-0003hC-OE for qemu-devel@nongnu.org; Tue, 29 Jul 2014 15:51:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCDR8-0003h8-FX for qemu-devel@nongnu.org; Tue, 29 Jul 2014 15:51:50 -0400 Message-ID: <53D7FB52.3080801@redhat.com> Date: Tue, 29 Jul 2014 13:51:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <201407251442088727201@sangfor.com>, <874my5hh4s.fsf@linaro.org>, <201407251907132706648@sangfor.com>, <53D25991.3010001@suse.de> <201407261028057289331@sangfor.com> In-Reply-To: <201407261028057289331@sangfor.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lgdHjvk3h0v0N1XmT6AfR5H70v7q22A2a" Subject: Re: [Qemu-devel] [questions] about qemu log List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhang Haoyu , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lgdHjvk3h0v0N1XmT6AfR5H70v7q22A2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/25/2014 08:28 PM, Zhang Haoyu wrote: >> In a shell you would write something like: >> >> 2> stderr.log >> >> You may also want to toggle QEMU's -msg timestamp=3Don option. >> > I think the "-msg -msg timestamp=3Don" option will add timestamp to the= output of error_report(fmt, ...), > but where is the output? Which file saves the output? The output is on qemu's stderr. You are in control of what that stderr i= s. > And where is the output of fprintf(stderr, fmt, ...)? Also on stderr. > Should I redirect of stderr to specified log file? Yes, if you want that output going to a specified file. >=20 > In libvirt code, when start a vm(qemuProcessStart), it will create a qe= mu log file named /var/log/libvirt/qemu/vmname.log, > and redirect the stderr and stdout to file descriptor of this qemu log = file. >=20 > But if I run a vm directly by qemu command, bypass libvirt, then how to= configure qemu to assure that each vm has its own log file, > and how to redirect the stderr, stdout to each vm's own log file? If you are going to bypass libvirt, then you have to do your own shell redirections (as mentioned above) to ensure that file descriptor 2 as inherited by qemu is whatever file you want errors logged in. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lgdHjvk3h0v0N1XmT6AfR5H70v7q22A2a Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT1/tSAAoJEKeha0olJ0NqMGkIAIH2JvRcCwYBUkTEd4S7oP1n +agxWFFAhtSaTMkFfWdXcUAHghM6u3JA2OvtCGL++/qbAHo41OftMppp5YWSNXFQ iv2fD9BlrWNc6HEfLk2opu2yxD5JWdGwgd2Wo5Pmdt7iSeIJvMNcqki5dqi8SDOV SFNnjZAGX8lgc18elxKVMqwQEMKAP4239bKyZnjHmnpXc8VndVHRVLduG6WhcglO 1F6kZGeKrWi/B3DvL5nTOay51S5VoQ2GBFquUVR2UAUSWF9G4NZkuoi4QT0oAO3u tOhVQssLxjklGNyIZesWranQ2otmwNC5cXcEf9ns8PKwpq5yeUPurkVlAIyDAz4= =/IMv -----END PGP SIGNATURE----- --lgdHjvk3h0v0N1XmT6AfR5H70v7q22A2a--