[libvirt] [PATCH v2 05/12] migration: refactor: merge direct and p2p into unmanaged

Nikolay Shirokovskiy nshirokovskiy at parallels.com
Fri Sep 18 08:51:39 UTC 2015



On 17.09.2015 02:11, John Ferlan wrote:
> 
> 
> On 09/10/2015 09:20 AM, Nikolay Shirokovskiy wrote:
>> p2p plain and direct function are good candidates for code reuse. Their main
>> function is same - to branch among different versions of migration protocol and
>> implementation of this function is also same. Also they have other common
>> functionality in lesser aspects. So let's merge them.
>>
>> But as they have different signatures we have to get to convention on how to
>> pass direct migration 'uri' in 'dconnuri' and 'miguri'. Fortunately we alreay
>> have such convention in parameters passed to toURI2 function, just let's follow
>> it. 'uri' is passed in miguri and dconnuri is ignored.
>>
>> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
>> ---
>>  src/libvirt-domain.c |  140 ++++++++++++++------------------------------------
>>  1 files changed, 39 insertions(+), 101 deletions(-)
>>
>> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
>> index 15de714..1631944 100644
>> --- a/src/libvirt-domain.c
>> +++ b/src/libvirt-domain.c
>> @@ -3339,21 +3339,23 @@ virDomainMigratePeer2PeerParams(virDomainPtr domain,
>>  }
>>  
>>  static int
>> -virDomainMigratePeer2PeerPlain(virDomainPtr domain,
>> -                               const char *xmlin,
>> -                               unsigned int flags,
>> -                               const char *dname,
>> -                               const char *dconnuri,
>> -                               const char *uri,
>> -                               unsigned long long bandwidth)
>> +virDomainMigrateUnmanaged(virDomainPtr domain,
>> +                          const char *xmlin,
>> +                          unsigned int flags,
>> +                          const char *dname,
>> +                          const char *dconnuri,
>> +                          const char *miguri,
>> +                          unsigned long long bandwidth)
> 
> Perhaps should have just used that "Unmanaged" name all along as this
> patch has two things going on - renaming a function and merging another
> into it.  Perhaps even with the miguri parameter change too!

I guess you mean use unmanaged instead p2p plain, but wouldn't it be just
moving second thing from here to erlier patches staying again with two
things. I could move this rename to a different patch but it would
be too simple i guess. And what is more important, we here merge 2 functions
so the name should be "merged" too, ie should be made more abstract.

As to miguri, i'll move this into a different patch.





More information about the libvir-list mailing list