Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD6E9A45 for ; Wed, 13 Sep 2023 06:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aaBGevgYf5+h1gRgFJy+bDU2X45snfeB/tGZ3BVEl7g=; b=Eq5t5X1j+5HTlyqoIhjpNAgmEJ SMcc8bPdZziM5hbyp36KRiF3yQkqACWYeCywuFpGLKvthc/Z+15fxqp04anwXqYcLSP/ZXuFzZrI9 F3ZSKVdKQ3sW59pPf3THa0XYU+Izfp7Uggn/JRXj/2W6TiB8EIITgfHc+0JuyqWJlb++vYWCtumyU LNk4mkgPoANky5LqvUL+phfzbe4LJZ25S/9rAi9pK4PFlbzE+uOzZBx7cYVxCeg/NwmSCD5MaktSr JRAPISrQAzanLtUdLdgqyrdvYXaY10dT6ba/sVHnT7S/eem5R2LLwe6VzRLMP53q3rVGxNTCPwJB0 PeXoSs8Q==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qgJ2G-004kx2-08; Wed, 13 Sep 2023 06:07:36 +0000 Date: Tue, 12 Sep 2023 23:07:36 -0700 From: Luis Chamberlain To: Ross Vandegrift Cc: kdevops@lists.linux.dev Subject: Re: [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Message-ID: References: <20230913043512.6083-1-ross@kallisti.us> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913043512.6083-1-ross@kallisti.us> Sender: Luis Chamberlain On Tue, Sep 12, 2023 at 09:35:11PM -0700, Ross Vandegrift wrote: > Vagrant arm64 will require a handful of new libvirt parameters. Most are > architecture independent. But they're currently unnecessary because > libvirt/qemu has defaults are tailored for x86-64. > > This adds support for the following, along with reasonable defaults for x86-64: > - graphics type > - mouse bus > - uefi loader & nvram storage > > Signed-off-by: Ross Vandegrift > --- > Thanks for the feedback on the previous version. I opted to keep the > arch-independant options separate - since I'd already setup so much of it, this > ended up being less work. As before, everything though make bringup works. > > --- > playbooks/roles/gen_nodes/defaults/main.yml | 4 ++ > .../roles/gen_nodes/templates/Vagrantfile.j2 | 7 +++ > scripts/gen-nodes.Makefile | 15 +++++++ > vagrant/Kconfig | 43 +++++++++++++++++++ > 4 files changed, 69 insertions(+) > > diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml > index c57effe7..d44ba8bb 100644 > --- a/playbooks/roles/gen_nodes/defaults/main.yml > +++ b/playbooks/roles/gen_nodes/defaults/main.yml > @@ -60,6 +60,10 @@ libvirt_extra_storage_aio_cache_mode: "none" > libvirt_extra_storage_nvme_logical_block_size: 512 > libvirt_extra_storage_virtio_logical_block_size: 512 > libvirt_extra_storage_virtio_physical_block_size: 512 > +libvirt_graphics_type: none This alone should be its own patch as it is a functional change and it makes the graphics type switch to none as defualt. That is welcomed. > +libvirt_input_mouse_bus: ps2 > +libvirt_loader: "" You want a default: libvirt_loader_enable: False > +libvirt_nvram_dir: /var/lib/libvirt/qemu/nvram Then this can be a default Kconfig string. What you do then is create a Kconfig choise and make the deafult for different architectures. But I'll explain more below. > > libvirt_largeio_enable: False > libvirt_largeio_logical_compat: False > diff --git a/playbooks/roles/gen_nodes/templates/Vagrantfile.j2 b/playbooks/roles/gen_nodes/templates/Vagrantfile.j2 > index 7ed59ff7..0d20ed6d 100644 > --- a/playbooks/roles/gen_nodes/templates/Vagrantfile.j2 > +++ b/playbooks/roles/gen_nodes/templates/Vagrantfile.j2 > @@ -229,6 +229,13 @@ Vagrant.configure("2") do |config| > libvirt.machine_type = global_data['libvirt_cfg']['machine_type'] > end > end > + libvirt.graphics_type = '{{ libvirt_graphics_type }}' > + libvirt.input :type => "mouse", :bus => "{{ libvirt_input_mouse_bus }}" This seems fine. > +{% if libvirt_loader %} Here you'd use the libvirt_loader_enable instead of libvirt_loader so to be very precise about a boolean. > + libvirt.loader = "{{ libvirt_loader }}" > + libvirt.nvram = "{{ libvirt_nvram_dir }}/%s.fd" % host_name > +{% endif %} > + > # Add an extra spare PCI or PCI-E root bus to be used for extra drives. > # > # We use a dedicated PCI or PCI-E root bus to not clash with defaults > diff --git a/scripts/gen-nodes.Makefile b/scripts/gen-nodes.Makefile > index 533b19db..9c1f1e09 100644 > --- a/scripts/gen-nodes.Makefile > +++ b/scripts/gen-nodes.Makefile > @@ -203,4 +203,19 @@ endif # CONFIG_QEMU_ENABLE_CXL > > endif # CONFIG_LIBVIRT_MACHINE_TYPE_Q35 > > +ifneq (,$(CONFIG_LIBVIRT_GRAPHICS_TYPE)) > +GEN_NODES_EXTRA_ARGS += libvirt_graphics_type='$(subst ",,$(CONFIG_LIBVIRT_GRAPHICS_TYPE))' > +endif > + > +ifeq (y,$(CONFIG_LIBVIRT_INPUT_PS2_MOUSE)) > +GEN_NODES_EXTRA_ARGS += libvirt_input_mouse_bus='ps2' > +else ifeq (y, $(CONFIG_LIBVIRT_INPUT_VIRTIO_MOUSE)) > +GEN_NODES_EXTRA_ARGS += libvirt_input_mouse_bus='virtio' > +endif > + > +ifneq (,$(CONFIG_LIBVIRT_LOADER)) > +GEN_NODES_EXTRA_ARGS += libvirt_loader='$(subst ",,$(CONFIG_LIBVIRT_LOADER))' > +GEN_NODES_EXTRA_ARGS += libvirt_nvram_dir='$(subst ",,$(CONFIG_LIBVIRT_NVRAM_DIR))' > +endif You replace most of this with just Kconfig language, the only thing you'd need is a conversion to True for the libvirt_loader_enable. Then in the future, once we get support to make kconfig spit out extra_vars.yaml for us from .config input source we can remove those Makefile hacks. This let's us scale better. Luis