[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



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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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