Received: from eggs.gnu.org ([2001:4830:134:3::10]:48300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG3Sy-0007lY-MZ for qemu-devel@nongnu.org; Thu, 23 Jun 2016 08:10:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG3Sr-00057L-Et for qemu-devel@nongnu.org; Thu, 23 Jun 2016 08:10:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG3Sr-00057H-8n for qemu-devel@nongnu.org; Thu, 23 Jun 2016 08:10:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4F5BD4788 for ; Thu, 23 Jun 2016 12:10:32 +0000 (UTC) Date: Thu, 23 Jun 2016 09:10:31 -0300 From: Eduardo Habkost Message-ID: <20160623121031.GX2048@thinpad.lan.raisama.net> References: <1466437983-27133-1-git-send-email-ehabkost@redhat.com> <1466437983-27133-8-git-send-email-ehabkost@redhat.com> <87k2hg5nf0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k2hg5nf0.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v2 07/10] qdev: Eliminate "global not used" warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov On Thu, Jun 23, 2016 at 10:17:55AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > qdev_prop_check_globals() tries to warn the user if a given > > -global option was not used. But it does that only if the device > > is not hotpluggable. > > Because then the option will never be used. > > > The warning also makes it harder for management code or people > > that write their own scripts or config files: there's no way to > > know if a given -global option will trigger a warning or not, > > because we don't have any introspection mechanism to check if a > > machine-type instantiates a given device or not. > > Well, there is: create the machine, look for the device. I guess what > you're trying to say is that there's no way to *predict* what a machine > type will instantiate, at least not until after the fact. > > Suggest "will instantiate a given device". I would fix it, but I will drop the patch from the series instead (see below). > > > The warning is also the only reason we have the 'user_provided' > > and 'used' fields in struct GlobalProperty. Removing the check > > will let us simplify the code. > > > > In other words, the warning is nearly useless and gets in our way > > and our users' way. Remove it. > > Well, telling me that I gave a non-sensical option isn't always useless. > I might have fat-fingered something, or be confused about my devices. > > Say I give -global PIIX4_PM.disable_s3=1. Does what I want with an > i440FX machine type. Except it does nothing with -no-acpi or with a Q35 > machine type. The former is harmless enough, but the latter is a > mistake; I need to say -global ICH9-LPC.disable_s3=1. Before this > patch, I get a warning in either case. > > Is this warning really useless? Not entirely useless. But I was giving more importance to code simplicity than to the detection of those mistakes. But the extra fields and extra code don't bother me so much. I will drop patches 07/10 and 08/10 from the series. -- Eduardo