[PATCH 3/3] lib: Require path in virDomainRestoreParams()
Claudio Fontana
cfontana at suse.de
Fri May 13 07:51:17 UTC 2022
On 5/13/22 9:28 AM, Michal Prívozník wrote:
> On 5/12/22 19:09, Claudio Fontana wrote:
>> Hello Michal,
>>
>> this seems to be going backwards to special case arguments instead of putting them into typed parameters.
>> I do not understand where this need comes from, but it does not seem a good direction to me.
>
> The need stems from my testing python bindings for these new APIs that
> I'm writing. When I call the restore API with no arguments, which is
> equivalent to calling plain virDomainRestoreParams(conn, NULL, 0, 0);
> then I see the following error:
>
> libvirt: QEMU Driver error : Failed to open file '(null)': Bad address
>
> Obviously, this is wrong. And indeed, when I think about the API more
> then the path to restore from is critical, at least for now. But as I
> suggests in one of my previous replies, I'm going to make path required
> in typed params for now. If we ever come with an alternative source for
> restore then that check can be relaxed.
>
> Michal
>
Thanks for the explanation, indeed the FILE parameter is not an optional parameter,
but a mandatory one. I assumed mandatory/optional parameters was already handled by
the libvirt machinery, but clearly it isn't.
Thanks,
Claudio
More information about the libvir-list
mailing list