>> +#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__) >> +#define DEBUG0(msg) VIR_DEBUG(__FILE__, "%s", msg) DL> Do you know ##__VA_ARGS ? Yes, and I agree this not my preferred way. However, this isn't my code and when I went to look for other instances, I found many so I decided not to change it. % cat *.c | grep DEBUG0 -c 47 DL> Is this function safe for concurrent access ? eg. getFreeVethName DL> called in parallel by two processes or another process creates a DL> pair device just after you exit the loop ? No, there is indeed a race. However, since this just makes a suggestion and relies on the subsequent call to try to instantiate the interface, I don't think there's a chance for anything other than a spurious failure. This is specifically why I wanted to get this on the list sooner than later. I figured (or hoped) that given the experience in this group that someone could offer some educated suggestions before I jumped in and started trying to fix it. >> + if (1 > strlen(veth1)) { DL> Why do you check with strlen > 1 ? To be honest, I have no idea why Dave did that. I'll check with him to see if there's something we're missing. It's probably worth a comment if so. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@xxxxxxxxxx
Attachment:
pgpkD6p0LIa2H.pgp
Description: PGP signature
-- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list