On 11/13/25 23:47, Kim, Dongwon wrote:
>> One option could be to explicitly destroy all stored objs upon hibernation, 
>> that
>> way the restoring will always work.
> Yes, we can do it to avoid that corner case. Or maybe we can just let it just 
> run.
> In this case, virtio_gpu_object_restore_all won't fail as shmem init will 
> still work
> but QEMU will justsend back errored replies as all of those resources for BOs 
> are
> still there in QEMU side but I think it won't break anything. Do you see any 
> issues in
> doing this that I might be missing?? My assumption here is that the QEMU 
> hasn't
> done any of virtio-gpu resets here as hibernation failed.

Correct, QEMU will emit a ton of "resource already exists" errors on
aborted hibernation. There should be no errors neither from guest, nor
from host. Note that QEMU is not the only VMM using VirtIO-GPU.

Two options here:

1. Destroy stored host resources upon hibernation
2. Extend hibernation core [1] with addition of PM_HIBERNATION_UNPREPARE
event that will be invoked when hibernation fails, while
PM_POST_HIBERNATION will be invoked only after a successful hibernation

You may start with implementing the first option right away and later
implement the second.

[1]
https://elixir.bootlin.com/linux/v6.17.7/source/kernel/power/hibernate.c#L827

-- 
Best regards,
Dmitry

Reply via email to