From e9a5de35e8188c055a72e6c1cf5d824699ad5821 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Mon, 15 Sep 2025 15:46:17 +0800 Subject: [PATCH] runtime-rs: Enable share-rw=true when hotplug block device within qemu Support for the share-rw=true parameter has been added. While this parameter is essential for maintaining data consistency across multiple QEMU instances sharing a backend disk image, its implementation also serves to standardize parameters with the block device hotplug functionality in kata-runtime/qemu. Signed-off-by: Alex Lyn --- src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs b/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs index a3fb754433..7b3b14310b 100644 --- a/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs +++ b/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs @@ -634,6 +634,7 @@ impl Qmp { // add SCSI frontend device blkdev_add_args.insert("scsi-id".to_string(), scsi_id.into()); blkdev_add_args.insert("lun".to_string(), lun.into()); + blkdev_add_args.insert("share-rw".to_string(), true.into()); self.qmp .execute(&qmp::device_add { @@ -654,6 +655,7 @@ impl Qmp { } else { let (bus, slot) = self.find_free_slot()?; blkdev_add_args.insert("addr".to_owned(), format!("{:02}", slot).into()); + blkdev_add_args.insert("share-rw".to_string(), true.into()); self.qmp .execute(&qmp::device_add {