Comment 2 for bug 1428674

Revision history for this message
Robie Basak (racb) wrote :

Thank you for reporting this and for the merge proposal. Unfortunately it breaks "uvt-kvm wait" though, since that command uses inotify against the same file.

I think reading /proc/net/arp is fine as a fallback, but there is no guarantee that the VM will have an entry in the host's arp cache at the time that "uvt-kvm ip" is needed, so we can't rely on this.

It looks like libvirt's "leaseshelper" maintains /var/lib/libvirt/dnsmasq/virbr0.status in a similar manner to default.leases was maintained by dnsmasq before, so can we use this instead? Then we can just inotify on that for "uvt-kvm wait" when it is available, instead of default.leases.

So I think that the logic should be:

Look for /var/lib/libvirt/dnsmasq/virbr0.status. If it exists, check it, and if not present, inotify on it and check it again. If it does not exist, fall back to /var/lib/libvirt/dnsmasq/default.leases with the same behaviour. If that does not exist, fall back to /proc/net/arp. Perhaps we should also fall back if the file did exist but the entry was not found, though that needs some thinking for maintaining active inotify waits on both files at once.

This way we'll cover both "uvt-kvm wait" and "uvt-kvm ip" as well as be easily backportable to previous releases. Any objections to this approach?

Jorge: I'll go ahead and start to implement this tomorrow. Or if you'd like to do it, let me know.