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

"Francis, David" <[email protected]> Fri, 10 Apr 2026 16:15:43 +0000
Newsgroups dev.linux.lists.criu
Message-ID <SA1PR12MB814456FDAAD6513F172260DFEF592@SA1PR12MB8144.namprd12.prod.outlook.com>
> 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.

My apologies; I was working on this in parallel with reviewing your
patches and missed the similarity. Yours is fine, or I can add
an attribution tag.

Sorry again,
David

________________________________________
From: Tvrtko Ursulin <[email protected]>
Sent: Friday, April 10, 2026 11:46 AM
To: Francis, David; [email protected]
Subject: Re: [PATCH 1/3] plugin/amdgpu: Add plugin to inventory even if there are no vmas


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