]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Move and optimize disk target duplicity checking
authorPeter Krempa <pkrempa@redhat.com>
Thu, 4 Feb 2016 13:24:53 +0000 (14:24 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 8 Feb 2016 08:35:01 +0000 (09:35 +0100)
commite84ab7938d5a794e9c3bf2f6b01356c4da201bfa
treeef02d7af4c3a58d733280d0786370dca010a3e8f
parent6d04f0592ea2538d4124fd5013ce46bf85444233
conf: Move and optimize disk target duplicity checking

Move the logic from virDomainDiskDefDstDuplicates into
virDomainDiskDefCheckDuplicateInfo so that we don't have to loop
multiple times through the array of disks. Since the original function
was called in qemuBuildDriveDevStr, it was actually called for every
single disk which was quite wasteful.

Additionally the target uniqueness check needed to be duplicated in
the disk hotplug case, since the disk was inserted into the domain
definition after the device string was formatted and thus
virDomainDiskDefDstDuplicates didn't do anything in that case.
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_command.c
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c