Received: from eggs.gnu.org ([2001:4830:134:3::10]:39870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9ApW-0005W9-QZ for qemu-devel@nongnu.org; Tue, 22 Nov 2016 08:09:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9ApT-0001tV-MG for qemu-devel@nongnu.org; Tue, 22 Nov 2016 08:09:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41968) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c9ApT-0001sT-FE for qemu-devel@nongnu.org; Tue, 22 Nov 2016 08:09:43 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 7C57CC0798F1 for ; Tue, 22 Nov 2016 13:09:42 +0000 (UTC) Date: Tue, 22 Nov 2016 11:09:40 -0200 From: Eduardo Habkost Message-ID: <20161122130940.GB21830@thinpad.lan.raisama.net> References: <1479777133-23567-1-git-send-email-ehabkost@redhat.com> <80ff3d9b-5a3a-f064-c72b-0152e18d6ef3@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80ff3d9b-5a3a-f064-c72b-0152e18d6ef3@redhat.com> Subject: Re: [Qemu-devel] [RFC 00/15] qmp: Report supported device types on 'query-machines' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand Cc: qemu-devel@nongnu.org, Markus Armbruster , Marcel Apfelbaum , "Michael S. Tsirkin" , libvir-list@redhat.com, Laine Stump On Tue, Nov 22, 2016 at 09:18:21AM +0100, David Hildenbrand wrote: > > > > > Considered alternatives > > ======================= > > > > Indirect mapping (machine => bus => device) > > ------------------------------------------- > > > > This RFC implements a mechanism to implement ax > > machine-type => supported-device-types > > mapping. An alternative solution I considered was to expose an > > indirect mapping: > > machine-type => default-bus-types > > followed by > > bus-type => supported-device-types. > > > > But exposing only the resulting supported device-types list > > imposes less restrictions on how the device and bus type > > hierarchy is implemented inside QEMU. There's still a > > machine-type => bus-type => device-type > > mapping implemented internally, but it is an implementation > > detail on the current version, and not part of the > > externally-visible interface. > > > > The Implementation > > ================== > > > > This add a new field to MachineClass: default_bus_types, and a > > new field to BusClass: supported_device_type. > > Is it possible to modify a machine (setting some properties e.g. on the > command line), that suddenly more devices are supported? Something like > enabling an additional bus? (I assume so, because it is called "default > bus types" :) ) Yes. See the "Out of scope: Configurable buses" section on the cover letter. > > If so, the indirect mapping could be of more benefit in the long run. Yes, a new mapping may be necessary to find out which options (e.g. "usb=on") or device-types (e.g. "-device isa-fdc", "-device piix3-usb-uhci") will add new buses and make new device-types supported by the machine. But this will probably require new QMP commands, and I still want to keep the default case simple. > > Thinking about my machine at home: > > I just care about the available buses. If my machine doesn't have USB, > but PCI, I can buy a USB PCI card and make it support USB. Then I can > happily plug in USB devices. So the "default" state might at least > no longer be sufficient when wanting to plug in a USB fan on a hot > summer day ;) . > > But, with the indirect mapping, I guess we would need yet another qmp > command ... > > -- > > David -- Eduardo