aboutsummaryrefslogtreecommitdiff
path: root/block/export
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2022-06-14 13:15:32 +0800
committerKevin Wolf <kwolf@redhat.com>2022-06-24 17:07:06 +0200
commit779d82e1d305f2a9cbd7f48cf6555ad58145e04a (patch)
tree39266452d6780f9435c04bb64a962104b1547f6b /block/export
parent0862a087fd710a6c7ad4ea01d35309686e54e202 (diff)
downloadqemu-779d82e1d305f2a9cbd7f48cf6555ad58145e04a.zip
qemu-779d82e1d305f2a9cbd7f48cf6555ad58145e04a.tar.gz
qemu-779d82e1d305f2a9cbd7f48cf6555ad58145e04a.tar.bz2
vduse-blk: Add name option
Currently we use 'id' option as the name of VDUSE device. It's a bit confusing since we use one value for two different purposes: the ID to identfy the export within QEMU (must be distinct from any other exports in the same QEMU process, but can overlap with names used by other processes), and the VDUSE name to uniquely identify it on the host (must be distinct from other VDUSE devices on the same host, but can overlap with other export types like NBD in the same process). To make it clear, this patch adds a separate 'name' option to specify the VDUSE name for the vduse-blk export instead. Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Message-Id: <20220614051532.92-7-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/export')
-rw-r--r--block/export/vduse-blk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/export/vduse-blk.c b/block/export/vduse-blk.c
index 066e088..f101c24 100644
--- a/block/export/vduse-blk.c
+++ b/block/export/vduse-blk.c
@@ -300,7 +300,7 @@ static int vduse_blk_exp_create(BlockExport *exp, BlockExportOptions *opts,
features |= 1ULL << VIRTIO_BLK_F_RO;
}
- vblk_exp->dev = vduse_dev_create(exp->id, VIRTIO_ID_BLOCK, 0,
+ vblk_exp->dev = vduse_dev_create(vblk_opts->name, VIRTIO_ID_BLOCK, 0,
features, num_queues,
sizeof(struct virtio_blk_config),
(char *)&config, &vduse_blk_ops,
@@ -312,7 +312,7 @@ static int vduse_blk_exp_create(BlockExport *exp, BlockExportOptions *opts,
}
vblk_exp->recon_file = g_strdup_printf("%s/vduse-blk-%s",
- g_get_tmp_dir(), exp->id);
+ g_get_tmp_dir(), vblk_opts->name);
if (vduse_set_reconnect_log_file(vblk_exp->dev, vblk_exp->recon_file)) {
error_setg(errp, "failed to set reconnect log file");
ret = -EINVAL;