From patchwork Thu Apr 21 17:19:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 66398 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp273956qge; Thu, 21 Apr 2016 10:22:49 -0700 (PDT) X-Received: by 10.194.227.1 with SMTP id rw1mr15503674wjc.62.1461259369452; Thu, 21 Apr 2016 10:22:49 -0700 (PDT) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id c5si4058834wjm.164.2016.04.21.10.22.48 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Apr 2016 10:22:49 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3LHJu4R024941; Thu, 21 Apr 2016 13:19:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3LHJtmP013253 for ; Thu, 21 Apr 2016 13:19:55 -0400 Received: from [10.3.113.44] (ovpn-113-44.phx2.redhat.com [10.3.113.44]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3LHJs1Y032533 for ; Thu, 21 Apr 2016 13:19:55 -0400 To: libvirt-list@redhat.com References: From: Cole Robinson Message-ID: <57190BBA.4050507@redhat.com> Date: Thu, 21 Apr 2016 13:19:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: Re: [libvirt] [PATCH v2] virconf: Handle conf file without ending newline X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com On 04/21/2016 11:15 AM, Cole Robinson wrote: > $ echo -n 'log_level=1' > ~/.config/libvirt/libvirtd.conf > $ libvirtd --timeout=10 > 2014-10-10 10:30:56.394+0000: 6626: info : libvirt version: 1.1.3.6, package: 1.fc20 (Fedora Project, 2014-09-08-17:50:42, buildvm-05.phx2.fedoraproject.org) > 2014-10-10 10:30:56.394+0000: 6626: error : main:1261 : Can't load config file: configuration file syntax error: /home/rjones/.config/libvirt/libvirtd.conf:1: expecting a value: /home/rjones/.config/libvirt/libvirtd.conf > > Rather than try to fix this in the depths of the parser, just catch > the case when a config file doesn't end in a newline, and manually > append a newline to the content before parsing > > https://bugzilla.redhat.com/show_bug.cgi?id=1151409 > --- > v2: > Properly NULL deliminate string (thanks pkrempa) > Hey, there's a virconf test suite. Add a new test case > Also needs this diff to fix syntax-check: _src2=src/(util/vircommand|libvirt|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon) exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ - Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/cfg.mk b/cfg.mk index 16da2b3..09ff9fa 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1179,7 +1179,7 @@ exclude_file_name_regexp--sc_prohibit_close = \ (\.p[yl]$$|\.spec\.in$$|^docs/|^(src/util/virfile\.c|src/libvirt-stream\.c|tests/vir.+mock\.c)$$) exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ - (^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.diff$$) + (^tests/(qemuhelp|nodeinfo|virpcitest)data/|\.diff|tests/confdata/no-newline\.conf$$)