Daniel P. Berrange wrote:
>>> This looks safe, but there's a subtle problem with
changing the existing
>>> virDomainAttachDevice() entry point to call virDomainAttachDeviceFlags().
>>> It will break compatability with old libvirtd, even though the old
>>> libvirtd supports the virDomainAttachDevice() code.
>>>
> Ah, yes - good catch. Thanks.
>
>
>>> So we need to keep
>>> the distinct paths in the public API & driver definitions. The eventual
>>> low level hypervisor drivers can of course just turn their existing
>>> impl into a thin wrapper to the new method..
>>>
>>>
>> There's one other option actually - we could put compatability code in
>> the remote driver client instead. Either, make it always invoke the old
>> RPC call if flags == VIR_DOMAIN_DEVICE_MODIFY_LIVE, or have it invoke
>> the new RPC call & fallback to the old RPC call if it gets an error
>> indicating the new one doesn't exist.
>>
>>
> Do you prefer the latter option? After a quick look, I didn't spot any
> existing compatibility code in the remote driver client. The first
> option might be slightly better wrt maintenance.
>
Yes, the first option is certainly simpler / clearer code todo, so lets
just do that first. We can easily revisit adding compat code in the
remote driver client at a later date if we find it to be neccessary.
Revised patch below.
Thanks,
Jim