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

Re: [libvirt] [PATCH libvirt-java 8/9] Implement and use virDomainMigrateToURI2 instead of virDomainMigrateToURI



At Mon, 07 Jan 2013 17:10:16 -0700,
Eric Blake wrote:
> 
> On 01/05/2013 04:48 AM, Wido den Hollander wrote:
> > The migrateToURI method now uses virDomainMigrateToURI2 so we can support
> > some more features.
> > 
> 
> > +    public int migrateToURI(String dconnuri, String miguri, String dxml, long flags, String dname, long bandwidth) throws LibvirtException {
> > +        int returnValue = libvirt.virDomainMigrateToURI2(VDP, dconnuri, miguri, dxml, new NativeLong(flags), dname, new NativeLong(bandwidth));
> > +        processError();
> > +        return returnValue;
> > +    }
> > +
> 
> >       */
> >      public int migrateToURI(String uri, long flags, String dname, long bandwidth) throws LibvirtException {
> > -        int returnValue = libvirt.virDomainMigrateToURI(VDP, uri, new NativeLong(flags), dname, new NativeLong(bandwidth));
> > -        processError();
> > -        return returnValue;
> > +        return migrateToURI(uri, null, null, flags, dname, bandwidth);
> >      }
> 
> When you make changes like this, you need to worry about back-compat
> issues.  Remember, older versions of libvirt did not have
> virDomainMigreateToURI2, so you may be effectively turning the old
> migrateToURI(4-args) into a call to a new API, which will break when
> targetting older libvirt, whereas if you kept it as a call to the older
> libvirt.virDomainMigrateToURI, the older libvirt can still do the
> migration.

I already checked this. (Wido, it would have been nice if you said
when this libvirt function came into existence, so review would have
been easier.)

Currently, libvirt 0.9.12 is required by libvirt-java evidenced by
this line in build.properties:

libvirt.required=0.9.12

virDomainMigreateToURI2 was introduced in libvirt 0.9.2.

> There may be more patches like this in your series, but in
> general, you should favor forwarding calls to the older API, not the
> newer API, so that the clients will work against as many libvirt
> versions as possible.

OK, this makes sense. But where do we draw the line?

Claudio
-- 
AV-Test GmbH, Henricistra├če 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern


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