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

Chris Lalancette clalance at redhat.com
Fri Nov 28 07:50:21 UTC 2008


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




More information about the libvir-list mailing list