[libvirt] [PATCH] leaseshelper: add enhancements to support all events

Nehal J Wani nehaljw.kkd1 at gmail.com
Mon Jul 21 21:00:53 UTC 2014


On Thu, Jul 17, 2014 at 9:38 PM, Eric Blake <eblake at redhat.com> wrote:
> On 07/17/2014 09:18 AM, Peter Krempa wrote:
>
>>>> A second issue that comes into my mind is compatibility with already
>>>> existing files. Does this work when you already have a lease file? (I
>>>> didn't try it, I'm just asking).
>>>
>>> If we use the --leasefile-ro option, then although this method will
>>> work, but no, the lease file will *not* be read/written at all. So
>>> even if an old one exists, its of no use.
>>> But then again, the use of --leasefile-ro is mandatory, so that all
>>> events are captured by our helper program. For example, renew of a
>>> lease.
>>
>> My concerns are whether this will work in the case you already used the
>> leases helper as the patch is adding a few fields to the stored format.
>
> In particular, this scenario MUST work:
>
> A user installs libvirt 1.2.6, and starts a guest (which creates a
> leases file and longrunning helper app).  Then the user upgrades to
> libvirt 1.2.7 and restarts libvirtd.  The new libvirt MUST be able to
> interact with the running guest that is still using the older-style
> leases file and helper app, with no loss of behavior to the guest.
>
> Also, this scenario MUST work:
>
> A user installs libvirt 1.2.6.  Then they upgrade to libvirt 1.2.7, but
> without restarting libvirtd.  Then they start a guest.  Note that the
> upgrade means that the leaseshelper application that will be started is
> the 1.2.7 build, but the command line to start it will be triggered by
> the 1.2.6 libvirtd.  The new helper must do everything that the old
> helper did, so that the old libvirtd does not have any hiccups in operation.
>
> The easiest way to ensure that both directions of version mismatch are
> well-behaved is to make sure that either side can be newer than the
> other, that the changes are purely additive in nature, and that there
> are sane defaults in place in the newer code when dealing with the older
> data that lacks the additions.  Also, while upgrade is a required
> scenario, downgrade generally is not (going from 1.2.7 back to 1.2.6
> while a guest is still running, or expecting 1.2.7 libvirtd to be able
> to use 1.2.6 leaseshelper, is nice if it works but not a showstopper if
> it doesn't).

This patch only adds functionality, and is backwards compatible with
the version of leases file generated by older version of leaseshelper.
Anyway, the older version wasn't much helpful after the lease expired.
This patch rectifies it. I'll send a v2 shortly.



Regards,
Nehal J Wani




More information about the libvir-list mailing list