dm: virtio-blk: fix parameter err

Fix the truncate issue for virtio block parameter.

Tracked-On: #8162
Signed-off-by: Conghui <conghui.chen@intel.com>
This commit is contained in:
Conghui 2022-09-14 15:13:07 +08:00 committed by acrnsi-robot
parent 5c5749c1ff
commit 3263b5a707
1 changed files with 5 additions and 1 deletions

View File

@ -506,7 +506,11 @@ virtio_blk_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
if (strcmp("iothread", opt) == 0) {
use_iothread = true;
} else {
opts_tmp = opts_start;
/* The string pointed by opts_start is truncated by strsep,
* so use opts instead of opts_start which point to the original
* parameter string.
* */
opts_tmp = opts;
}
bctxt = blockif_open(opts_tmp, bident);
if (bctxt == NULL) {