From 6ee43475c39a4c19f82e73b6f9e030a3f20a5c48 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Tue, 19 May 2026 11:59:51 +0100 Subject: [PATCH] agent-ctl: Fix CLH virtio-fs queue size configuration After commit e2240b694a ("runtime-rs: ch: source virtio-fs queue size from toml"), Cloud Hypervisor no longer provides fallback defaults for virtio-fs queue configuration. When queue_size or queue_num are 0, CH now uses those values directly instead of substituting defaults, which causes a panic in the device manager. The agent-ctl tool was hardcoding queue_size=0 and queue_num=0 in share_fs_utils.rs, relying on CH's fallback behavior. This broke the agent-api tests for Cloud Hypervisor while QEMU tests continued to pass. Fix by reading virtio_fs_queue_size from the hypervisor config and falling back to sensible defaults (1024 queue size, 1 queue) when not configured, matching the previous CH default behavior. Generated-by: IBM Bob Signed-off-by: stevenhorsman --- src/tools/agent-ctl/src/vm/share_fs_utils.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tools/agent-ctl/src/vm/share_fs_utils.rs b/src/tools/agent-ctl/src/vm/share_fs_utils.rs index afac26cc50..0fcb627b33 100644 --- a/src/tools/agent-ctl/src/vm/share_fs_utils.rs +++ b/src/tools/agent-ctl/src/vm/share_fs_utils.rs @@ -65,13 +65,23 @@ pub(crate) async fn setup_virtio_fs( std::fs::create_dir_all(&host_path).context("virtio-fs:: failed to create root path")?; // plugin the device + // Use queue size and num from hypervisor config, with fallback to sensible defaults + // if not configured (e.g., 1024 queue size, 1 queue as per previous CH defaults) + let queue_size: u64 = if shared_fs_info.virtio_fs_queue_size > 0 { + shared_fs_info.virtio_fs_queue_size as u64 + } else { + 1024 // Default queue size matching previous CH behavior + }; + + let queue_num: u64 = 1; // Default to 1 queue (previous CH default) + let share_fs_config = ShareFsConfig { host_shared_path: host_path.clone(), sock_path: generate_sock_path(&host_path), mount_tag: String::from(MOUNT_GUEST_TAG), fs_type: VIRTIO_FS.to_string(), - queue_size: 0, - queue_num: 0, + queue_size, + queue_num, options: vec![], mount_config: None, };