runtime-rs: Change the device_id with block device index

As block device index is an very important unique id of a block device
and can indicate a block device which is equivalent to device_id.
In case of index is required in calculating scsi LUN and reduce
useless arguments within reusing `hotplug_block_device`, we'd better
change the device_id with block device index.

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
alex.lyn 2025-07-23 17:51:09 +08:00
parent 4521cae0c0
commit e683a7fd37
2 changed files with 2 additions and 2 deletions

View File

@ -635,7 +635,7 @@ impl QemuInner {
block_device.config.pci_path = qmp
.hotplug_block_device(
&self.config.blockdev_info.block_device_driver,
&block_device.device_id,
block_device.config.index,
&block_device.config.path_on_host,
&block_device.config.blkdev_aio.to_string(),
block_device.config.is_direct,

View File

@ -519,7 +519,7 @@ impl Qmp {
pub fn hotplug_block_device(
&mut self,
block_driver: &str,
device_id: &str,
device_id: u64,
path_on_host: &str,
blkdev_aio: &str,
is_direct: Option<bool>,