From mboxrd@z Thu Jan 1 00:00:00 1970 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 75340163 for ; Fri, 8 Mar 2024 00:04:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709856244; cv=none; b=EAk6HoKGffQr8lAPLVD9blmwuK/sLPBDgbDkDGo4qFzXfceNJUfU5XW3xPh557Xsx+uso1r2/+/gp86GxKRy0JrKhp7QPkWT2SpfBtACHCu1MvvP5TSb1AuwU8Q9WiiKJ2z6aNvOl4oLZGMUzE96rm8DQvjpOYGTdwNu/LfXkuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709856244; c=relaxed/simple; bh=ElhF2KZZFywqAaiUPhQ5nE00jLvh0D7i+cDt8ujtQ+o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V3sO5ORGmVc2covk5W/HujmwiNwQ+iEYtsrtr5OpiNlfYfmUjj+KClYxeLurlwAx3q4gR5b4XeCg9x1RkSjnmaElu1u2lNJf37gjFVph9vXD8Cbn7lYSMHeRvYoMQvIBIIkuialUO2qmErBp2cqtJqGAoGfjqWnrdylGW2XqVVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=JYqcjQt6; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JYqcjQt6" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=K43Tf+pCbVKkeKDeuWpQK0MzdRLxwk5BTNCQugd7OlI=; b=JYqcjQt6JBym1at0RPwNQ/CxGd VL9Q+x1JqE45pVZY841uHeOUEG04tF66BuIpzo5opZAfDg7GIt1usVVhT+EH6E4/JQVKt2UISTVDM bObuvPIYncFTrzzsauvMRsoG9YsgYr6Ki9CMMl7fCj6uAFKULtc7ezEeNJEMPEGDGAfTp8p8jLfEn vqfOPh3mLjXeV8sXTQp2/LNMbkt8bRY1lSgT6Of9MxBg5iea28oM9J28A43SxxCop7EeBTp6y5MF/ 6FIfx8N87A3BU2jO4WAUTihuWEQd3LSXRhDab1WhR6o3rZR8r0nGJNX89N16G/d5dJLA4fnRX+1h8 8VHTE90w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1riNiT-00000006uQF-0MKp; Fri, 08 Mar 2024 00:04:01 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 1/8] guestfs: use macros for drives for aarch64 Date: Thu, 7 Mar 2024 16:03:52 -0800 Message-ID: <20240308000400.1646823-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240308000400.1646823-1-mcgrof@kernel.org> References: <20240308000400.1646823-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Now that we have macros for drive generation for the XML files we can share this with aarch64. So move all the code to generate drives into a shared file and include it for both q35 and aarch64. This then also augments aarch64 to also support large IO experimentation (CONFIG_QEMU_ENABLE_EXTRA_DRIVE_LARGEIO) Signed-off-by: Luis Chamberlain --- .../roles/gen_nodes/templates/gen_drives.j2 | 57 ++++++++++++++++++ .../gen_nodes/templates/guestfs_q35.j2.xml | 58 +------------------ .../gen_nodes/templates/guestfs_virt.j2.xml | 38 +----------- 3 files changed, 59 insertions(+), 94 deletions(-) create mode 100644 playbooks/roles/gen_nodes/templates/gen_drives.j2 diff --git a/playbooks/roles/gen_nodes/templates/gen_drives.j2 b/playbooks/roles/gen_nodes/templates/gen_drives.j2 new file mode 100644 index 00000000..105e2cf0 --- /dev/null +++ b/playbooks/roles/gen_nodes/templates/gen_drives.j2 @@ -0,0 +1,57 @@ +{% if libvirt_extra_storage_drive_ide %} +{{ drives.gen_drive_ide(4, + kdevops_storage_pool_path, + hostname, + libvirt_extra_drive_format, + libvirt_extra_storage_aio_mode, + libvirt_extra_storage_aio_cache_mode) }} +{% elif libvirt_extra_storage_drive_virtio %} +{% if libvirt_largeio_enable %} +{{ drives.gen_drive_large_io_virtio(libvirt_largeio_logical_compat, + libvirt_largeio_logical_compat_size, + libvirt_largeio_pow_limit, + libvirt_largeio_drives_per_space, + hostname, + libvirt_extra_drive_format, + libvirt_extra_storage_aio_mode, + libvirt_extra_storage_aio_cache_mode, + kdevops_storage_pool_path) }} +{% else %} +{{ drives.gen_drive_virtio(4, + kdevops_storage_pool_path, + hostname, + libvirt_extra_drive_format, + libvirt_extra_storage_aio_mode, + libvirt_extra_storage_aio_cache_mode, + libvirt_extra_storage_virtio_logical_block_size, + libvirt_extra_storage_virtio_physical_block_size) }} +{% endif %} +{% elif libvirt_extra_storage_drive_nvme %} +{% if libvirt_largeio_enable %} +{{ drives.gen_drive_large_io_nvme(libvirt_largeio_logical_compat, + libvirt_largeio_logical_compat_size, + libvirt_largeio_pow_limit, + libvirt_largeio_drives_per_space, + hostname, + libvirt_extra_drive_format, + libvirt_extra_storage_aio_mode, + libvirt_extra_storage_aio_cache_mode, + kdevops_storage_pool_path) }} +{% else %} +{{ drives.gen_drive_nvme(4, + kdevops_storage_pool_path, + hostname, + libvirt_extra_drive_format, + libvirt_extra_storage_aio_mode, + libvirt_extra_storage_aio_cache_mode, + libvirt_extra_storage_nvme_logical_block_size) }} +{% endif %} +{% endif %} +{% if bootlinux_9p %} + {{ drives.gen_9p_mount(bootlinux_9p_driver, + bootlinux_9p_fsdev, + bootlinux_9p_host_path, + bootlinux_9p_mount_tag, + bootlinux_9p_security_model, + 10) }} +{% endif %} diff --git a/playbooks/roles/gen_nodes/templates/guestfs_q35.j2.xml b/playbooks/roles/gen_nodes/templates/guestfs_q35.j2.xml index fe8be827..ce160490 100644 --- a/playbooks/roles/gen_nodes/templates/guestfs_q35.j2.xml +++ b/playbooks/roles/gen_nodes/templates/guestfs_q35.j2.xml @@ -178,62 +178,6 @@ -{% if libvirt_extra_storage_drive_ide %} -{{ drives.gen_drive_ide(4, - kdevops_storage_pool_path, - hostname, - libvirt_extra_drive_format, - libvirt_extra_storage_aio_mode, - libvirt_extra_storage_aio_cache_mode) }} -{% elif libvirt_extra_storage_drive_virtio %} -{% if libvirt_largeio_enable %} -{{ drives.gen_drive_large_io_virtio(libvirt_largeio_logical_compat, - libvirt_largeio_logical_compat_size, - libvirt_largeio_pow_limit, - libvirt_largeio_drives_per_space, - hostname, - libvirt_extra_drive_format, - libvirt_extra_storage_aio_mode, - libvirt_extra_storage_aio_cache_mode, - kdevops_storage_pool_path) }} -{% else %} -{{ drives.gen_drive_virtio(4, - kdevops_storage_pool_path, - hostname, - libvirt_extra_drive_format, - libvirt_extra_storage_aio_mode, - libvirt_extra_storage_aio_cache_mode, - libvirt_extra_storage_virtio_logical_block_size, - libvirt_extra_storage_virtio_physical_block_size) }} -{% endif %} -{% elif libvirt_extra_storage_drive_nvme %} -{% if libvirt_largeio_enable %} -{{ drives.gen_drive_large_io_nvme(libvirt_largeio_logical_compat, - libvirt_largeio_logical_compat_size, - libvirt_largeio_pow_limit, - libvirt_largeio_drives_per_space, - hostname, - libvirt_extra_drive_format, - libvirt_extra_storage_aio_mode, - libvirt_extra_storage_aio_cache_mode, - kdevops_storage_pool_path) }} -{% else %} -{{ drives.gen_drive_nvme(4, - kdevops_storage_pool_path, - hostname, - libvirt_extra_drive_format, - libvirt_extra_storage_aio_mode, - libvirt_extra_storage_aio_cache_mode, - libvirt_extra_storage_nvme_logical_block_size) }} -{% endif %} -{% endif %} -{% if bootlinux_9p %} - {{ drives.gen_9p_mount(bootlinux_9p_driver, - bootlinux_9p_fsdev, - bootlinux_9p_host_path, - bootlinux_9p_mount_tag, - bootlinux_9p_security_model, - 10) }} -{% endif %} +{% include './templates/gen_drives.j2' %} diff --git a/playbooks/roles/gen_nodes/templates/guestfs_virt.j2.xml b/playbooks/roles/gen_nodes/templates/guestfs_virt.j2.xml index 9a7f004d..29dc0951 100644 --- a/playbooks/roles/gen_nodes/templates/guestfs_virt.j2.xml +++ b/playbooks/roles/gen_nodes/templates/guestfs_virt.j2.xml @@ -174,42 +174,6 @@ -{% if libvirt_extra_storage_drive_ide %} -{% for n in range(0,4) %} - - - - -{% endfor %} -{% elif libvirt_extra_storage_drive_virtio %} -{% for n in range(0,4) %} - - - - - - - - -{% endfor %} -{% elif libvirt_extra_storage_drive_nvme %} -{% for n in range(0,4) %} - - - - - - - - -{% endfor %} -{% endif %} -{% if bootlinux_9p %} - - - - -{% endif %} +{% include './templates/gen_drives.j2' %} - -- 2.43.0