Re: [libvirt] [PATCH 2/2]: Call udevsettle in the appropriate places

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

 



Daniel P. Berrange wrote:
>> +void virStorageBackendWaitForDevices(virConnectPtr conn)
>> +{
>> +#ifdef UDEVADM
>> +    const char *const settleprog[] = { UDEVADM, "settle", NULL };
>> +    int exitstatus;
>> +
>> +    if (access(UDEVADM, X_OK) != 0)
>> +        return;
>> +
>> +    /*
>> +     * NOTE: we ignore errors here; this is just to make sure that any device
>> +     * nodes that are being created finish before we try to scan them.
>> +     * If this fails for any reason, we still have the backup of polling for
>> +     * 5 seconds for device nodes.
>> +     */
>> +    virRun(conn, settleprog, &exitstatus);
>> +#endif
>> +}
> 
> This will generate a compiler warning when UDEVADM is not defined.
> Better to have the #ifdef around the entire function, and then do
> a no-op decl with ATTRIBUTE_UNUSED
> 
> #else
> void virStorageBackendWaitForDevices(virConnectPtr conn ATTRIBUTE_UNUSED) {}
> #endif

Committed with this change in place.

-- 
Chris Lalancette

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