Re: [PATCH] qemu: Warn when using vhost-user without shared memory

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

 



[...]

>>> +        bool shmem = vm->def->nshmems;
>>> +
>>> +        /*
>>> +         * This check is by no means complete.  We merely check
>>> +         * whetere there are *some* hugepages enabled and *some* NUMA
>>> +         * nodes with shared memory access.
>>> +         */
>>> +        if (!shmem && vm->def->mem.nhugepages) {
>>> +            for (i = 0; i <
>>> virDomainNumaGetNodeCount(vm->def->numa); i++) {
>>> +                if
>>> (virDomainNumaGetNodeMemoryAccessMode(vm->def->numa, i) ==
>>> +                    VIR_NUMA_MEM_ACCESS_SHARED)
>>> +                    shmem = true;
>>> +                break;
>>
>> Coverity complains here that i++ is not reachable.  I think you meant to
>> put the break; inside the if, right?
>>
>> John
> 
> Yes, exactly, thanks for noticing, this should be the diff:
> 
> diff --git i/src/qemu/qemu_process.c w/src/qemu/qemu_process.c
> index ba8dfebd1357..f2740687f655 100644
> --- i/src/qemu/qemu_process.c
> +++ w/src/qemu/qemu_process.c
> @@ -4781,9 +4781,10 @@ qemuProcessLaunch(virConnectPtr conn,
>         if (!shmem && vm->def->mem.nhugepages) {
>             for (i = 0; i < virDomainNumaGetNodeCount(vm->def->numa);
> i++) {
>                 if (virDomainNumaGetNodeMemoryAccessMode(vm->def->numa,
> i) ==
> -                    VIR_NUMA_MEM_ACCESS_SHARED)
> +                    VIR_NUMA_MEM_ACCESS_SHARED) {
>                     shmem = true;
> -                break;
> +                    break;
> +                }
>             }
>         }
> 
> -- 
> 
> I will push it later on if you agree.
> 
> Martin

Looks OK to me

ACK

John

--
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]