kdevops.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options
@ 2023-09-13  4:35 Ross Vandegrift
  2023-09-13  4:35 ` [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64 Ross Vandegrift
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ross Vandegrift @ 2023-09-13  4:35 UTC (permalink / raw)
  To: mcgrof; +Cc: kdevops, Ross Vandegrift

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 <ross@kallisti.us>
---
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64
  2023-09-13  4:35 [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Ross Vandegrift
@ 2023-09-13  4:35 ` Ross Vandegrift
  2023-09-13  6:36   ` Luis Chamberlain
  2023-09-13  4:35 ` [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images Ross Vandegrift
  2023-09-13  6:07 ` [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Luis Chamberlain
  2 siblings, 1 reply; 6+ messages in thread
From: Ross Vandegrift @ 2023-09-13  4:35 UTC (permalink / raw)
  To: mcgrof; +Cc: kdevops, Ross Vandegrift

This adds new Kconfig options to support arm64 kdevops guests under vagrant +
libvirt.  They are plumbed through to ansible, and make bringup works.

To test with this change, you need a local arm64 vagrant image.  Debian's cloud
images support building them, but they aren't published yet.  openSUSE defaults
will be added next.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
---
 kconfigs/Kconfig.bringup                      |  2 +-
 playbooks/roles/gen_nodes/defaults/main.yml   |  2 +
 .../roles/gen_nodes/templates/Vagrantfile.j2  |  3 ++
 scripts/gen-nodes.Makefile                    | 13 ++++++
 vagrant/Kconfig                               | 43 +++++++++++++++++--
 5 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/kconfigs/Kconfig.bringup b/kconfigs/Kconfig.bringup
index 1eaa2c99..d559a877 100644
--- a/kconfigs/Kconfig.bringup
+++ b/kconfigs/Kconfig.bringup
@@ -5,7 +5,7 @@ choice
 config VAGRANT
 	bool "Vagrant for local virtualization (KVM / VirtualBox)"
 	select KDEVOPS_SSH_CONFIG_UPDATE_STRICT
-	depends on TARGET_ARCH_X86_64
+	depends on TARGET_ARCH_X86_64 || TARGET_ARCH_ARM64
 	help
 	  This option will enable use of Vagrant. Enable this if you want to
 	  use local virtualization technologies such as KVM with libvirt or
diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index d44ba8bb..8e8efcb7 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -64,6 +64,8 @@ libvirt_graphics_type: none
 libvirt_input_mouse_bus: ps2
 libvirt_loader: ""
 libvirt_nvram_dir: /var/lib/libvirt/qemu/nvram
+libvirt_arm64_enable: False
+libvirt_arm64_gic_version: "3"
 
 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 0d20ed6d..43b2c030 100644
--- a/playbooks/roles/gen_nodes/templates/Vagrantfile.j2
+++ b/playbooks/roles/gen_nodes/templates/Vagrantfile.j2
@@ -235,6 +235,9 @@ Vagrant.configure("2") do |config|
         libvirt.loader = "{{ libvirt_loader }}"
         libvirt.nvram = "{{ libvirt_nvram_dir }}/%s.fd" % host_name
 {% endif %}
+{% if libvirt_arm64_enable %}
+        libvirt.features = ["acpi", "gic version='{{ libvirt_arm64_gic_version }}'"]
+{% endif %}
 
         # Add an extra spare PCI or PCI-E root bus to be used for extra drives.
         #
diff --git a/scripts/gen-nodes.Makefile b/scripts/gen-nodes.Makefile
index 9c1f1e09..43aa7b76 100644
--- a/scripts/gen-nodes.Makefile
+++ b/scripts/gen-nodes.Makefile
@@ -218,4 +218,17 @@ GEN_NODES_EXTRA_ARGS += libvirt_loader='$(subst ",,$(CONFIG_LIBVIRT_LOADER))'
 GEN_NODES_EXTRA_ARGS += libvirt_nvram_dir='$(subst ",,$(CONFIG_LIBVIRT_NVRAM_DIR))'
 endif
 
+ifeq (y,$(CONFIG_LIBVIRT_MACHINE_TYPE_VIRT))
+GEN_NODES_EXTRA_ARGS += libvirt_override_machine_type='True'
+GEN_NODES_EXTRA_ARGS += libvirt_machine_type='virt'
+endif
+
+ifneq (,$(CONFIG_LIBVIRT_ARM64_ENABLED))
+GEN_NODES_EXTRA_ARGS += libvirt_arm64_enabled='True'
+endif
+
+ifneq (,$(CONFIG_LIBVIRT_FEATURE_ARM64_GIC_VERSION))
+GEN_NODES_EXTRA_ARGS += libvirt_arm64_gic_version='$(subst ",,$(CONFIG_LIBVIRT_FEATURE_ARM64_GIC_VERSION))'
+endif
+
 ANSIBLE_EXTRA_ARGS += $(GEN_NODES_EXTRA_ARGS)
diff --git a/vagrant/Kconfig b/vagrant/Kconfig
index e9e8b3d9..5d7d9657 100644
--- a/vagrant/Kconfig
+++ b/vagrant/Kconfig
@@ -6,12 +6,14 @@ choice
 
 config VAGRANT_LIBVIRT
 	bool "Libvirt"
+	select LIBVIRT_ARM64_ENABLE if TARGET_ARCH_ARM64
 	help
 	  Select this option if you want to use KVM / libvirt for
 	  local virtualization.
 
 config VAGRANT_VIRTUALBOX
 	bool "Virtualbox"
+	depends on TARGET_ARCH_X86_64
 	select EXTRA_STORAGE_SUPPORTS_512
 	select EXTRA_STORAGE_SUPPORTS_1K
 	select EXTRA_STORAGE_SUPPORTS_2K
@@ -198,7 +200,9 @@ endif # HAVE_LIBVIRT_PCIE_PASSTHROUGH
 
 choice
 	prompt "Machine type to use"
-	default LIBVIRT_MACHINE_TYPE_Q35
+	default LIBVIRT_MACHINE_TYPE_Q35 if TARGET_ARCH_X86_64
+	default LIBVIRT_MACHINE_TYPE_VIRT if TARGET_ARCH_ARM64
+	default LIBVIRT_MACHINE_TYPE_DEFAULT if (!TARGET_ARCH_X86_64 && !TARGET_ARCH_ARM64)
 
 config LIBVIRT_MACHINE_TYPE_DEFAULT
 	bool "Use the default machine type"
@@ -215,10 +219,18 @@ config LIBVIRT_MACHINE_TYPE_DEFAULT
 
 config LIBVIRT_MACHINE_TYPE_Q35
 	bool "q35"
+	depends on TARGET_ARCH_X86_64
 	help
 	  Use q35 for the machine type. This will be required for things like
 	  CXL or PCIe passthrough.
 
+config LIBVIRT_MACHINE_TYPE_VIRT
+	bool "virt"
+	depends on TARGET_ARCH_ARM64
+	select LIBVIRT_HOST_PASSTHROUGH
+	help
+	  Use the arm64 virt machine type.
+
 endchoice
 
 config LIBVIRT_HOST_PASSTHROUGH
@@ -251,6 +263,7 @@ config LIBVIRT_GRAPHICS_TYPE
 choice
 	prompt "Libvirt input config"
 	default LIBVIRT_INPUT_PS2_MOUSE if TARGET_ARCH_X86_64
+	default LIBVIRT_INPUT_VIRTIO_MOUSE if !TARGET_ARCH_X86_64
 
 config LIBVIRT_INPUT_PS2_MOUSE
 	bool "PS/2 mouse"
@@ -268,7 +281,8 @@ endchoice
 
 config LIBVIRT_LOADER
 	string "Path to a custom UEFI loader."
-	default ""
+	default "/usr/share/AAVMF/AAVMF_CODE.fd" if TARGET_ARCH_ARM64
+	default "" if !TARGET_ARCH_ARM64
 	help
 	  On some architectures, qemu may not automatically load the UEFI
 	  firmware from the correct location.  Set this variable to help it out.
@@ -279,11 +293,24 @@ config LIBVIRT_LOADER
 config LIBVIRT_NVRAM_DIR
 	string "Path to storage for UEFI NVRAM."
 	default ""
+	default "/var/lib/libvirt/qemu/nvram" if TARGET_ARCH_ARM64
+	default "" if !TARGET_ARCH_ARM64
 	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 LIBVIRT_FEATURE_ARM64_GIC_VERSION
+	string "GIC version"
+	depends on TARGET_ARCH_ARM64
+	default "3"
+	help
+	  Specify which Generic Interrupt Controller (GIC) version libvirt
+	  should use.  Newer GIC versions can support more cores.  For details
+	  see: https://developer.arm.com/Architectures/Generic%20Interrupt%20Controller
+	  Since ARM64 uses host cpu passthrough, some configs might not be
+	  available due to the underlying hardware.
+
 config QEMU_BUILD
 	bool "Should we build QEMU for you?"
 	select NEEDS_LOCAL_DEVELOPMENT_PATH
@@ -366,8 +393,10 @@ endif # QEMU_BUILD
 
 config QEMU_BIN_PATH_LIBVIRT
 	string "QEMU binary path to use"
-	default "/usr/local/bin/qemu-system-x86_64" if QEMU_USE_DEVELOPMENT_VERSION
-	default "/usr/bin/qemu-system-x86_64" if !QEMU_USE_DEVELOPMENT_VERSION
+	default "/usr/local/bin/qemu-system-x86_64" if TARGET_ARCH_X86_64 && QEMU_USE_DEVELOPMENT_VERSION
+	default "/usr/bin/qemu-system-x86_64" if TARGET_ARCH_X86_64 && !QEMU_USE_DEVELOPMENT_VERSION
+	default "/usr/local/bin/qemu-system-aarch64" if TARGET_ARCH_ARM64 && QEMU_USE_DEVELOPMENT_VERSION
+	default "/usr/bin/qemu-system-aarch64" if TARGET_ARCH_ARM64 && !QEMU_USE_DEVELOPMENT_VERSION
 
 config QEMU_INSTALL_DIR_LIBVIRT
 	string "Path to install QEMU"
@@ -1708,4 +1737,10 @@ endchoice
 
 endif # QEMU_ENABLE_CXL
 
+config LIBVIRT_ARM64_ENABLE
+	bool
+	depends on TARGET_ARCH_ARM64
+	help
+	  True if arch is arm64 and libvirt is enabled.
+
 endif # VAGRANT
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images
  2023-09-13  4:35 [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Ross Vandegrift
  2023-09-13  4:35 ` [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64 Ross Vandegrift
@ 2023-09-13  4:35 ` Ross Vandegrift
  2023-09-13  6:45   ` Luis Chamberlain
  2023-09-13  6:07 ` [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Luis Chamberlain
  2 siblings, 1 reply; 6+ messages in thread
From: Ross Vandegrift @ 2023-09-13  4:35 UTC (permalink / raw)
  To: mcgrof; +Cc: kdevops, Ross Vandegrift

Tumbleweed has arm64 vagrant images already and the one I tested booted up as
expected.

Signed-off-by: Ross Vandegrift <ross@kallisti.us>
---
 vagrant/Kconfig.opensuse | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/vagrant/Kconfig.opensuse b/vagrant/Kconfig.opensuse
index 2ffb1f31..685018b7 100644
--- a/vagrant/Kconfig.opensuse
+++ b/vagrant/Kconfig.opensuse
@@ -3,7 +3,8 @@ if VAGRANT_OPENSUSE
 
 choice
 	prompt "OpenSUSE release to use"
-	default VAGRANT_OPENSUSE_X86_64_LEAP_15_3
+	default VAGRANT_OPENSUSE_X86_64_LEAP_15_3 if TARGET_ARCH_X86_64
+	default VAGRANT_OPENSUSE_ARM64_TW_20230828 if TARGET_ARCH_ARM64
 
 config VAGRANT_OPENSUSE_X86_64_TW
 	bool "opensuse/Tumbleweed.x86_64"
@@ -78,6 +79,13 @@ config VAGRANT_OPENSUSE_X86_64_LEAP_15_4
 	help
 	  This enables the OpenSUSE Leap 15.4 release.
 
+config VAGRANT_OPENSUSE_ARM64_TW
+	bool "opensuse/Tumbleweed.aarch64"
+	depends on TARGET_ARCH_ARM64
+	help
+	  Enable this to be able to select between the supported OpenSUSE
+	  Tumbleweed releases.
+
 endchoice
 
 if VAGRANT_OPENSUSE_X86_64_TW
@@ -157,6 +165,27 @@ endchoice
 
 endif # VAGRANT_OPENSUSE_X86_64_TW
 
+if VAGRANT_OPENSUSE_ARM64_TW
+
+choice
+	prompt "opensuse/Tumbleweed.aarch64 version to use"
+	default VAGRANT_OPENSUSE_X86_64_TW_1020230828
+
+config VAGRANT_OPENSUSE_X86_64_TW_1020230828
+	bool "opensuse/Tumbleweed.aarch64 1.0.20230828"
+	select HAVE_VAGRANT_BOX_VERSION
+	select HAVE_DISTRO_XFS_SUPPORTS_CRC if FSTESTS_XFS
+	select HAVE_DISTRO_XFS_SUPPORTS_EXTERNAL_LOG if FSTESTS_XFS
+	select HAVE_DISTRO_XFS_SUPPORTS_REFLINKS if FSTESTS_XFS
+	select HAVE_DISTRO_XFS_SUPPORTS_BIGBLOCKS if FSTESTS_XFS
+	help
+	  This option will set the target guest to opensuse/Tumbleweed.aarch64
+	  release 1.0.20230828.
+
+endchoice
+
+endif # VAGRANT_OPENSUSE_ARM64_TW
+
 config VAGRANT_OPENSUSE_BOX_SHORT
 	string
 	default "tw" if VAGRANT_OPENSUSE_X86_64_TW
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options
  2023-09-13  4:35 [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Ross Vandegrift
  2023-09-13  4:35 ` [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64 Ross Vandegrift
  2023-09-13  4:35 ` [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images Ross Vandegrift
@ 2023-09-13  6:07 ` Luis Chamberlain
  2 siblings, 0 replies; 6+ messages in thread
From: Luis Chamberlain @ 2023-09-13  6:07 UTC (permalink / raw)
  To: Ross Vandegrift; +Cc: kdevops

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 <ross@kallisti.us>
> ---
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64
  2023-09-13  4:35 ` [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64 Ross Vandegrift
@ 2023-09-13  6:36   ` Luis Chamberlain
  0 siblings, 0 replies; 6+ messages in thread
From: Luis Chamberlain @ 2023-09-13  6:36 UTC (permalink / raw)
  To: Ross Vandegrift; +Cc: kdevops

On Tue, Sep 12, 2023 at 09:35:12PM -0700, Ross Vandegrift wrote:
> diff --git a/vagrant/Kconfig b/vagrant/Kconfig
> index e9e8b3d9..5d7d9657 100644
> --- a/vagrant/Kconfig
> +++ b/vagrant/Kconfig
> @@ -198,7 +200,9 @@ endif # HAVE_LIBVIRT_PCIE_PASSTHROUGH
>  
>  choice
>  	prompt "Machine type to use"
> -	default LIBVIRT_MACHINE_TYPE_Q35
> +	default LIBVIRT_MACHINE_TYPE_Q35 if TARGET_ARCH_X86_64
> +	default LIBVIRT_MACHINE_TYPE_VIRT if TARGET_ARCH_ARM64
> +	default LIBVIRT_MACHINE_TYPE_DEFAULT if (!TARGET_ARCH_X86_64 && !TARGET_ARCH_ARM64)

We might as well delete LIBVIRT_MACHINE_TYPE_DEFAULT :)

> +config LIBVIRT_ARM64_ENABLE
> +	bool
> +	depends on TARGET_ARCH_ARM64
> +	help
> +	  True if arch is arm64 and libvirt is enabled.
> +

config LIBVIRT_ARM64_ENABLE
	bool
	default TARGET_ARCH_ARM64

So long as that is put under libvirt, ie, when libvirt is enabled.

Otherwise looks good!

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images
  2023-09-13  4:35 ` [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images Ross Vandegrift
@ 2023-09-13  6:45   ` Luis Chamberlain
  0 siblings, 0 replies; 6+ messages in thread
From: Luis Chamberlain @ 2023-09-13  6:45 UTC (permalink / raw)
  To: Ross Vandegrift; +Cc: kdevops

On Tue, Sep 12, 2023 at 09:35:13PM -0700, Ross Vandegrift wrote:
> Tumbleweed has arm64 vagrant images already and the one I tested booted up as
> expected.
> 
> Signed-off-by: Ross Vandegrift <ross@kallisti.us>
> ---
>  vagrant/Kconfig.opensuse | 31 ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/vagrant/Kconfig.opensuse b/vagrant/Kconfig.opensuse
> index 2ffb1f31..685018b7 100644
> --- a/vagrant/Kconfig.opensuse
> +++ b/vagrant/Kconfig.opensuse
> @@ -3,7 +3,8 @@ if VAGRANT_OPENSUSE
>  
>  choice
>  	prompt "OpenSUSE release to use"
> -	default VAGRANT_OPENSUSE_X86_64_LEAP_15_3
> +	default VAGRANT_OPENSUSE_X86_64_LEAP_15_3 if TARGET_ARCH_X86_64
> +	default VAGRANT_OPENSUSE_ARM64_TW_20230828 if TARGET_ARCH_ARM64

Did you mean VAGRANT_OPENSUSE_ARM64_TW here instead of VAGRANT_OPENSUSE_ARM64_TW_20230828?
>  
>  config VAGRANT_OPENSUSE_X86_64_TW
>  	bool "opensuse/Tumbleweed.x86_64"
> @@ -78,6 +79,13 @@ config VAGRANT_OPENSUSE_X86_64_LEAP_15_4
>  	help
>  	  This enables the OpenSUSE Leap 15.4 release.
>  
> +config VAGRANT_OPENSUSE_ARM64_TW
> +	bool "opensuse/Tumbleweed.aarch64"
> +	depends on TARGET_ARCH_ARM64
> +	help
> +	  Enable this to be able to select between the supported OpenSUSE
> +	  Tumbleweed releases.
> +
>  endchoice
>  
>  if VAGRANT_OPENSUSE_X86_64_TW
> @@ -157,6 +165,27 @@ endchoice
>  
>  endif # VAGRANT_OPENSUSE_X86_64_TW
>  
> +if VAGRANT_OPENSUSE_ARM64_TW
> +
> +choice
> +	prompt "opensuse/Tumbleweed.aarch64 version to use"
> +	default VAGRANT_OPENSUSE_X86_64_TW_1020230828
> +
> +config VAGRANT_OPENSUSE_X86_64_TW_1020230828

These twho are x86 above.. while this is for arm64.

> +	bool "opensuse/Tumbleweed.aarch64 1.0.20230828"
> +	select HAVE_VAGRANT_BOX_VERSION
> +	select HAVE_DISTRO_XFS_SUPPORTS_CRC if FSTESTS_XFS
> +	select HAVE_DISTRO_XFS_SUPPORTS_EXTERNAL_LOG if FSTESTS_XFS
> +	select HAVE_DISTRO_XFS_SUPPORTS_REFLINKS if FSTESTS_XFS
> +	select HAVE_DISTRO_XFS_SUPPORTS_BIGBLOCKS if FSTESTS_XFS
> +	help
> +	  This option will set the target guest to opensuse/Tumbleweed.aarch64
> +	  release 1.0.20230828.
> +
> +endchoice
> +
> +endif # VAGRANT_OPENSUSE_ARM64_TW
> +
>  config VAGRANT_OPENSUSE_BOX_SHORT
>  	string
>  	default "tw" if VAGRANT_OPENSUSE_X86_64_TW
> -- 
> 2.39.2

Seems like you are missing the corresponding VAGRANT_BOX and VAGRANT_BOX_VERSION
updates needed on vagrant/Kconfig.

  Luis

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-13  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13  4:35 [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Ross Vandegrift
2023-09-13  4:35 ` [PATCH v2 2/3] vagrant arm64: kconfig/ansible to enable arm64 Ross Vandegrift
2023-09-13  6:36   ` Luis Chamberlain
2023-09-13  4:35 ` [PATCH v2 3/3] vagrant arm64: add opensuse arm64 images Ross Vandegrift
2023-09-13  6:45   ` Luis Chamberlain
2023-09-13  6:07 ` [PATCH v2 1/3] vagrant arm64: arch indep kconfig/ansible options Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).