bdev_virtio: set unique name for the bdevs
Previously all bdevs were using hardcoded name Virtio0. Change-Id: Ib990027a0edd4e200aa4b6f4689ccb9e0824a9c3 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/382926 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
66ed5a2bb6
commit
c6ba3fe473
@ -622,7 +622,13 @@ alloc_virtio_disk(struct virtio_scsi_scan_base *base, uint8_t target_id, uint64_
|
||||
disk->target = target_id;
|
||||
|
||||
bdev = &disk->bdev;
|
||||
bdev->name = spdk_sprintf_alloc("Virtio0");
|
||||
bdev->name = spdk_sprintf_alloc("VirtioScsi%"PRIu32"t%"PRIu8, disk->vdev->id, target_id);
|
||||
if (bdev->name == NULL) {
|
||||
SPDK_ERRLOG("Couldn't alloc memory for the bdev name.\n");
|
||||
free(disk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
bdev->product_name = "Virtio SCSI Disk";
|
||||
bdev->write_cache = 0;
|
||||
bdev->blocklen = disk->block_size;
|
||||
|
Loading…
Reference in New Issue
Block a user