]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuDomainPrepareHostdev: Don't base backend nodename on device alias
authorPeter Krempa <pkrempa@redhat.com>
Thu, 10 Sep 2020 13:43:54 +0000 (15:43 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Sep 2020 13:20:23 +0000 (15:20 +0200)
commite5dc1427d742556ad07fb97fb28202ce130cda4e
tree62e99aac0b6f76043ef6b921720e1f120221bfce
parenta669d68336310ba629962ed1fe342bf583acff5b
qemuDomainPrepareHostdev: Don't base backend nodename on device alias

QEMU's blockdev nodenames which are used to back SCSI/iSCSI hostdevs are
limited to 32 characters. If a user passes a very long user alias as
name of the host device it's easy to end up with a too-long nodename.

To prevent this from happening don't base the nodename on the possibly
user-specified alias but on the normal sequential node name generator.

We then store the name in the status XML for further use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/hostdev-scsi-lsi.x86_64-latest.args
tests/qemuxml2argvdata/hostdev-scsi-virtio-scsi.x86_64-latest.args