Re: [PATCH] Allow address lease query with inactive domain

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

 



On Wed, Sep 7, 2016 at 11:41 AM, Daniel P. Berrange <berrange@xxxxxxxxxx> wrote:
> On Wed, Sep 07, 2016 at 11:18:58AM +0200, Amador Pahim wrote:
>> The <drive>DomainInterfaceAddresses, when using the source type
>> LEASE, does not need the domain to be running. It only checks the
>> dhcp lease file and gets the address information from a valid lease,
>> if any.
>>
>> This patch removes the virDomainObjIsActive(vm) check from the LEASE
>> query type on both qemu and lxc drivers, keeping it only for query
>> type AGENT on qemu driver (since lxc does not support AGENT type).
>
> I don't think we should do this. IMHO it only makes sense to ask for
> the IP address when the guest is actually running. The fact that we
> might still happen to have an old IP address stored in the lease
> file is merely a happy accident and not something we should guarantee
> by exposing ability to get it in the API.

The fact that the guest is running does not mean the lease information is
accurate. Guest IP can be manually changed. IP can be allocated by
someone else between the true virDomainObjIsActive(vm) and the actual
DHCPACK. We don't guarantee the information in any case, unless you
change the query type to AGENT. One can parse the lease file by itself
(and check if the lease is not expired), it's cheaper than create(), query
the lease addresses, destroy(). This patch tries to avoid both.

>
>
> Regards,
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



-- 
Pahim

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