virtio-mem: Use new Resettable framework instead of LegacyReset

LegacyReset does not pass ResetType to the reset callback method, which
the new Resettable framework uses. Due to this, virtio-mem cannot use
the new RESET_TYPE_WAKEUP to skip the reset during wake-up from a
suspended state.

This patch adds overrides Resettable interface methods in VirtIOMEMClass
to use the new Resettable framework and replaces
qemu_[un]register_reset() calls with qemu_[un]register_resettable().

Message-ID: <20240904103722.946194-4-jmarcin@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
Juraj Marcin 2024-09-04 12:37:14 +02:00 committed by David Hildenbrand
parent 759cbb4ee9
commit c009a311e9
2 changed files with 28 additions and 14 deletions

View file

@ -14,6 +14,7 @@
#define HW_VIRTIO_MEM_H
#include "standard-headers/linux/virtio_mem.h"
#include "hw/resettable.h"
#include "hw/virtio/virtio.h"
#include "qapi/qapi-types-misc.h"
#include "sysemu/hostmem.h"
@ -115,6 +116,9 @@ struct VirtIOMEM {
/* listeners to notify on plug/unplug activity. */
QLIST_HEAD(, RamDiscardListener) rdl_list;
/* State of the resettable container */
ResettableState reset_state;
};
struct VirtIOMEMClass {