From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQbu0-0001Mo-JZ for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQbtx-0006Lf-CU for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:25:56 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:38581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQbtx-0006LV-5B for qemu-devel@nongnu.org; Tue, 02 Feb 2016 09:25:53 -0500 Received: by mail-wm0-x22c.google.com with SMTP id p63so25327279wmp.1 for ; Tue, 02 Feb 2016 06:25:53 -0800 (PST) Sender: Paolo Bonzini References: <1453816041-36362-1-git-send-email-pbonzini@redhat.com> <1453816041-36362-15-git-send-email-pbonzini@redhat.com> <56B0B6E6.9000306@de.ibm.com> From: Paolo Bonzini Message-ID: <56B0BC6E.4080009@redhat.com> Date: Tue, 2 Feb 2016 15:25:50 +0100 MIME-Version: 1.0 In-Reply-To: <56B0B6E6.9000306@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 14/49] scripts/kvm/kvm_stat: Improve debugfs access checking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger , qemu-devel@nongnu.org Cc: Janosch Frank On 02/02/2016 15:02, Christian Borntraeger wrote: >> > -if not os.access('/sys/kernel/debug', os.F_OK): >> > - print 'Please enable CONFIG_DEBUG_FS in your kernel' >> > +if not os.path.exists('/sys/kernel/debug'): >> > + sys.stderr.write('Please enable CONFIG_DEBUG_FS in your kernel.') >> > sys.exit(1) >> > -if not os.access(PATH_DEBUGFS_KVM, os.F_OK): >> > - print "Please mount debugfs ('mount -t debugfs debugfs /sys/kernel/debug')" >> > - print "and ensure the kvm modules are loaded" >> > +if not os.path.exists(PATH_DEBUGFS_KVM): >> > + sys.stderr.write("Please make sure, that debugfs is mounted and " >> > + "readable by the current user:\n" >> > + "('mount -t debugfs debugfs /sys/kernel/debug')\n" >> > + "Also ensure, that the kvm modules are loaded.\n") >> > + sys.exit(1) >> > +if not os.path.exists(PATH_DEBUGFS_TRACING): >> > + sys.stderr.write("Please make {0} readable by the current user.\n" >> > + .format(PATH_DEBUGFS_TRACING)) >> > sys.exit(1) > > Hmmm, this now bails out on kernels without CONFIG_TRACING. It could still fall > back to the normal kvm_stat values. What about just removing the last sys.exit(1) > and make this a warning that stays for a second or so? Good idea. Can you send a patch? Paolo