Received: from eggs.gnu.org ([2001:4830:134:3::10]:44968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzps-0000ZK-L1 for qemu-devel@nongnu.org; Thu, 23 Jun 2016 04:18:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFzpm-0005XP-Ue for qemu-devel@nongnu.org; Thu, 23 Jun 2016 04:18:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzpm-0005W3-OL for qemu-devel@nongnu.org; Thu, 23 Jun 2016 04:17:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 5A63E804E1 for ; Thu, 23 Jun 2016 08:17:57 +0000 (UTC) From: Markus Armbruster References: <1466437983-27133-1-git-send-email-ehabkost@redhat.com> <1466437983-27133-8-git-send-email-ehabkost@redhat.com> Date: Thu, 23 Jun 2016 10:17:55 +0200 In-Reply-To: <1466437983-27133-8-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Mon, 20 Jun 2016 12:53:00 -0300") Message-ID: <87k2hg5nf0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain 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: Eduardo Habkost Cc: qemu-devel@nongnu.org, Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov 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". > 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? [...]