Remove the test test_validate_caps_pair, which asserted postcopy-ram and mapped-ram capabilities cannot be active together. The new fast snapshot load feature is exactly this pair of capabilities active together, with the following patches in this series, this combination will now supported and be functional. Remove the capability check that rejected mapped-ram and postcopy-ram being set simultaneously, as this combination now corresponds to fast snapshot load. Add a capability check against setting multifd when configured for fast snapshot load as it is not supported yet. Also add capability check against setting postcopy-preempt as it is incompatible. Add infrastructure to check postcopy_notifier_list being empty in capaility checking to block vhost-user with fast snapshot load as it is not supported. Add a check to bail in migrate_prepare to prevent unexpected usage when fast snapshot load is enabled. A smoke test exercising this feature has been added further in this series. Signed-off-by: Aadeshveer Singh <aadeshveer07@gmail.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
81 lines
2.1 KiB
C
81 lines
2.1 KiB
C
/*
|
|
* Notifier lists
|
|
*
|
|
* Copyright IBM, Corp. 2010
|
|
*
|
|
* Authors:
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
* the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#ifndef QEMU_NOTIFY_H
|
|
#define QEMU_NOTIFY_H
|
|
|
|
#include "qemu/queue.h"
|
|
|
|
typedef struct Notifier Notifier;
|
|
|
|
struct Notifier
|
|
{
|
|
void (*notify)(Notifier *notifier, void *data);
|
|
QLIST_ENTRY(Notifier) node;
|
|
};
|
|
|
|
typedef struct NotifierList
|
|
{
|
|
QLIST_HEAD(, Notifier) notifiers;
|
|
} NotifierList;
|
|
|
|
#define NOTIFIER_LIST_INITIALIZER(head) \
|
|
{ QLIST_HEAD_INITIALIZER((head).notifiers) }
|
|
|
|
void notifier_list_init(NotifierList *list);
|
|
|
|
void notifier_list_add(NotifierList *list, Notifier *notifier);
|
|
|
|
void notifier_remove(Notifier *notifier);
|
|
|
|
void notifier_list_notify(NotifierList *list, void *data);
|
|
|
|
bool notifier_list_empty(NotifierList *list);
|
|
|
|
/* Same as Notifier but allows .notify() to return errors */
|
|
typedef struct NotifierWithReturn NotifierWithReturn;
|
|
|
|
/* Return int to allow for different failure modes and recovery actions */
|
|
typedef int (*NotifierWithReturnFunc)(NotifierWithReturn *notifier, void *data,
|
|
Error **errp);
|
|
|
|
struct NotifierWithReturn {
|
|
/**
|
|
* Return 0 on success (next notifier will be invoked), otherwise
|
|
* notifier_with_return_list_notify() will stop and return the value.
|
|
*/
|
|
NotifierWithReturnFunc notify;
|
|
QLIST_ENTRY(NotifierWithReturn) node;
|
|
};
|
|
|
|
typedef struct NotifierWithReturnList {
|
|
QLIST_HEAD(, NotifierWithReturn) notifiers;
|
|
} NotifierWithReturnList;
|
|
|
|
#define NOTIFIER_WITH_RETURN_LIST_INITIALIZER(head) \
|
|
{ QLIST_HEAD_INITIALIZER((head).notifiers) }
|
|
|
|
void notifier_with_return_list_init(NotifierWithReturnList *list);
|
|
|
|
void notifier_with_return_list_add(NotifierWithReturnList *list,
|
|
NotifierWithReturn *notifier);
|
|
|
|
void notifier_with_return_remove(NotifierWithReturn *notifier);
|
|
|
|
int notifier_with_return_list_notify(NotifierWithReturnList *list,
|
|
void *data, Error **errp);
|
|
|
|
bool notifier_with_return_list_empty(NotifierWithReturnList *list);
|
|
|
|
#endif
|