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 757A120487E for ; Sat, 18 Oct 2025 02:31:57 +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=1760754719; cv=none; b=uMiKrUwJOxxHaw2Vg6i4AOdEFWg0yfb8ia6Uto7OBG4chtv8WMhFDNZvJ1BIxA2JQWCB8vsPCS0nrsZU/RhXxHMIXAWBOPgxHaL3k4AVNDu/32caIUBjfCXuVJ0OmnPx6Fh98d8is1X5Ru1XHaCm1aub7G/FwwJWN90Y6HNWwMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760754719; c=relaxed/simple; bh=n+8hehex0Y9NRLkRyHQAI5kPXJNPl3NFeJf7BBmf3aw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SXP/qdBZPYXY2fChPqKLopebpOdX05O59b/7sGjJD1BLWA+Wv2CeGxW5SsTmDZ+aFUdMQ4NYgwJYUy/fPlEkWir0jZRaF/WKNT0WYbkP/AfihXzhmkm9WsE3icrVw4ACvUszlpRJlA0/NgGxQmtqc75h/OObwsUMkepVUijMfmY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine 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=snZa5KMr; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine 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="snZa5KMr" 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=4ea6qxkYddT9C6DGCY9auyrXkTK8wSQ3AwTJNuUO628=; b=snZa5KMrMnVQfN41M1raC6s1ok HOgKBCrf2e2Vg3S8/RO3mUh9PExkmm1Zy+/rkMJGlz9EmEdWF2YhB6QATKAId+QbNXQl2a/TIPOyl 36UTcqml4AlSyB5fASL6xi22bxINiXoD1ux1/Wvwgc+1cYZVvSxL+6z+X/IFciCeOS6VNUjto0S77 Jmqrz6smGgjHYyuKBIer6nWg5u+N489b7R9XhxjQxMzTKu+NRgkd/CBNyFrHW0QLMYk0sU6IG42Ub w3/Qzgo0FnWWISZwcLSUrQ7c3k37Z1ECq3OY5kMrFuiqeNxLENWecpLd6UW4YrAvGApQccf/+2WAF kTrXFApQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1v9wjd-00000009Oen-0MB8; Sat, 18 Oct 2025 02:31:57 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 7/8] guestfs: Fix base_image_pathname for custom images Date: Fri, 17 Oct 2025 19:31:52 -0700 Message-ID: <20251018023154.2239688-8-mcgrof@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251018023154.2239688-1-mcgrof@kernel.org> References: <20251018023154.2239688-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 Fix a bug in the guestfs role where base_image_pathname was set to point to the custom_images directory instead of the base_images directory when using custom raw images. The Bug: -------- When guestfs_has_custom_raw_image is true, the guestfs role was setting: base_image = "{{ storagedir }}/custom_images/{{ virtbuilder_os_version }}/..." This path was then passed as base_image_pathname to the base_image role. The base_image role's custom-image.yml has a task that copies the custom image from custom_images/ to base_images/: - name: Copy custom image to base image location command: cp --reflink=auto '{{ custom_image }}' '{{ base_image_pathname }}' when: - custom_image_stat.stat.exists or custom_image_download is changed - custom_image != base_image_pathname However, both custom_image and base_image_pathname were set to the SAME PATH (in custom_images/), so the condition "custom_image != base_image_pathname" was always false, causing the copy task to be skipped. This meant base images were never created in the base_images directory, breaking workflows that expect base images there (like rcloud). The Fix: -------- Changed guestfs role to always set base_image to the base_images directory location, regardless of whether custom images are used: base_image = "{{ storagedir }}/base_images/{{ virtbuilder_os_version }}.raw" Now for custom images: - custom_image = /path/to/custom_images/image/image.raw (source) - base_image_pathname = /path/to/base_images/image.raw (destination) - These are different paths, so the copy runs correctly For non-custom images: - virt-builder creates directly at base_images/image.raw - No copy needed (same behavior as before) Impact: ------- This fix ensures that when using custom raw images: 1. Images are properly customized in custom_images/ directory 2. Customized images are copied to base_images/ directory 3. Other roles and workflows can find base images in the expected location 4. Permissions are set correctly (root:libvirt-qemu 0640) Fixes: 7af0e602e8c8 ("guestfs: bringup: fix ssh key injection") Generated-by: Claude AI Signed-off-by: Luis Chamberlain --- playbooks/roles/guestfs/tasks/main.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/playbooks/roles/guestfs/tasks/main.yml b/playbooks/roles/guestfs/tasks/main.yml index 6618687e..e5960946 100644 --- a/playbooks/roles/guestfs/tasks/main.yml +++ b/playbooks/roles/guestfs/tasks/main.yml @@ -25,24 +25,12 @@ storagedir: "{{ kdevops_storage_pool_path }}/guestfs" delegate_to: localhost -- name: Set the pathname of the OS base image +- name: Set the pathname of the base image in base_images directory tags: - base_image - bringup ansible.builtin.set_fact: base_image: "{{ storagedir }}/base_images/{{ virtbuilder_os_version }}.raw" - when: - - not guestfs_has_custom_raw_image|bool - delegate_to: localhost - -- name: Set the pathname of the custom OS base image - tags: - - base_image - - bringup - ansible.builtin.set_fact: - base_image: "{{ storagedir }}/custom_images/{{ virtbuilder_os_version }}/{{ virtbuilder_os_version }}.raw" - when: - - guestfs_has_custom_raw_image|bool delegate_to: localhost - name: Ensure the required base OS image exists -- 2.51.0