> >> + virReportError(VIR_ERR_INTERNAL_ERROR, >> + _("No leases available for network: %s"), >> obj->def->name); > > Hmm, if we have started the network, but no VMs have yet booted, then > will we find that the lease file does not exist ? Or is the lease > file guaranteed to exist, even if no leases have been assigned yet. > > Basically we must make sure we don't return an error if no leases > have been handed out yet - just return 0 lease results. > The custom lease file - <network-name>.status is not guaranteed to exist. It will exist only if lease(s) have been handed out for that network or the lease(s) have expired but the network is still on. So, I'll just add rv = 0 in the above block before going to cleanup, so that error is not reported in case the file doesn't exist. -- Nehal J Wani -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list