Received: from ravenhurst.kallisti.us (ravenhurst.kallisti.us [69.164.210.145]) (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 CCC33A45 for ; Wed, 13 Sep 2023 06:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kallisti.us ; s=20220106; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Pz1CnPEFB+VPEN2RfCxFDP1DYw8q5bYsmgRj7hUAEb8=; b=eCvivVQgtwWdvpvb/+Ow5P7GFN stouEYJV2yquYmlV+Jwh0icfRX0ANvknYeX9uMvathAmA96HCbpMKRGw0HmVmXgCqACzdbBiFd2ST 5TUf1MR9nKtnkl9rlne6fzgUdfa7OM7hLdYDRd+6wG1Cp5kgk/ba2uOxz+dXRv7PHE3H4vtBdsdET fs82xmmePSgj/AtS1zQgdJGVgLVrLyPu6dBr2fZNmGzpNm/x4oKOiVwhVStAyA9tqvKCWObPnXUii sadMvjRQ3zryAO5Wu1CkvRpKEtnkKHLYohRbEN6EHi7Z1T5efAaWValwSSFhF2kUN/X2sQ9UCrdT3 v1WP5aSw==; Received: from [50.52.114.95] (helo=localhost) by ravenhurst.kallisti.us with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qgIXF-00Atji-9O; Wed, 13 Sep 2023 01:35:33 -0400 From: Ross Vandegrift To: mcgrof@kernel.org Cc: kdevops@lists.linux.dev, Ross Vandegrift Subject: [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Date: Tue, 12 Sep 2023 21:35:11 -0700 Message-Id: <20230913043512.6083-1-ross@kallisti.us> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 +libvirt_input_mouse_bus: ps2 +libvirt_loader: "" +libvirt_nvram_dir: /var/lib/libvirt/qemu/nvram 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 }}" +{% if libvirt_loader %} + 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 + ANSIBLE_EXTRA_ARGS += $(GEN_NODES_EXTRA_ARGS) diff --git a/vagrant/Kconfig b/vagrant/Kconfig index 4927012a..e9e8b3d9 100644 --- a/vagrant/Kconfig +++ b/vagrant/Kconfig @@ -241,6 +241,49 @@ config LIBVIRT_HOST_PASSTHROUGH --pre 'make -s mrproper defconfig' \ \-- make -s -j$(nproc) bzImage +config LIBVIRT_GRAPHICS_TYPE + string "Graphics type" + default "none" + help + Sets the protocol used to expose the guest display. Possible values + are `sdl`, `curses`, `none`, `gtk`, `vnc` or `spice`. + +choice + prompt "Libvirt input config" + default LIBVIRT_INPUT_PS2_MOUSE if TARGET_ARCH_X86_64 + +config LIBVIRT_INPUT_PS2_MOUSE + bool "PS/2 mouse" + depends on TARGET_ARCH_X86_64 + help + Use an emulated PS/2 bouse for input. Default for X86_64, and + probably can't work on any other architectures. + +config LIBVIRT_INPUT_VIRTIO_MOUSE + bool "Virtio mouse" + help + Use a virtio mouse for input. Should work on any architecture. + +endchoice + +config LIBVIRT_LOADER + string "Path to a custom UEFI loader." + default "" + help + On some architectures, qemu may not automatically load the UEFI + firmware from the correct location. Set this variable to help it out. + + You may need to install the OVMF packages for your architecture. On + Debian ARM64, that's qemu-efi-aarch64. + +config LIBVIRT_NVRAM_DIR + string "Path to storage for UEFI NVRAM." + default "" + help + Some architectures may require storage on the host for UEFI NVRAM. + This will take 64MiB per guest. The default directory is + /var/lib/libvirt/qemu/nvram/. + config QEMU_BUILD bool "Should we build QEMU for you?" select NEEDS_LOCAL_DEVELOPMENT_PATH -- 2.39.2