From patchwork Fri Jan 15 15:58:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8042841 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A86DC9F6FA for ; Fri, 15 Jan 2016 15:58:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 175B220390 for ; Fri, 15 Jan 2016 15:58:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5755320386 for ; Fri, 15 Jan 2016 15:58:52 +0000 (UTC) Received: from localhost ([::1]:47749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6m3-0005IP-Jw for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 10:58:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6lv-0005G5-33 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:58:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK6lq-0001uG-0W for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:58:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6lp-0001uC-RR for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:58:37 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 9930B8E221 for ; Fri, 15 Jan 2016 15:58:36 +0000 (UTC) Received: from [10.36.112.70] (ovpn-112-70.ams2.redhat.com [10.36.112.70]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0FFwW7q011539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jan 2016 10:58:34 -0500 To: "Daniel P. Berrange" , Eric Blake References: <1452516281-27519-1-git-send-email-berrange@redhat.com> <56986FEF.1040307@redhat.com> <20160115091502.GA2863@redhat.com> From: Paolo Bonzini Message-ID: <56991727.5040901@redhat.com> Date: Fri, 15 Jan 2016 16:58:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160115091502.GA2863@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, Markus Armbruster Subject: Re: [Qemu-devel] [PATCH v4] qemu-char: add logfile facility to all chardev backends X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 15/01/2016 10:15, Daniel P. Berrange wrote: > On Thu, Jan 14, 2016 at 09:05:03PM -0700, Eric Blake wrote: >> On 01/11/2016 05:44 AM, Daniel P. Berrange wrote: >>> Typically a UNIX guest OS will log boot messages to a serial >>> port in addition to any graphical console. An admin user >>> may also wish to use the serial port for an interactive >>> console. A virtualization management system may wish to >>> collect system boot messages by logging the serial port, >>> but also wish to allow admins interactive access. >>> >> >>> This patch introduces a 'ChardevCommon' struct which >>> is setup as a base for all the ChardevBackend types. >>> Ideally this would be registered directly as a base >>> against ChardevBackend, rather than each type, but >>> the QAPI generator doesn't allow that since the >>> ChardevBackend is a non-discriminated union. The >>> ChardevCommon struct provides the optional 'logfile' >>> parameter, as well as 'logappend' which controls >>> whether QEMU truncates or appends (default truncate). >>> >>> Signed-off-by: Daniel P. Berrange This patch fails make check, due to a segmentation fault that can be reproduced with "x86_64-softmmu/qemu-system-x86_64 -serial null". I'm squashing in the fix: Paolo diff --git a/qemu-char.c b/qemu-char.c index 02b0318..11caa56 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3827,7 +3827,12 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts, error_propagate(errp, local_err); goto qapi_out; } + } else { + ChardevCommon *cc = g_new0(ChardevCommon, 1); + qemu_chr_parse_common(opts, cc); + backend->u.data = cc; } + ret = qmp_chardev_add(bid ? bid : id, backend, errp); if (!ret) { goto qapi_out;