Re: [PATCH 1/3] qemu: hot-plug: Fix broken SCSI disk hot-plug

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

 



On Thu, Jun 30, 2016 at 12:34 PM +0200, Peter Krempa <pkrempa@xxxxxxxxxx> wrote:
>>      qemuDomainObjPrivatePtr priv = vm->privateData;
>> +    virDomainControllerDefPtr cont = NULL;
>
> This variable isn't necessary.

>> +    /* Let's make sure the disk has a controller defined and loaded before
>> +     * trying to add it. The controller used by the disk must exist before a
>> +     * qemu command line string is generated.
>> +     *
>> +     * Ensure that the given controller and all controllers with a smaller index
>> +     * exist; there must not be any missing index in between.
>> +     */
>> +    for (i = 0; i <= disk->info.addr.drive.controller; i++) {
>> +        cont = qemuDomainFindOrCreateSCSIDiskController(driver, vm, i);
>> +        if (!cont)
>> +            goto error;
>
> This can be checked right away as the value of 'cont' isn't used.

>> +    /* Tell clang that "cont" is non-NULL.
>> +       This is because disk->info.addr.driver.controller is unsigned,
>> +       and hence the above loop must iterate at least once. */
>> +    sa_assert(cont);
>
> Also this whole comment and assert can be dropped.

You're right.

> I'll adjust the patch and push it shortly. Thanks for fixing up the mess
> I've made.

Okay, thanks.

Regards,
 Marc

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