Re: [PATCH 1/3] plugin/amdgpu: Add plugin to inventory even if there are no vmas

Tvrtko Ursulin <[email protected]> Fri, 10 Apr 2026 16:46:44 +0100
Newsgroups dev.linux.lists.criu
Message-ID <[email protected]>
On 10/04/2026 15:45, David Francis wrote:
> The amdgpu plugin is added to the plugin inventory as the first
> vma map is dumped. But it's completely possible for a process to
> have driver files open but no vma maps. In this case, we still
> will need the plugin on restore.
> 
> Add the plugin to the inventory whenever a device file is dumped.
> 
> Signed-off-by: David Francis <[email protected]>
> ---
>   plugins/amdgpu/amdgpu_plugin.c | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/plugins/amdgpu/amdgpu_plugin.c b/plugins/amdgpu/amdgpu_plugin.c
> index e3ba0de64..89ab10dac 100644
> --- a/plugins/amdgpu/amdgpu_plugin.c
> +++ b/plugins/amdgpu/amdgpu_plugin.c
> @@ -1439,6 +1439,15 @@ int amdgpu_plugin_dump_file(int fd, int id)
>   		if (ret)
>   			return ret;
>   
> +		if (!plugin_added_to_inventory) {
> +			ret = add_inventory_plugin(CR_PLUGIN_DESC.name);
> +			if (ret) {
> +				pr_err("Failed to add AMDGPU plugin to inventory image\n");
> +				return ret;
> +			}
> +			plugin_added_to_inventory = true;
> +		}
> +
>   		ret = record_dumped_fd(fd, true);
>   		if (ret)
>   			return ret;
> @@ -1543,6 +1552,15 @@ int amdgpu_plugin_dump_file(int fd, int id)
>   	if (ret)
>   		goto exit;
>   
> +	if (!plugin_added_to_inventory) {
> +		ret = add_inventory_plugin(CR_PLUGIN_DESC.name);
> +		if (ret) {
> +			pr_err("Failed to add AMDGPU plugin to inventory image\n");
> +			goto exit;
> +		}
> +		plugin_added_to_inventory = true;
> +	}
> +
>   exit:
>   	xfree((void *)args.devices);
>   	xfree((void *)args.bos);

This is very similar to the patch I submitted and you reviewed. Just so 
happens I have to rebase since when I collected all r-b's the series 
does not apply any longer. I don't mind hugely if you take authorship 
but some sort of a acknowledgement tag would have been nice.

Regards,

Tvrtko