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

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

 



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

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