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

Eric Blake eblake at redhat.com
Tue Jan 8 00:10:16 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130107/6c3d09ad/attachment-0001.sig>


More information about the libvir-list mailing list