From 497bac6bd0de9fdcf9a121f691d9dedace3bf692 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Thu, 7 Aug 2025 18:58:09 +0800 Subject: [PATCH] runtime-rs: Support 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 4952629641..65976d41b3 100644 --- a/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs +++ b/src/runtime-rs/crates/hypervisor/src/qemu/qmp.rs @@ -683,6 +683,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 { @@ -703,6 +704,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 {