From da4efc5433c6a21c4ce0b97f76bb5545b49ecdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 5 Oct 2021 13:18:52 +0200 Subject: [PATCH] qemu: vhost-user-fs: format alias on the command line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit adding the vhost-user-fs device forgot to format the device's alias on the command line. Thankfully it was not needed yet because virtiofs migration is not yet supported, but it will be needed in the future to allow hot(un)plug. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- src/qemu/qemu_command.c | 1 + .../qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args | 2 +- .../qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 08f6d735f8..90c8022b07 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2057,6 +2057,7 @@ qemuBuildVHostUserFsCommandLine(virCommand *cmd, VIR_DOMAIN_DEVICE_FS, fs) < 0) return -1; + virBufferAsprintf(&opt, ",id=%s", fs->info.alias); virBufferAsprintf(&opt, ",chardev=%s", chardev_alias); if (fs->queue_size) virBufferAsprintf(&opt, ",queue-size=%llu", fs->queue_size); diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args index 6311f8f65e..7586a8edbf 100644 --- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -no-acpi \ -boot strict=on \ -chardev socket,id=chr-vu-fs0,path=/tmp/lib/domain--1-guest/fs0.vhost-fs.sock \ --device vhost-user-fs-pci,chardev=chr-vu-fs0,queue-size=1024,tag=mount_tag,bus=pci.0,addr=0x2 \ +-device vhost-user-fs-pci,id=fs0,chardev=chr-vu-fs0,queue-size=1024,tag=mount_tag,bus=pci.0,addr=0x2 \ -audiodev id=audio1,driver=none \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args index 58570592eb..290d0b9e2f 100644 --- a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args @@ -34,7 +34,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -device virtio-blk-pci,bus=pci.4,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -chardev socket,id=chr-vu-fs0,path=/tmp/lib/domain--1-guest/fs0.vhost-fs.sock \ --device vhost-user-fs-pci,chardev=chr-vu-fs0,tag=mount_tag,bootindex=2,bus=pci.1,addr=0x0 \ +-device vhost-user-fs-pci,id=fs0,chardev=chr-vu-fs0,tag=mount_tag,bootindex=2,bus=pci.1,addr=0x0 \ -audiodev id=audio1,driver=none \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on