Re: [PATCH 11/11] conf: Move and optimize disk target duplicity checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 04, 2016 at 03:49:48PM +0100, Peter Krempa wrote:
> 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   | 44 +++++++++++++-------------------------------
>  src/conf/domain_conf.h   |  1 -
>  src/libvirt_private.syms |  1 -
>  src/qemu/qemu_command.c  |  3 ---
>  src/qemu/qemu_hotplug.c  |  6 ------
>  5 files changed, 13 insertions(+), 42 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 8a7a989..c1dffc4 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c

> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 8943270..d7f19f3 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -4228,9 +4228,6 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
>      const char *contAlias;
>      int controllerModel;
> 
> -    if (virDomainDiskDefDstDuplicates(def))
> -        goto error;
> -

All the callers of qemuBuildDriveDevStr have this check, except
qemuConnectDomainXMLToNative which calls qemuBuildCommandLine
without calling qemuProcessStartValidate first.

ACK with that fixed.

Jan

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]