Re: [PATCH 6/7] storage: Introduce storagePoolUpdateAllState function

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

 




On 03/25/2015 06:42 PM, John Ferlan wrote:
>> the 'checkPool' block has been moved to storagePoolUpdateAllState.
> 
> move the checkPool block into storageDriverInitialize. This ensures
> activating pools earlier allowing domains using volumes from a pool to
> be able to find the volume during qemuProcessReconnect ...

storagePoolUpdateAllState is called only from storageDriverInitialize...
moving checkPool to storageDriverInitialize would result in copying the
whole (65 lines) UpdateAllState body which I think is not necessary.

>>  static void
>> +storagePoolUpdateAllState(void)
>> +{
>> +    size_t i;
>> +    bool active = false;
>> +
>> +    for (i = 0; i < driver->pools.count; i++) {
>> +        virStoragePoolObjPtr pool = driver->pools.objs[i];
>> +        virStorageBackendPtr backend;
>> +
>> +        virStoragePoolObjLock(pool);
>> +        if (!virStoragePoolObjIsActive(pool)) {
>> +            virStoragePoolObjUnlock(pool);
>> +            continue;
>> +        }
>> +
>> +        if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
>> +            VIR_ERROR(_("Missing backend %d"), pool->def->type);
>> +            virStoragePoolObjUnlock(pool);
>> +            continue;
>> +        }
> 
> Redundant check with DriverAutostart and since that's the only place
> that calls us....  I think dropping the VIR_ERROR is fine...

storageDriverInitialize is the only place that calls UpdateAllState.
Based on the fact that 'Initialize' is executed before 'Autostart' I
think it might be better to remove the error check from 'Autostart' instead.

Erik

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