qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] virtio-mem: Implement Resettable interface instead of us


From: Peter Maydell
Subject: Re: [PATCH 3/4] virtio-mem: Implement Resettable interface instead of using LegacyReset
Date: Thu, 8 Aug 2024 13:25:39 +0100

On Tue, 6 Aug 2024 at 17:08, Juraj Marcin <jmarcin@redhat.com> wrote:
>
> LegacyReset does not pass ResetType to the reset callback method, which
> the new Resettable interface uses. Due to this, virtio-mem cannot use
> the new RESET_TYPE_WAKEUP to skip reset during wake-up from a suspended
> state.
>
> This patch adds the Resettable interface to the VirtioMemClass interface
> list, implements the necessary methods and replaces
> qemu_[un]register_reset() calls with qemu_[un]register_resettable().

> @@ -1887,6 +1897,7 @@ static const TypeInfo virtio_mem_info = {
>      .class_size = sizeof(VirtIOMEMClass),
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_RAM_DISCARD_MANAGER },
> +        { TYPE_RESETTABLE_INTERFACE },
>          { }
>      },
>  };

TYPE_VIRTIO_MEM is-a TYPE_VIRTIO_DEVICE, which is-a TYPE_DEVICE,
which implements the TYPE_RESETTABLE_INTERFACE. In other words,
as a device this is already Resettable. Re-implementing the
interface doesn't seem like the right thing here (it probably
breaks the general reset implementation in the base class).
Maybe what you want to do here is implement the Resettable
methods that you already have?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]